SlideShare uma empresa Scribd logo
1 de 28
Baixar para ler offline
Java SE 8 Features
Neuerungen in Java SE 8
pr sentiert von Sascha Kochä
12. M rz 2014ä
JUG Bielefeld
12.03.2014 Java SE 8
Alle freuen sich auf Java 8
Quelle www.heise.de
12.03.2014 Java SE 8
Programm f r heute abendü
● > 50 Neuerungen in Java SE 8
● Hands-on Session mit λ-Expressions, der
Stream API, den default methods und mehr
12.03.2014 Java SE 8
Java 8 JEPs General
● 126 Lambda Expressions & Virtual Extension Methods
(aka defender or default methods)
● 138 Autoconf-Based Build System (for the jdk itself)
● 160 Lambda-Form Representation for Method Handles
(reduce assembly code and native calls, performance optimization, reference implementation
of invokedynamic / JSR-292)
● 161 Compact Profiles (instead of jigsaw 140/24/17/10 MB)→
● 162 Prepare for Modularization
(getting ready for jigsaw, java.util.logging and swing)
12.03.2014 Java SE 8
Java 8 JEPs General
● 164 Leverage CPU Instructions for AES Cryptography
(Intel M rz 2008)ä
● 174 Nashorn JavaScript Engine
(lightweight, high-performance, ECMAScript-262 5.1)
● 176 Mechanical Checking of Caller-Sensitive Methods
(improve security of method-handle implementation, behaviour changed based on the caller)
● 179 Document JDK API Support and Stability
(mark core and non-core APIs, what is maintained?)
12.03.2014 Java SE 8
Java 8 JEPs Core
● 153 Launch JavaFX Applications
(launch() from java cmd line)
● 101 Generalized Target-Type Inference Code
(only partly realized)
● 104 Annotations on Java Types Code
(applied to any use of a type, not at runtime :( )
● 105 DocTree API (provide structured access to javadoc content)
● 106 Add Javadoc to javax.tools
(call javadoc from within vm)
12.03.2014 Java SE 8
Java 8 JEPs Core
● 117 Remove the Annotation-Processing Tool (in javac)
● 118 Access to Parameter Names at Runtime Code
(partly realized)
●
120 Repeating Annotations Code
(avoid container annotations, somehow)
● 139 Enhance javac to Improve Build Speed
(use of all available cores)
●
172 DocLint Code
(static doc analysis, Fusselig, W3C HTML 4.01 HTML conform)
12.03.2014 Java SE 8
Java 8 JEPs Garbage Collection
● 142 Reduce Cache Contention on Specified
Fields
(pad variables to avoid sharing cache lines)
● 122 Remove the Permanent Generation
(Permanently, PermGen moves to native memory)
●
173 Retire Some Rarely-Used GC Combination
(e.g. ParNew + SerialOld, reduce testing effort)
12.03.2014 Java SE 8
Java 8 JEPs Garbage Collection
● 142 Reduce Cache Contention on Specified
Fields
(pad variables to avoid sharing cache lines)
● 122 Remove the Permanent Generation
(Permanently, PermGen moves to native memory)
●
173 Retire Some Rarely-Used GC Combination
(e.g. ParNew + SerialOld, reduce testing effort)
12.03.2014 Java SE 8
Java 8 JEPs Runtime
● 136 Enhanced Verification Errors
(additional information bytecode verification errors)
● 147 Reduce Class Metadata Footprint
(taken from ME)
● 148 Small VM
(libjvm.so < 3MB, compiling size over speed)
● 171 Fence Intrinsics
(sun.misc.Unsafe, memory access)
12.03.2014 Java SE 8
Java 8 JEPs Core Libraries
●
103 Parallel Array Sorting (new methods in java.util.Arrays)
● 107 Bulk Data Operations for Collections
(java.util.function, java.util.stream)
●
109 Enhance Core Libraries with Lambda
(Java SE 7 has 4024 standard classes)
●
112 Charset Implementation Improvements
(fewer, quicker, better)
●
119 javax.lang.model Implementation Backed by Core
Reflection
12.03.2014 Java SE 8
Java 8 JEPs Core Libraries
● 135 Base64 Encoding & Decoding
(previously in sun.misc.*, now java.util.*)
● 149 Reduce Core-Library Memory Usage
(reduce dynamic memory)
● 150 Date & Time API
(Wurde auch Zeit!)
● 155 Concurrency Updates
(Doug Lea Stuff)
● 170 JDBC 4.2 (new Date API support)
12.03.2014 Java SE 8
How many Bugs?
Date date = new Date(2014, 12, 24, 16, 40);
TimeZone zone =
   TimeZone.getTimeZone(“Asia/HongKong”);
Calendar cal = 
   new GregorianCalendar(date, zone);
DateFormat fm = 
   new SimpleDateFormat(“HH:mm Z”);
String str = fm.format(cal);
12.03.2014 Java SE 8
How many Bugs? 6!
Date date = new Date(114, 11, 24, 16, 40);
TimeZone zone =
   TimeZone.getTimeZone(“Asia/Hong_Kong”);
Calendar cal = new GregorianCalendar(zone);
cal.setTime(date);
DateFormat fm = 
   new SimpleDateFormat(“HH:mm Z”);
fm.setTimeZone(zone);
Date calDate = cal.getTime();
String str = fm.format(calDate);
12.03.2014 Java SE 8
Java 8 JEPs Diverses
● 177 Optimize java.text.DecimalFormat.format
(2 x faster for 2 or 3 digits after decimal point)
● 178 Statically-Linked JNI Libraries
(previously only dynamically linked)
●
180 Handle Frequent HashMap Collisions with
Balanced Trees
(performance improvement, previously with linked lists)
●
12.03.2014 Java SE 8
Java 8 JEPs Diverses
●
127 Improve Locale Data Packaging and Adopt
Unicode CLDR Data
(standardized locale support)
● 128 BCP 47 Locale Matching
(as defined in rfc-4647)
●
133 Unicode 6.2
● 184 HTTP URL Permissions (previously based on IP addresses)
12.03.2014 Java SE 8
Java 8 Security
● 113 MS-SFU Kerberos 5 Extensions
(Microsoft interoperability)
●
114 TLS Server Name Indication (SNI) Extension (new feature)
●
115 AEAD CipherSuites (meet US government and banking requirements)
● 121 Stronger Algorithms for Password-Based Encryption
(evolution of cryptography, PBEwith*, previously DESede and RC2 with SHA1)
● 123 Configurable Secure Random-Number Generation
(/dev/random Entropie unter Linux ist alle)→
●
124 Enhance the Certificate Revocation-Checking API
(more complete,flexible)
12.03.2014 Java SE 8
Java 8 Security
●
129 NSA Suite B Cryptographic Algorithms
(meet US government and banking requirements)
● 130 SHA-224 Message Digests (known flaw in SHA-1)
● 131 PKCS#11 Crypto Provider for 64-bit Windows
(use of native Win64 libraries)
●
140 Limited doPrivileged (Lambda expressions)
● 166 Overhaul JKS-JCEKS-PKCS12 Keystores
(simplification of keystore handling)
12.03.2014 Java SE 8
Java 8 JEPs / Web JAXP
● 185 JAXP 1.5: Restrict Fetching of External
Resources
(restrict the set of network protocols used to fetch external resources)
12.03.2014 Java SE 8
Lambda Expressions
● Aka closures, function literals or Lambdas
● From anonymous inner classes to FunctionalInterfaces;
previously known as SAM (single abstract method)
●
Syntax:
1. argument list enclosed in parentheses
2. an arrow token ( )→
3. a function body
12.03.2014 Java SE 8
Default methods
● Interfaces can have default implementations
● Method starts with default
12.03.2014 Java SE 8
Lambda form representation
method handles
● object::instanceMethod
Arrays.asList(0, -2, 2).forEach(System.out::println);
Arrays.asList(0, -2, 2).forEach((x) System.out.println(x));→ →
● Class::staticMethod
Arrays.asList(0, -2, 2).sort(Integer::compare);
Arrays.asList(0, -2, 2).sort((x, y) Integer.compare(x, y));→ →
● Class::instanceMethod
Arrays.asList(0, -2, 2).sort(Integer::compareTo);
Arrays.asList(0, -2, 2).sort((x, y) x.compareTo(y));→ →
12.03.2014 Java SE 8
Collection vs Stream
Quelle: wikimedia.org
12.03.2014 Java SE 8
Stream-API
●
Get a stream from a collection
collection<E>.stream();
●
Generate, limit and skip a stream
Stream.generate(Supplier<T> s) // static
stream<T>.limit(long)
stream<T>.skip(long)
●
Manipulate a stream
stream<T>.map(Function<T, R>) Stream<R>→
stream<T>.filter(Predicate<T>) Stream<T>→
stream<T>.sorted() Stream<T>→
stream<T>.distinct() Stream<T>→
12.03.2014 Java SE 8
Stream-API
● “Collection a result” of a stream
stream<T>.allMatch(Predicate<T>) boolean→
stream<T>.anyMatch(Predicate<T>) boolean→
stream<T>.findAny() Optional<T>→
stream<T>.findFirst() Optional<T>→
stream<T>.max(Comparator<T>) Optional<T>→
stream<T>.min(Comparator<T>) Optional<T>→
stream<T>.reduce(T, BinaryOperator<T>) T→
stream<T>.collect(T, A, R) R→
12.03.2014 Java SE 8
Stream-API
● Default Collectors
Collectors.toList() Collector<T, ?, List<T>>→
Collectors.reducing(T, BinaryOperator<T>) T→
Collectors.joining() Collector<CharSeq, ?, String>→
Collectors.counting() Collector<T, ?, Long>→
12.03.2014 Java SE 8
Danke!
12.03.2014 Java SE 8
Referenzen
● http://www.youtube.com/watch?v=rtAredKhyac, Simon Ritter
● Java SE 8 for the Really Impatient, Cay S. Horstmann
● Java 8 in Action, Raoul-Gabiel Urma et.al
● http://openjdk.java.net/projects/jdk8/features

Mais conteúdo relacionado

Mais procurados

MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
Sveta Smirnova
 
External Language Stored Procedures for MySQL
External Language Stored Procedures for MySQLExternal Language Stored Procedures for MySQL
External Language Stored Procedures for MySQL
Antony T Curtis
 

Mais procurados (20)

jcmd #javacasual
jcmd #javacasualjcmd #javacasual
jcmd #javacasual
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL Troubleshooting
 
What’s New in Oracle Database 12c for PHP
What’s New in Oracle Database 12c for PHPWhat’s New in Oracle Database 12c for PHP
What’s New in Oracle Database 12c for PHP
 
Using Perl Stored Procedures for MariaDB
Using Perl Stored Procedures for MariaDBUsing Perl Stored Procedures for MariaDB
Using Perl Stored Procedures for MariaDB
 
Virtualizing Java in Java (jug.ru)
Virtualizing Java in Java (jug.ru)Virtualizing Java in Java (jug.ru)
Virtualizing Java in Java (jug.ru)
 
Profiling & Testing with Spark
Profiling & Testing with SparkProfiling & Testing with Spark
Profiling & Testing with Spark
 
Mark Farnam : Minimizing the Concurrency Footprint of Transactions
Mark Farnam  : Minimizing the Concurrency Footprint of TransactionsMark Farnam  : Minimizing the Concurrency Footprint of Transactions
Mark Farnam : Minimizing the Concurrency Footprint of Transactions
 
JahiaOne - Performance Tuning
JahiaOne - Performance TuningJahiaOne - Performance Tuning
JahiaOne - Performance Tuning
 
Managing MariaDB Server operations with Percona Toolkit
Managing MariaDB Server operations with Percona ToolkitManaging MariaDB Server operations with Percona Toolkit
Managing MariaDB Server operations with Percona Toolkit
 
MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
 
MySQL JSON Functions
MySQL JSON FunctionsMySQL JSON Functions
MySQL JSON Functions
 
Find bottleneck and tuning in Java Application
Find bottleneck and tuning in Java ApplicationFind bottleneck and tuning in Java Application
Find bottleneck and tuning in Java Application
 
I know why your Java is slow
I know why your Java is slowI know why your Java is slow
I know why your Java is slow
 
Performance Schema in Action: demo
Performance Schema in Action: demoPerformance Schema in Action: demo
Performance Schema in Action: demo
 
External Language Stored Procedures for MySQL
External Language Stored Procedures for MySQLExternal Language Stored Procedures for MySQL
External Language Stored Procedures for MySQL
 
자바 성능 강의
자바 성능 강의자바 성능 강의
자바 성능 강의
 
Logical replication with pglogical
Logical replication with pglogicalLogical replication with pglogical
Logical replication with pglogical
 
Oracle Database SQL Tuning Concept
Oracle Database SQL Tuning ConceptOracle Database SQL Tuning Concept
Oracle Database SQL Tuning Concept
 
Cloug Troubleshooting Oracle 11g Rac 101 Tips And Tricks
Cloug Troubleshooting Oracle 11g Rac 101 Tips And TricksCloug Troubleshooting Oracle 11g Rac 101 Tips And Tricks
Cloug Troubleshooting Oracle 11g Rac 101 Tips And Tricks
 
Intro to ASH
Intro to ASHIntro to ASH
Intro to ASH
 

Semelhante a java8-features

Java 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for youJava 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for you
Dmitry Buzdin
 
Hw09 Sqoop Database Import For Hadoop
Hw09   Sqoop Database Import For HadoopHw09   Sqoop Database Import For Hadoop
Hw09 Sqoop Database Import For Hadoop
Cloudera, Inc.
 

Semelhante a java8-features (20)

Panama.pdf
Panama.pdfPanama.pdf
Panama.pdf
 
Java user group 2015 02-09-java8
Java user group 2015 02-09-java8Java user group 2015 02-09-java8
Java user group 2015 02-09-java8
 
Java user group 2015 02-09-java8
Java user group 2015 02-09-java8Java user group 2015 02-09-java8
Java user group 2015 02-09-java8
 
Java 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for youJava 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for you
 
Java 9-10 What's New
Java 9-10 What's NewJava 9-10 What's New
Java 9-10 What's New
 
JavaOne 2011 Recap
JavaOne 2011 RecapJavaOne 2011 Recap
JavaOne 2011 Recap
 
De Java 8 a Java 11 y 14
De Java 8 a Java 11 y 14De Java 8 a Java 11 y 14
De Java 8 a Java 11 y 14
 
Java one 2010
Java one 2010Java one 2010
Java one 2010
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
 
PostgreSQL and PL/Java
PostgreSQL and PL/JavaPostgreSQL and PL/Java
PostgreSQL and PL/Java
 
Java 9 new features
Java 9 new featuresJava 9 new features
Java 9 new features
 
Hw09 Sqoop Database Import For Hadoop
Hw09   Sqoop Database Import For HadoopHw09   Sqoop Database Import For Hadoop
Hw09 Sqoop Database Import For Hadoop
 
Java Programming - 01 intro to java
Java Programming - 01 intro to javaJava Programming - 01 intro to java
Java Programming - 01 intro to java
 
Accelerating Spark SQL Workloads to 50X Performance with Apache Arrow-Based F...
Accelerating Spark SQL Workloads to 50X Performance with Apache Arrow-Based F...Accelerating Spark SQL Workloads to 50X Performance with Apache Arrow-Based F...
Accelerating Spark SQL Workloads to 50X Performance with Apache Arrow-Based F...
 
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9
 
Java EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersJava EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c Developers
 
Java 8
Java 8Java 8
Java 8
 
What's new in Java 8
What's new in Java 8What's new in Java 8
What's new in Java 8
 
De Java 8 ate Java 14
De Java 8 ate Java 14De Java 8 ate Java 14
De Java 8 ate Java 14
 
Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

java8-features

  • 1. Java SE 8 Features Neuerungen in Java SE 8 pr sentiert von Sascha Kochä 12. M rz 2014ä JUG Bielefeld
  • 2. 12.03.2014 Java SE 8 Alle freuen sich auf Java 8 Quelle www.heise.de
  • 3. 12.03.2014 Java SE 8 Programm f r heute abendü ● > 50 Neuerungen in Java SE 8 ● Hands-on Session mit λ-Expressions, der Stream API, den default methods und mehr
  • 4. 12.03.2014 Java SE 8 Java 8 JEPs General ● 126 Lambda Expressions & Virtual Extension Methods (aka defender or default methods) ● 138 Autoconf-Based Build System (for the jdk itself) ● 160 Lambda-Form Representation for Method Handles (reduce assembly code and native calls, performance optimization, reference implementation of invokedynamic / JSR-292) ● 161 Compact Profiles (instead of jigsaw 140/24/17/10 MB)→ ● 162 Prepare for Modularization (getting ready for jigsaw, java.util.logging and swing)
  • 5. 12.03.2014 Java SE 8 Java 8 JEPs General ● 164 Leverage CPU Instructions for AES Cryptography (Intel M rz 2008)ä ● 174 Nashorn JavaScript Engine (lightweight, high-performance, ECMAScript-262 5.1) ● 176 Mechanical Checking of Caller-Sensitive Methods (improve security of method-handle implementation, behaviour changed based on the caller) ● 179 Document JDK API Support and Stability (mark core and non-core APIs, what is maintained?)
  • 6. 12.03.2014 Java SE 8 Java 8 JEPs Core ● 153 Launch JavaFX Applications (launch() from java cmd line) ● 101 Generalized Target-Type Inference Code (only partly realized) ● 104 Annotations on Java Types Code (applied to any use of a type, not at runtime :( ) ● 105 DocTree API (provide structured access to javadoc content) ● 106 Add Javadoc to javax.tools (call javadoc from within vm)
  • 7. 12.03.2014 Java SE 8 Java 8 JEPs Core ● 117 Remove the Annotation-Processing Tool (in javac) ● 118 Access to Parameter Names at Runtime Code (partly realized) ● 120 Repeating Annotations Code (avoid container annotations, somehow) ● 139 Enhance javac to Improve Build Speed (use of all available cores) ● 172 DocLint Code (static doc analysis, Fusselig, W3C HTML 4.01 HTML conform)
  • 8. 12.03.2014 Java SE 8 Java 8 JEPs Garbage Collection ● 142 Reduce Cache Contention on Specified Fields (pad variables to avoid sharing cache lines) ● 122 Remove the Permanent Generation (Permanently, PermGen moves to native memory) ● 173 Retire Some Rarely-Used GC Combination (e.g. ParNew + SerialOld, reduce testing effort)
  • 9. 12.03.2014 Java SE 8 Java 8 JEPs Garbage Collection ● 142 Reduce Cache Contention on Specified Fields (pad variables to avoid sharing cache lines) ● 122 Remove the Permanent Generation (Permanently, PermGen moves to native memory) ● 173 Retire Some Rarely-Used GC Combination (e.g. ParNew + SerialOld, reduce testing effort)
  • 10. 12.03.2014 Java SE 8 Java 8 JEPs Runtime ● 136 Enhanced Verification Errors (additional information bytecode verification errors) ● 147 Reduce Class Metadata Footprint (taken from ME) ● 148 Small VM (libjvm.so < 3MB, compiling size over speed) ● 171 Fence Intrinsics (sun.misc.Unsafe, memory access)
  • 11. 12.03.2014 Java SE 8 Java 8 JEPs Core Libraries ● 103 Parallel Array Sorting (new methods in java.util.Arrays) ● 107 Bulk Data Operations for Collections (java.util.function, java.util.stream) ● 109 Enhance Core Libraries with Lambda (Java SE 7 has 4024 standard classes) ● 112 Charset Implementation Improvements (fewer, quicker, better) ● 119 javax.lang.model Implementation Backed by Core Reflection
  • 12. 12.03.2014 Java SE 8 Java 8 JEPs Core Libraries ● 135 Base64 Encoding & Decoding (previously in sun.misc.*, now java.util.*) ● 149 Reduce Core-Library Memory Usage (reduce dynamic memory) ● 150 Date & Time API (Wurde auch Zeit!) ● 155 Concurrency Updates (Doug Lea Stuff) ● 170 JDBC 4.2 (new Date API support)
  • 13. 12.03.2014 Java SE 8 How many Bugs? Date date = new Date(2014, 12, 24, 16, 40); TimeZone zone =    TimeZone.getTimeZone(“Asia/HongKong”); Calendar cal =     new GregorianCalendar(date, zone); DateFormat fm =     new SimpleDateFormat(“HH:mm Z”); String str = fm.format(cal);
  • 14. 12.03.2014 Java SE 8 How many Bugs? 6! Date date = new Date(114, 11, 24, 16, 40); TimeZone zone =    TimeZone.getTimeZone(“Asia/Hong_Kong”); Calendar cal = new GregorianCalendar(zone); cal.setTime(date); DateFormat fm =     new SimpleDateFormat(“HH:mm Z”); fm.setTimeZone(zone); Date calDate = cal.getTime(); String str = fm.format(calDate);
  • 15. 12.03.2014 Java SE 8 Java 8 JEPs Diverses ● 177 Optimize java.text.DecimalFormat.format (2 x faster for 2 or 3 digits after decimal point) ● 178 Statically-Linked JNI Libraries (previously only dynamically linked) ● 180 Handle Frequent HashMap Collisions with Balanced Trees (performance improvement, previously with linked lists) ●
  • 16. 12.03.2014 Java SE 8 Java 8 JEPs Diverses ● 127 Improve Locale Data Packaging and Adopt Unicode CLDR Data (standardized locale support) ● 128 BCP 47 Locale Matching (as defined in rfc-4647) ● 133 Unicode 6.2 ● 184 HTTP URL Permissions (previously based on IP addresses)
  • 17. 12.03.2014 Java SE 8 Java 8 Security ● 113 MS-SFU Kerberos 5 Extensions (Microsoft interoperability) ● 114 TLS Server Name Indication (SNI) Extension (new feature) ● 115 AEAD CipherSuites (meet US government and banking requirements) ● 121 Stronger Algorithms for Password-Based Encryption (evolution of cryptography, PBEwith*, previously DESede and RC2 with SHA1) ● 123 Configurable Secure Random-Number Generation (/dev/random Entropie unter Linux ist alle)→ ● 124 Enhance the Certificate Revocation-Checking API (more complete,flexible)
  • 18. 12.03.2014 Java SE 8 Java 8 Security ● 129 NSA Suite B Cryptographic Algorithms (meet US government and banking requirements) ● 130 SHA-224 Message Digests (known flaw in SHA-1) ● 131 PKCS#11 Crypto Provider for 64-bit Windows (use of native Win64 libraries) ● 140 Limited doPrivileged (Lambda expressions) ● 166 Overhaul JKS-JCEKS-PKCS12 Keystores (simplification of keystore handling)
  • 19. 12.03.2014 Java SE 8 Java 8 JEPs / Web JAXP ● 185 JAXP 1.5: Restrict Fetching of External Resources (restrict the set of network protocols used to fetch external resources)
  • 20. 12.03.2014 Java SE 8 Lambda Expressions ● Aka closures, function literals or Lambdas ● From anonymous inner classes to FunctionalInterfaces; previously known as SAM (single abstract method) ● Syntax: 1. argument list enclosed in parentheses 2. an arrow token ( )→ 3. a function body
  • 21. 12.03.2014 Java SE 8 Default methods ● Interfaces can have default implementations ● Method starts with default
  • 22. 12.03.2014 Java SE 8 Lambda form representation method handles ● object::instanceMethod Arrays.asList(0, -2, 2).forEach(System.out::println); Arrays.asList(0, -2, 2).forEach((x) System.out.println(x));→ → ● Class::staticMethod Arrays.asList(0, -2, 2).sort(Integer::compare); Arrays.asList(0, -2, 2).sort((x, y) Integer.compare(x, y));→ → ● Class::instanceMethod Arrays.asList(0, -2, 2).sort(Integer::compareTo); Arrays.asList(0, -2, 2).sort((x, y) x.compareTo(y));→ →
  • 23. 12.03.2014 Java SE 8 Collection vs Stream Quelle: wikimedia.org
  • 24. 12.03.2014 Java SE 8 Stream-API ● Get a stream from a collection collection<E>.stream(); ● Generate, limit and skip a stream Stream.generate(Supplier<T> s) // static stream<T>.limit(long) stream<T>.skip(long) ● Manipulate a stream stream<T>.map(Function<T, R>) Stream<R>→ stream<T>.filter(Predicate<T>) Stream<T>→ stream<T>.sorted() Stream<T>→ stream<T>.distinct() Stream<T>→
  • 25. 12.03.2014 Java SE 8 Stream-API ● “Collection a result” of a stream stream<T>.allMatch(Predicate<T>) boolean→ stream<T>.anyMatch(Predicate<T>) boolean→ stream<T>.findAny() Optional<T>→ stream<T>.findFirst() Optional<T>→ stream<T>.max(Comparator<T>) Optional<T>→ stream<T>.min(Comparator<T>) Optional<T>→ stream<T>.reduce(T, BinaryOperator<T>) T→ stream<T>.collect(T, A, R) R→
  • 26. 12.03.2014 Java SE 8 Stream-API ● Default Collectors Collectors.toList() Collector<T, ?, List<T>>→ Collectors.reducing(T, BinaryOperator<T>) T→ Collectors.joining() Collector<CharSeq, ?, String>→ Collectors.counting() Collector<T, ?, Long>→
  • 27. 12.03.2014 Java SE 8 Danke!
  • 28. 12.03.2014 Java SE 8 Referenzen ● http://www.youtube.com/watch?v=rtAredKhyac, Simon Ritter ● Java SE 8 for the Really Impatient, Cay S. Horstmann ● Java 8 in Action, Raoul-Gabiel Urma et.al ● http://openjdk.java.net/projects/jdk8/features