SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

jcmd #javacasual
jcmd #javacasualjcmd #javacasual
jcmd #javacasualYuji Kubota
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingSveta Smirnova
 
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 PHPChristopher Jones
 
Using Perl Stored Procedures for MariaDB
Using Perl Stored Procedures for MariaDBUsing Perl Stored Procedures for MariaDB
Using Perl Stored Procedures for MariaDBAntony T Curtis
 
Virtualizing Java in Java (jug.ru)
Virtualizing Java in Java (jug.ru)Virtualizing Java in Java (jug.ru)
Virtualizing Java in Java (jug.ru)aragozin
 
Profiling & Testing with Spark
Profiling & Testing with SparkProfiling & Testing with Spark
Profiling & Testing with SparkRoger Rafanell Mas
 
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 TransactionsKyle Hailey
 
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 ToolkitSveta Smirnova
 
MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 MinutesSveta Smirnova
 
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 Applicationguest1f2740
 
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 slowaragozin
 
Performance Schema in Action: demo
Performance Schema in Action: demoPerformance Schema in Action: demo
Performance Schema in Action: demoSveta Smirnova
 
External Language Stored Procedures for MySQL
External Language Stored Procedures for MySQLExternal Language Stored Procedures for MySQL
External Language Stored Procedures for MySQLAntony T Curtis
 
자바 성능 강의
자바 성능 강의자바 성능 강의
자바 성능 강의Terry Cho
 
Logical replication with pglogical
Logical replication with pglogicalLogical replication with pglogical
Logical replication with pglogicalUmair Shahid
 
Oracle Database SQL Tuning Concept
Oracle Database SQL Tuning ConceptOracle Database SQL Tuning Concept
Oracle Database SQL Tuning ConceptChien Chung Shen
 
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 TricksScott Jenner
 

Was ist angesagt? (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
 

Ähnlich wie java8-features

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-java8Marc Tritschler
 
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-java8marctritschler
 
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 youDmitry Buzdin
 
Java 9-10 What's New
Java 9-10 What's NewJava 9-10 What's New
Java 9-10 What's NewNicola Pedot
 
Java one 2010
Java one 2010Java one 2010
Java one 2010scdn
 
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 OredevMattias Karlsson
 
Hw09 Sqoop Database Import For Hadoop
Hw09   Sqoop Database Import For HadoopHw09   Sqoop Database Import For Hadoop
Hw09 Sqoop Database Import For HadoopCloudera, Inc.
 
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...Databricks
 
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9Ivan Krylov
 
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 DevelopersBruno Borges
 
What's new in Java 8
What's new in Java 8What's new in Java 8
What's new in Java 8jclingan
 
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, 11Ivelin Yanev
 

Ähnlich wie 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
 

Kürzlich hochgeladen

(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 

Kürzlich hochgeladen (20)

(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 

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