SlideShare a Scribd company logo
1
Get ready for moving from
Java 6 to Java 8 – Now!
René Winkelmeyer
24.03.2016
2
•  Skype / Twitter / LinkedIn / Slideshare
muenzpraeger
•  Web
https://blog.winkelmeyer.com
•  Mail
mail@winkelmeyer.com
OpenNTF
•  File Navigator
•  Generic NSF View Widget for IBM Connections
About me
René Winkelmeyer
Head of Development
3
YES – I CAN!
4
A timeline perspective
§  Quick poll
§  IBM Notes/Domino development?
§  WebSphere development?
§  Java 6 only development?
§  Java 7+ only development?
§  Mixed Java version development?
5
A timeline perspective
6
A timeline perspective
Java 6
23.12.2006
Java 7
28.07.2011
Java 8
18.03.2014
Java 9
23.03.2017
Javaversionsby
releasedate
IBM Notes/
Domino
IBM
WebSphere
(Full Profile)
IBM
WebSphere
(Liberty
Profile)
SupportedJava
version
byproduct
7
What this session covers
§  Switch-strings
§  Diamonds
§  Paths
§  Lambdas
§  Streams
§  Date/Time
8
Goodbye if-then-elseif-elseif-elseif… for Strings
9
Goodbye if-then-elseif-elseif-elseif… for Strings
Way in Java 6 and
smaller to check
for different String
types
10
Goodbye if-then-elseif-elseif-elseif… for Strings
§  Java 7 added support for java.lang.String in switch
§  Increased readability
§  Produces more efficient byte code
§  Switching based on the hashcode()
§  May (still) throw a NullPointerException
11
Goodbye if-then-elseif-elseif-elseif… for Strings
Now a clean way.
Alternative could be to
use Enums (also prior
Java 7).
12
Diamonds are developers best friends
13
Diamonds are developers best friend
§  Java 7 introduced the usage of the <> operator for type inference
§  Removes verbose code
§  Makes usage of 3rd party libs like Google Guava for List creation
obsolete
14
Diamonds are developers best friend
Raw error warning in Eclipse. Technically possible, but not recommended.
How to do it. Imagine HashMap<String, HashMap<String, Object>> i. e.
Diamond operator for less code writing. ;-)
15
Automated resource management
16
Automated resource management (simple)
Close in finally
Multiple exceptions to catch
Init outside the try to close it later
17
Automated resource management
§  Java 7 introduced the new java.lang.AutoCloseable interface
§  Resources that inherit from this interface are automatically closed when
created within a try statement
§  Reduces boilerplate code drastically
§  java.lang.Closeable extends from java.lang.AutoCloseable
§  AutoCloseable.close() shouldn‘t be called twice!
18
Automated resource management (simple)
Close in finally
Multiple exceptions to catch
Init outside the try to close it later
19
Automated resource management (simple)
No finally, no close()
20
Automated resource management (more)
Multiple streams to close
Multiple streams to handle
Multiple streams to close
21
Automated resource management (more)
„Join“ multiple AutoCloseables with
a ; separator within the try statement
22
Underscore me
23
Underscore me
§  You‘ve two seconds to identify these numbers
24
Underscore me
§  The with Java 7 introduced capability allows to add underscores to
numeric types (int, double, long).
§  A few rules to obey:
§  Can be used after the decimal point, but not directly before/after it
§  No underscores at the end or the beginning (i. e. _5000 or 5000_)
25
Underscore me
§  You‘ve two seconds to identify these numbers
26
Underscore me
§  You‘ve two seconds to identify these n_e_w numbers
27
Catch me if you can
28
Catch me if you can
One catch per named exception
29
Catch me if you can
multi-catch has been
introduced with Java 7
30
NIO.2
31
NIO.2
§  The handling of file system related actions has been much improved
with Java 7.
§  Removes the need in a lot of cases to rely on 3rd pary libraries like
Apache Commons Files.
§  Direct implementation in the base JDK
32
NIO.2
§  java.nio.Path
§  Think of it as a replacement for java.io.File
§  Represents a file or a folder – and it doesn‘t need to exist (no
Exception ;-))
§  java.nio.Files
§  Loads of utility classes for file and folder handling
33
Make your Path (and more)
34
Make your Path (and more)
35
Watch your files
Initiates the default WatchService as introduced with Java 7
Assign the to be monitored path using the new java.nio.Path API
Register the created WatchService with the path. Events that can be monitored
are create, update and delete.
36
Watch your files
Holds the results of the
monitored events
Map of all
found events
37
default
38
default
§  Changes in Interfaces always led to changes in the classes they
used them
§  The new default constructor introduces „backward“ compatibility
39
Before Java 8
40
Before Java 8
Adding a new
Interface method
Compilation
error on all
classes that
implement
the Interface
41
With Java 8
Method body
needed
42
With Java 8
Calling a
duplicate
default
method
43
Lambdas
44
Lambdas
§  One of the biggest changes with Java 8
§  Known from other languages like Closure, Scala, C# and more
§  Defined in Java Specification Request (JSR) 335
§  Knows as closures or functional literals in other languages
§  Love or hate them – there‘s no way around them!
45
Lambdas
Standard boilerplate
code to iterate
Sequential, not parallel!
46
Lambdas
Anonymous methods to
the rescue but ...
Have you spotted the forEach?
47
Lambdas
Calling the anonymous
inner method directly
via a lambda call
48
Lambdas
Shorten it even more by
omitting the casting
49
Lambdas
50
Lambdas
51
Streams
52
What is a stream and what not?
§  It is a pipeline of functions that can be evaluated.
§  They are not a data structure.
§  They can transform data – but cannot mutate them.
53
Available stream functions
Source:http://zeroturnaround.com/rebellabs/java-8-streams-cheat-sheet/attachment/java-8-
streams-cheat-sheet-v3/
54
Streams
Calling the stream
Termination call
55
Streams and Lambdas
Much cleaner
implementation using
Streams and Lambdas
Obey the new lines –
better for debugging...
56
Streams – a little bit more complete
Output:
C1
C2
57
Streams – a little bit more complete
Source:http://zeroturnaround.com/rebellabs/java-8-streams-cheat-sheet/attachment/java-8-
streams-cheat-sheet-v3/
58
Date and Time
59
Date and Time
§  Who loves Date and Time operations in Java?
§  Who is using Joda Time?
60
Date and Time – Spot the error
+1900 0-based
61
Date and Time – Basic Concept
§  LocalDate, LocalTime, LocalDateTime
§  Instant (amount of time since the epoch, i. e. for timestamps)
§  Period
§  Duration
62
Date and Time – Examples
§  Now -> LocalDate.now()
§  Static -> LocalDate(2013, Month.JANUARY, 21)
§  Parse -> LocalDate.parse()
§  Conversion -> Calendar.getInstance().toInstant()
63
Date and Time – Examples
64
Date and Time – Examples
65
Q & A!

More Related Content

What's hot (20)

KEY
Productivity 101: Making a Easily Re-deployable Dev Environment with Subversion
ryanduff
 
PPTX
002. Working with Webpack
Binh Quan Duc
 
PDF
Professional WordPress Development with Vagrant - Andrea Cardinali - WordCam...
Andrea Cardinali
 
PDF
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Andrea Cardinali
 
PDF
Building a community of Open Source intranet users
Luke Oatham
 
PDF
Nürnberg WooCommerce Talk - 11/24/16
tshellberg
 
PPTX
Blazor v1.1
Juan Luis Guerrero Minero
 
PPTX
A crash course in scaling wordpress
GovLoop
 
PPTX
WP-CLI: WordCamp Nashville 2016
Terell Moore
 
PDF
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Gavin Pickin
 
PPTX
The Velvet Revolution: Modernizing Traditional ASP.NET Apps with Docker
Elton Stoneman
 
PDF
Using WebSockets with ColdFusion
cfjedimaster
 
PPTX
MEAN Stack
Dotitude
 
PPTX
WebAssembly WASM Introduction Presentation
Brad Beiermann
 
PDF
WebAssembly with Rust
Knoldus Inc.
 
PPTX
DotNet MVC and webpack + Babel + react
Chen-Tien Tsai
 
PDF
WordPress + Docker - Reusable WordPress development environments
Jordan West
 
PDF
WebAssembly vs JavaScript: What is faster?
Alexandr Skachkov
 
PPTX
Manage your environment with DSC
Gian Maria Ricci
 
Productivity 101: Making a Easily Re-deployable Dev Environment with Subversion
ryanduff
 
002. Working with Webpack
Binh Quan Duc
 
Professional WordPress Development with Vagrant - Andrea Cardinali - WordCam...
Andrea Cardinali
 
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Andrea Cardinali
 
Building a community of Open Source intranet users
Luke Oatham
 
Nürnberg WooCommerce Talk - 11/24/16
tshellberg
 
A crash course in scaling wordpress
GovLoop
 
WP-CLI: WordCamp Nashville 2016
Terell Moore
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Gavin Pickin
 
The Velvet Revolution: Modernizing Traditional ASP.NET Apps with Docker
Elton Stoneman
 
Using WebSockets with ColdFusion
cfjedimaster
 
MEAN Stack
Dotitude
 
WebAssembly WASM Introduction Presentation
Brad Beiermann
 
WebAssembly with Rust
Knoldus Inc.
 
DotNet MVC and webpack + Babel + react
Chen-Tien Tsai
 
WordPress + Docker - Reusable WordPress development environments
Jordan West
 
WebAssembly vs JavaScript: What is faster?
Alexandr Skachkov
 
Manage your environment with DSC
Gian Maria Ricci
 

Viewers also liked (14)

PDF
SNoUG 2015 - Vaadin - XPages 2.0?
René Winkelmeyer
 
PDF
SOCCNX 2015 - Application Integration Blast
René Winkelmeyer
 
PDF
ICONUK 2014 - From Idea To App
René Winkelmeyer
 
PPTX
Salesforce Developer User Group Munich - October 2016
René Winkelmeyer
 
PDF
engage 2015 - IBM Notes Traveler Daily Business
René Winkelmeyer
 
PDF
DNUG 2016 - Salesforce and IBM Domino - same same, but different
René Winkelmeyer
 
PDF
Connect 2016 - Going Mobile With IBM Verse
René Winkelmeyer
 
PPTX
2016 SUTOL - Salesforce App Cloud and Domino - same same, but different
René Winkelmeyer
 
PDF
Connect 2016 - IBM Mobile Connect - Real World Usage Scenarios
René Winkelmeyer
 
PPTX
2016 ISBG - Salesforce App Cloud and Domino - same same, but different
René Winkelmeyer
 
PPTX
2016 ISBG - Enterprise integration done right with Salesforce Lightning, IBM ...
René Winkelmeyer
 
PPTX
ConnectED 2015 - IBM Notes Traveler Daily Business
René Winkelmeyer
 
PDF
engage 2015 - Domino App Development - Where should I go now?
René Winkelmeyer
 
PPTX
Introduction to OAuth 2.0 - the technology you need but never really learned
Mikkel Flindt Heisterberg
 
SNoUG 2015 - Vaadin - XPages 2.0?
René Winkelmeyer
 
SOCCNX 2015 - Application Integration Blast
René Winkelmeyer
 
ICONUK 2014 - From Idea To App
René Winkelmeyer
 
Salesforce Developer User Group Munich - October 2016
René Winkelmeyer
 
engage 2015 - IBM Notes Traveler Daily Business
René Winkelmeyer
 
DNUG 2016 - Salesforce and IBM Domino - same same, but different
René Winkelmeyer
 
Connect 2016 - Going Mobile With IBM Verse
René Winkelmeyer
 
2016 SUTOL - Salesforce App Cloud and Domino - same same, but different
René Winkelmeyer
 
Connect 2016 - IBM Mobile Connect - Real World Usage Scenarios
René Winkelmeyer
 
2016 ISBG - Salesforce App Cloud and Domino - same same, but different
René Winkelmeyer
 
2016 ISBG - Enterprise integration done right with Salesforce Lightning, IBM ...
René Winkelmeyer
 
ConnectED 2015 - IBM Notes Traveler Daily Business
René Winkelmeyer
 
engage 2015 - Domino App Development - Where should I go now?
René Winkelmeyer
 
Introduction to OAuth 2.0 - the technology you need but never really learned
Mikkel Flindt Heisterberg
 
Ad

Similar to engage 2016 - Get ready for moving from Java 6 to Java 8 - Now! (20)

PPTX
Java 7 & 8
Ken Coenen
 
PPTX
Java 7 & 8 - A&BP CC
JWORKS powered by Ordina
 
PPTX
Java 7 & 8 New Features
Leandro Coutinho
 
PPTX
New Features of JAVA SE8
Dinesh Pathak
 
PPTX
Java se7 features
Kumaraswamy M
 
PPTX
Java SE 8 - New Features
Naveen Hegde
 
PPTX
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Emiel Paasschens
 
PPT
Java user group 2015 02-09-java8
Marc Tritschler
 
PPT
Java user group 2015 02-09-java8
marctritschler
 
PPT
Java7
Dinesh Guntha
 
PDF
Java 8 features
Oleg Tsal-Tsalko
 
PPT
Java SE 7 New Features and Enhancements
Fu Cheng
 
PDF
Java 7 workshop
Dennis Laumen
 
PPTX
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Olena Syrota
 
PPTX
What is new in Java 8
Sandeep Kr. Singh
 
PPTX
Java8: what's new and what's hot
Sergii Maliarov
 
PPTX
A-Brief-Introduction-To-JAVA8_By_Srimanta_Sahu
Srimanta Sahu
 
PDF
java04
mahes3231
 
DOCX
Colloquium Report
Mohammad Faizan
 
PDF
What's new in Java 8
jclingan
 
Java 7 & 8
Ken Coenen
 
Java 7 & 8 - A&BP CC
JWORKS powered by Ordina
 
Java 7 & 8 New Features
Leandro Coutinho
 
New Features of JAVA SE8
Dinesh Pathak
 
Java se7 features
Kumaraswamy M
 
Java SE 8 - New Features
Naveen Hegde
 
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Emiel Paasschens
 
Java user group 2015 02-09-java8
Marc Tritschler
 
Java user group 2015 02-09-java8
marctritschler
 
Java 8 features
Oleg Tsal-Tsalko
 
Java SE 7 New Features and Enhancements
Fu Cheng
 
Java 7 workshop
Dennis Laumen
 
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Olena Syrota
 
What is new in Java 8
Sandeep Kr. Singh
 
Java8: what's new and what's hot
Sergii Maliarov
 
A-Brief-Introduction-To-JAVA8_By_Srimanta_Sahu
Srimanta Sahu
 
java04
mahes3231
 
Colloquium Report
Mohammad Faizan
 
What's new in Java 8
jclingan
 
Ad

More from René Winkelmeyer (13)

PPTX
2017 engage.ug - Salesforce and IBM for Developers
René Winkelmeyer
 
PDF
engage 2014 - JavaBlast
René Winkelmeyer
 
PDF
EntwicklerCamp 2014 - DOTS reloaded
René Winkelmeyer
 
PDF
BLUG 2013 - Mobile Application Delivery - Choices, choices, choices
René Winkelmeyer
 
PDF
Connect 2013 - Making IBM Traveler High Available: Extending And Securing The...
René Winkelmeyer
 
PDF
Connect 2013 - Infrastructure Fitness and Design Simplicity for IBM Mobile Co...
René Winkelmeyer
 
PDF
UKLUG 2011 - iOS devices in the enterprise
René Winkelmeyer
 
PDF
BLUG 2011 - Explaining the IBM Social Business Toolkit
René Winkelmeyer
 
PDF
ILUG 2010 - Deploying plug-ins to the enterprise
René Winkelmeyer
 
PDF
UKLUG 2009 - Extending Domino Designer on Eclipse
René Winkelmeyer
 
PDF
UKLUG 2012 - XPages Extensibility API - going deep!
René Winkelmeyer
 
PDF
Dominopoint 2012 - IBM Lotus Traveler High Availability in a nutshell
René Winkelmeyer
 
PPTX
NLLUG 2012 - XPages Extensibility API - going deep!
René Winkelmeyer
 
2017 engage.ug - Salesforce and IBM for Developers
René Winkelmeyer
 
engage 2014 - JavaBlast
René Winkelmeyer
 
EntwicklerCamp 2014 - DOTS reloaded
René Winkelmeyer
 
BLUG 2013 - Mobile Application Delivery - Choices, choices, choices
René Winkelmeyer
 
Connect 2013 - Making IBM Traveler High Available: Extending And Securing The...
René Winkelmeyer
 
Connect 2013 - Infrastructure Fitness and Design Simplicity for IBM Mobile Co...
René Winkelmeyer
 
UKLUG 2011 - iOS devices in the enterprise
René Winkelmeyer
 
BLUG 2011 - Explaining the IBM Social Business Toolkit
René Winkelmeyer
 
ILUG 2010 - Deploying plug-ins to the enterprise
René Winkelmeyer
 
UKLUG 2009 - Extending Domino Designer on Eclipse
René Winkelmeyer
 
UKLUG 2012 - XPages Extensibility API - going deep!
René Winkelmeyer
 
Dominopoint 2012 - IBM Lotus Traveler High Availability in a nutshell
René Winkelmeyer
 
NLLUG 2012 - XPages Extensibility API - going deep!
René Winkelmeyer
 

Recently uploaded (20)

PDF
Simplify React app login with asgardeo-sdk
vaibhav289687
 
PPTX
Build a Custom Agent for Agentic Testing.pptx
klpathrudu
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PPTX
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
Everything you need to know about pricing & licensing Microsoft 365 Copilot f...
Q-Advise
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PPTX
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Simplify React app login with asgardeo-sdk
vaibhav289687
 
Build a Custom Agent for Agentic Testing.pptx
klpathrudu
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Everything you need to know about pricing & licensing Microsoft 365 Copilot f...
Q-Advise
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 

engage 2016 - Get ready for moving from Java 6 to Java 8 - Now!