0
The Java SE Platform: Rebuilding Momentum                 Terrence Barr                 Senior Technologist, Oracle       ...
http://javaspotlight.org                                                                                                  ...
Mark Reinhold                                                                                                  Cameron Pur...
Safe Harbor Statement                       3 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursda...
Safe Harbor Statement                                                                The preceding and following material ...
Priorities for our Java PlatformsThursday, December 15, 2011
Priorities for our Java Platforms                                                                  Grow developer baseThur...
Priorities for our Java Platforms                                                                  Grow developer baseThur...
Priorities for our Java Platforms                                                                  Grow developer base    ...
Priorities for our Java Platforms                                                                  Grow developer base    ...
Priorities for our Java Platforms                                                                  Grow developer base    ...
Priorities for our Java Platforms                                                                  Grow developer base    ...
Priorities for our Java Platforms                                                                  Grow developer base    ...
Priorities for our Java Platforms                                                                  Grow developer base    ...
5 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
7                       5 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
7                       6 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
7                                                                                                 Project Coin (JSR 334)  ...
7                                                                                                 Project Coin (JSR 334)  ...
7                                                                                                 Project Coin (JSR 334)  ...
7                                                                                    Project Coin (JSR 334)               ...
7                                                                                    Project Coin (JSR 334)               ...
7                                                                                    Project Coin (JSR 334)               ...
7                                                                                                          8              ...
JDK 7 Schedule                       7 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, Dece...
JDK 7 Schedule                                             2010/12/16	                                        Feature Comp...
8 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
Four JSRs                       8 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December ...
Four JSRs                                                                                                 1,966 Enhancemen...
Four JSRs                                                                                                 1,966 Enhancemen...
Four JSRs                                                                                                 1,966 Enhancemen...
Four JSRs                                                                                                 1,966 Enhancemen...
Four JSRs                                                                                                 1,966 Enhancemen...
Four JSRs                 Java 7                                                                                          ...
7                                      InvokeDynamic (JSR 292)                       9 | Copyright © 2011, Oracle and/or i...
7                                                                                                 Project Coin (JSR 334)  ...
10 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
http://www.flickr.com/photos/chefranden/908539119/                      10 | Copyright © 2011, Oracle and/or its affiliates...
11 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
Map<String,String> map                                           = new HashMap<String,String>();                      11 |...
Map<String,Map<Integer,String>> map                                           = new HashMap<String,Map<Integer,String>> ()...
Map<String,Map<Integer,List<String>>> map                                           = new HashMap<String,Map<Integer,List<...
// Diamond                                         Map<String,Map<Integer,List<String>>> map                              ...
// Diamond                                         Map<String,Map<Integer,List<String>>> map                              ...
// Diamond                                         Map<String,Map<Integer,List<String>>> map;                             ...
// Diamond                                         Map<String,Map<Integer,List<String>>> foo() {                          ...
12 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
if (s.equals("foo"))                                                                     doFoo();                         ...
// Strings in switch                                                                   switch (s) {                       ...
13 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
try {                                                     // ...                                                   }      ...
try {                                                     // ...                                                   } catch...
try {                                                     // ...                                                   } catch...
// Multi-catch                                                   try {                                                    ...
// Multi-catch                                                   try {                                                    ...
14 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
static void copy(Path src, Path dst) throws IOException {                                            InputStream in = File...
static void copy(Path src, Path dst) throws IOException {                                            InputStream in = File...
static void copy(Path src, Path dst) throws IOException {                                            InputStream in = File...
static void copy(Path src, Path dst) throws IOException {                                            InputStream in = File...
static void copy(Path src, Path dst) throws IOException {                                            InputStream in =     ...
static void copy(Path src, Path dst) throws IOException {                                            InputStream in = null...
static void copy(Path src, Path dst) throws IOException {                                     InputStream in = Files.newIn...
static void copy(Path src, Path dst) throws IOException {                                 InputStream in = Files.newInputS...
static void copy(Path src, Path dst) throws IOException {{                                                    InputStream ...
// Try-with-resources                                          static void copy(Path src, Path dst) throws IOException {  ...
// Try-with-resources                                          static void copy(Path src, Path dst) throws IOException {  ...
// Try-with-resources                                          static void copy(Path src, Path dst) throws IOException {  ...
// Try-with-resources                      19 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursda...
// Try-with-resources                                          package java.lang;                                         ...
19 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
package foo;                                          class FooResource                                            impleme...
20 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
-th row                          ise                                re                                           b) Excep ...
// L                                                                                                         iter         ...
// L                                                                                                         iter         ...
21 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
22 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
7                                                                                                 Project Coin (JSR 334)  ...
7                                                                                                 Project Coin (JSR 334)  ...
24 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
Luck              FScript                                                                                                 ...
25 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
Ruby = Method Calls                                       Lots and lots and lots of ʼem …                      25 | Copyri...
26 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
def foo                                bar                              end                              def bar          ...
JRuby on Java 5/6                              def foo                                bar                              end...
JRuby on Java 7 with InvokeDynamic                              def foo                                bar                ...
JRuby on Java 7 with InvokeDynamic                              def foo                                bar                ...
Times faster than Ruby 1.9.3                                  15                                                          ...
7                                                                                                 Project Coin (JSR 334)  ...
7                                                                                                 Project Coin (JSR 334)  ...
29 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
29 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
30 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
1.	 Keep all the processor cores busy                      30 | Copyright © 2011, Oracle and/or its affiliates. All rights ...
1.	 Keep all the processor cores busy                                                  2.	 Minimize synchronization overhe...
1.	 Keep all the processor cores busy                                                  2.	 Minimize synchronization overhe...
31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
32 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
Result compute(Task t) {                                                             }                      32 | Copyright...
Result compute(Task t) {                                                                 if (t.size() < SEQUENTIAL_THRESHO...
Result compute(Task t) {                                                                 if (t.size() < SEQUENTIAL_THRESHO...
Result compute(Task t) {                                                                 if (t.size() < SEQUENTIAL_THRESHO...
Result compute(Task t) {                                                                 if (t.size() < SEQUENTIAL_THRESHO...
Result compute(Task t) {                                                                 if (t.size() < SEQUENTIAL_THRESHO...
Result compute(Task t) {                                                                 if (t.size() < SEQUENTIAL_THRESHO...
34 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
public class Task                                  extends java.util.concurrent.RecursiveAction                           ...
7                                                                                                 Project Coin (JSR 334)  ...
7                                                                                                 Project Coin (JSR 334)  ...
New Filesystem API                                                    File notifications                                  ...
import java.nio.file.*;                      37 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thurs...
import java.nio.file.*;                 Path searchDir = Paths.get("c:/Users");                 final Path findFile = Path...
import java.nio.file.*;                 Path searchDir = Paths.get("c:/Users");                 final Path findFile = Path...
import java.nio.file.*;                 Path searchDir = Paths.get("c:/Users");                 final Path findFile = Path...
import java.nio.file.*;                 Path searchDir = Paths.get("c:/Users");                 final Path findFile = Path...
import java.nio.file.*;                 Path searchDir = Paths.get("c:/Users");                 final Path findFile = Path...
7                                                                                                 Project Coin (JSR 334)  ...
7                                                                                                 Project Coin (JSR 334)  ...
JVM Convergence                                                Copyright © 2010 Oracle and/or its affiliates. All rights r...
JVM Convergence                                                Copyright © 2010 Oracle and/or its affiliates. All rights r...
8                      40 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
8                                      Project Lambda (JSR 335)                      40 | Copyright © 2011, Oracle and/or ...
8                                      Project Lambda (JSR 335)                                                           ...
41 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
41 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
C#                      41 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
41 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
42 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
class Student {                                 String name;                                 int gradYear;                ...
class Student {                                 String name;                                 int gradYear;                ...
class Student {                                 String name;                                 int gradYear;                ...
List<Student> students = ...;                              public class Task                                  extends java...
class Student {                                 String name;                                 int gradYear;                ...
class Student {                                 String name;                                 int gradYear;                ...
class Student {                                 String name;                                 int gradYear;                ...
class Student {                                 String name;                                 int gradYear;                ...
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
J1 la-2011-se-tech-keynote
Upcoming SlideShare
Loading in...5
×

J1 la-2011-se-tech-keynote

654

Published on

Java SE: Rebuilding the Momentum (Java 7 and Java SE 8: Features and Plans)

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
654
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "J1 la-2011-se-tech-keynote"

  1. 1. The Java SE Platform: Rebuilding Momentum Terrence Barr Senior Technologist, Oracle @terrencebarr | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved. | Insert Information Protection Policy Classification from Slide 8Thursday, December 15, 2011
  2. 2. http://javaspotlight.org @javaspotlight 2 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  3. 3. Mark Reinhold Cameron Purdy Adam Bein Adam Messinger JimBateman Joe Laskey Bruno Souza Alex Buckley Stuart Darcy Mike Marks Alan Duigou http://javaspotlight.org @javaspotlight 2 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  4. 4. Safe Harbor Statement 3 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  5. 5. Safe Harbor Statement The preceding and following material is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 3 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  6. 6. Priorities for our Java PlatformsThursday, December 15, 2011
  7. 7. Priorities for our Java Platforms Grow developer baseThursday, December 15, 2011
  8. 8. Priorities for our Java Platforms Grow developer baseThursday, December 15, 2011
  9. 9. Priorities for our Java Platforms Grow developer base Grow adoptionThursday, December 15, 2011
  10. 10. Priorities for our Java Platforms Grow developer base Grow adoptionThursday, December 15, 2011
  11. 11. Priorities for our Java Platforms Grow developer base Grow adoption Increase competitivenessThursday, December 15, 2011
  12. 12. Priorities for our Java Platforms Grow developer base Grow adoption Increase competitivenessThursday, December 15, 2011
  13. 13. Priorities for our Java Platforms Grow developer base Grow adoption Increase competitiveness Adapt to changeThursday, December 15, 2011
  14. 14. Priorities for our Java Platforms Grow developer base Grow adoption Increase competitiveness Adapt to changeThursday, December 15, 2011
  15. 15. 5 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  16. 16. 7 5 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  17. 17. 7 6 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  18. 18. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework Project Jigsaw Project Lambda (JSR 335) 6 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  19. 19. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework Project Jigsaw Strict Verification Project Lambda (JSR 335) Type Annotations (JSR 308) Parallel Class Loaders Unicode 6.0 JDBC 4.1 Bulk-Data Operations Enhanced Locales XRender Pipeline Phasers SDP & SCTP Swing JLayer Transfer Queues TLS 1.2 Swing Nimbus More New I/O (JSR 203) ECC 6 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  20. 20. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework Mid 2012 Project Jigsaw Strict Verification Project Lambda (JSR 335) Type Annotations (JSR 308) Parallel Class Loaders Unicode 6.0 JDBC 4.1 Bulk-Data Operations Enhanced Locales XRender Pipeline Phasers SDP & SCTP Swing JLayer Transfer Queues TLS 1.2 Swing Nimbus More New I/O (JSR 203) ECC 6 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  21. 21. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework Mid 2012 Project Jigsaw Strict Verification Project Lambda Type Annotations (JSR 308) Parallel Class Loaders Unicode 6.0 JDBC 4.1 Bulk-Data Operations Enhanced Locales XRender Pipeline Phasers SDP & SCTP Swing JLayer Transfer Queues TLS 1.2 Swing Nimbus More New I/O (JSR 203) ECC 6 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  22. 22. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework Mid 2012 Project Jigsaw Strict Verification SDP & SCTP Project Lambda Parallel Class Loaders TLS 1.2 Phasers ECC Transfer Queues JDBC 4.1 Type Annotations (JSR 308) More New I/O (JSR 203) XRender Pipeline Bulk-Data Operations Unicode 6.0 Swing JLayer Enhanced Locales Swing Nimbus 6 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  23. 23. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework Mid 2011 Project Jigsaw Strict Verification SDP & SCTP Project Lambda Parallel Class Loaders TLS 1.2 Phasers ECC Transfer Queues JDBC 4.1 Type Annotations (JSR 308) More New I/O (JSR 203) XRender Pipeline Bulk-Data Operations Unicode 6.0 Swing JLayer Enhanced Locales Swing Nimbus 6 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  24. 24. 7 8 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework Mid 2011 Strict Verification SDP & SCTP Project Jigsaw Parallel Class Loaders TLS 1.2 Phasers ECC Project Lambda Transfer Queues JDBC 4.1 Type Annotations (JSR 308) More New I/O (JSR 203) XRender Pipeline Bulk-Data Operations Unicode 6.0 Swing JLayer Enhanced Locales Swing Nimbus 6 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  25. 25. JDK 7 Schedule 7 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  26. 26. JDK 7 Schedule 2010/12/16 Feature Complete 2011/04/12 Rampdown start: P1-P3 bugs only 2011/04/28 API/interface changes: Showstoppers only 2011/05/11 All targeted bugs addressed First release candidate built 2011/05/18 Bug fixes: Showstoppers only 2011/06/08 Final test cycle starts 2011/07/28 General Availability 7 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  27. 27. 8 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  28. 28. Four JSRs 8 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  29. 29. Four JSRs 1,966 Enhancements 8 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  30. 30. Four JSRs 1,966 Enhancements 9,494 Bug Fixes 8 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  31. 31. Four JSRs 1,966 Enhancements 9,494 Bug Fixes 9,018 Mercurial Changesets 8 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  32. 32. Four JSRs 1,966 Enhancements 9,494 Bug Fixes 9,018 Mercurial Changesets 147 Builds 8 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  33. 33. Four JSRs 1,966 Enhancements 9,494 Bug Fixes 9,018 Mercurial Changesets 147 Builds Four years, seven months, and seventeen days … 8 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  34. 34. Four JSRs Java 7 1,966 Enhancements 9,494 Bug Fixes 9,018 Mercurial Changesets 147 Builds 2011/7/28 Four years, seven months, and seventeen days … 8 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  35. 35. 7 InvokeDynamic (JSR 292) 9 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  36. 36. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework (JSR 166y) NIO.2 (JSR 203) 9 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  37. 37. 10 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  38. 38. http://www.flickr.com/photos/chefranden/908539119/ 10 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  39. 39. 11 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  40. 40. Map<String,String> map = new HashMap<String,String>(); 11 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  41. 41. Map<String,Map<Integer,String>> map = new HashMap<String,Map<Integer,String>> (); 11 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  42. 42. Map<String,Map<Integer,List<String>>> map = new HashMap<String,Map<Integer,List<String>>>(); 11 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  43. 43. // Diamond Map<String,Map<Integer,List<String>>> map = new HashMap<String,Map<Integer,List<String>>>(); 11 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011 <>
  44. 44. // Diamond Map<String,Map<Integer,List<String>>> map = new HashMap<>(); 11 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  45. 45. // Diamond Map<String,Map<Integer,List<String>>> map; // ... map = new HashMap<>(); 11 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  46. 46. // Diamond Map<String,Map<Integer,List<String>>> foo() { return new HashMap<>(); } 11 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  47. 47. 12 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  48. 48. if (s.equals("foo")) doFoo(); else if (s.equals( "bar")) doBar(); else if (s.equals( "baz")) doBaz(); else throw new IllegalArgumentException(s); 12 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  49. 49. // Strings in switch switch (s) { case "foo": doFoo(); break; case "bar": doBar(); break; case "baz": doBaz(); break; default: throw new IllegalArgumentException(s); } 12 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  50. 50. 13 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  51. 51. try { // ... } 13 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  52. 52. try { // ... } catch (IOException x) { logger.log(SEVERE, "Unexpected failure", x); throw x; } 13 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  53. 53. try { // ... } catch (IOException x) { logger.log(SEVERE, "Unexpected failure", x); throw x; } catch (SQLException x) { logger.log(SEVERE, "Unexpected failure", x); throw x; } 13 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  54. 54. // Multi-catch try { // ... } catch (IOException | SQLException x) { logger.log(SEVERE, "Unexpected failure", x); throw x; } catch ( x) { logger.log(SEVERE, "Unexpected failure", x); throw x; } 13 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  55. 55. // Multi-catch try { // ... } catch (IOException | SQLException x) { logger.log(SEVERE, "Unexpected failure", x); throw x; } 13 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  56. 56. 14 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  57. 57. static void copy(Path src, Path dst) throws IOException { InputStream in = Files.newInputStream(src); OutputStream out = Files.newOutputStream(dst); byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); } 14 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  58. 58. static void copy(Path src, Path dst) throws IOException { InputStream in = Files.newInputStream(src); OutputStream out = Files.newOutputStream(dst); byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); } 15 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  59. 59. static void copy(Path src, Path dst) throws IOException { InputStream in = Files.newInputStream(src); OutputStream out = Files.newOutputStream(dst); try { byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); } finally { in.close(); out.close(); } } 15 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  60. 60. static void copy(Path src, Path dst) throws IOException { InputStream in = Files.newInputStream(src); OutputStream out = Files.newOutputStream(dst); try { byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); ✘ } finally { in.close(); out.close(); } } 15 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  61. 61. static void copy(Path src, Path dst) throws IOException { InputStream in = OutputStream out = try { Files.newInputStream(src); Files.newOutputStream(dst); byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); } finally { in.close(); out.close(); } } 16 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  62. 62. static void copy(Path src, Path dst) throws IOException { InputStream in = null; OutputStream out = null; try { in = Files.newInputStream(src); out = Files.newOutputStream(dst); byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); } finally { if (in != null) in.close(); if (out != null) out.close(); } } 16 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  63. 63. static void copy(Path src, Path dst) throws IOException { InputStream in = Files.newInputStream(src); try {= OutputStream out = Files.newOutputStream(dst);= byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); out.close(); } } finally { in.close(); } } 17 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Thursday, December 15, 2011
  64. 64. static void copy(Path src, Path dst) throws IOException { InputStream in = Files.newInputStream(src); try { OutputStream out = Files.newOutputStream(dst); try { byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); } finally { out.close(); } } finally { in.close(); } } 17 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  65. 65. static void copy(Path src, Path dst) throws IOException {{ InputStream in = Files.newInputStream(src); OutputStream out = Files.newOutputStream(dst);{ byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); ? }} 18 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Thursday, December 15, 2011
  66. 66. // Try-with-resources static void copy(Path src, Path dst) throws IOException { try ( ) InputStream in = Files.newInputStream(src); OutputStream out = Files.newOutputStream(dst); byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); ? } 18 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  67. 67. // Try-with-resources static void copy(Path src, Path dst) throws IOException { try ( InputStream in = Files.newInputStream(src); OutputStream out = Files.newOutputStream(dst); ) byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); ? } 18 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  68. 68. // Try-with-resources static void copy(Path src, Path dst) throws IOException { try (InputStream in = Files.newInputStream(src); OutputStream out = Files.newOutputStream(dst); ) { byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); } ? } 18 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  69. 69. // Try-with-resources 19 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  70. 70. // Try-with-resources package java.lang; public interface AutoCloseable { public void close() throws IOException; } 19 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  71. 71. 19 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  72. 72. package foo; class FooResource implements AutoCloseable { // ... public void close() { // ... } } 19 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  73. 73. 20 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  74. 74. -th row ise re b) Excep tion Pre c ean SQL // ool on, ow(b epti thr Exc re IO x); void rows e", t h fai lur { ted { x) nexpec r y { .. ion , "U t . ept ERE // h (Exc SEV atc r.log( } c gge lo w x; t hro } } 20 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  75. 75. // L iter als -th row byte ise re b) Excep tion b = (byt Pre c ean SQL e)0b // ool on, int 1010 ow(b epti thr Exc magi c = 1010 re IO x); 0xCA ; void rows e", long FE_B t h fai lur max = 0x ABE; { ted 7fff { x) nexpec _fff r y { .. ion , "U f_ff t . ept ERE ff_f // h (Exc SEV fff atc r.log( } c gge L; lo w x; t hro } } 20 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  76. 76. // L iter als -th row byte ise re b) Excep tion b = (byt Pre c ean SQL e)0b // ool on, int 1010 ow(b epti thr Exc magi c = 1010 re IO x); 0xCA ; void rows e", long FE_B t h fai lur max = 0x ABE; { ted 7fff { x) nexpec _fff r y { .. ion , "U f_ff t . ept ERE ff_f // h (Exc SEV fff atc r.log( } c gge L; // Safe varargs lo w x; t hro @SafeVarargs } static <T> void addTo List3 (List<T> listAr } g, { T ... elements) for (T x : elements) { listArg.add(x); } } 20 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  77. 77. 21 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  78. 78. 22 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  79. 79. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework 23 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  80. 80. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework NIO.2 (JSR 203) 23 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  81. 81. 24 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  82. 82. Luck FScript Bex Script Forth foo Lisp JRuby Funnel CAL Scala C# Pascal Sather Drools Tea JudoScript Ada Dawn Zigzag Rexx Mini v-language BeanShell Scheme G Jython TermWare JavaScript Tiger iScript Processing Icon LLP Oberon SALSA Basic Tcl PHP E Smalltalk Hojo JHCR Logo Groovy Yoix Yassl Piccola Simkin Clojure WebL Prolog JESS Eiffel Phobos PLAN Correlate Modula-2 Nice ObjectScript Pnuts Anvil Jickle Sleep Present 24 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  83. 83. 25 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  84. 84. Ruby = Method Calls Lots and lots and lots of ʼem … 25 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  85. 85. 26 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  86. 86. def foo bar end def bar baz end def baz # ... end 26 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  87. 87. JRuby on Java 5/6 def foo bar end JRuby JRuby def bar foo call bar call baz baz logic logic end def baz # ... end Kills many JVM optimizations 26 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  88. 88. JRuby on Java 7 with InvokeDynamic def foo bar end def bar foo bar baz baz end def baz # ... end Straight-through dispatch paths 26 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  89. 89. JRuby on Java 7 with InvokeDynamic def foo bar end def bar foo bar bar baz baz baz end def baz # ... end Optimizations (like inlining) can happen! 26 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  90. 90. Times faster than Ruby 1.9.3 15 14.2x 12 8 7.4x 5.5x 4.4x 5 3.6x 3.5x 3.2x 2.7x 1.7x 1.8x 1.6x 1.9x 1 fib +calls +consts +both richards redblack JRuby on Java 6 JRuby on invokedynamic 27 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  91. 91. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework 28 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  92. 92. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework NIO.2 (JSR 203) 28 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  93. 93. 29 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  94. 94. 29 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  95. 95. 30 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  96. 96. 1. Keep all the processor cores busy 30 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  97. 97. 1. Keep all the processor cores busy 2. Minimize synchronization overhead 30 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  98. 98. 1. Keep all the processor cores busy 2. Minimize synchronization overhead 3. Scale linearly as the number of cores increases 30 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  99. 99. 31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  100. 100. 31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  101. 101. 31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  102. 102. 31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  103. 103. 31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  104. 104. 31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  105. 105. 31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  106. 106. 31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  107. 107. 31 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  108. 108. 32 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  109. 109. Result compute(Task t) { } 32 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  110. 110. Result compute(Task t) { if (t.size() < SEQUENTIAL_THRESHOLD) { } } 32 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  111. 111. Result compute(Task t) { if (t.size() < SEQUENTIAL_THRESHOLD) { return t.computeSequentially(); } } 32 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  112. 112. Result compute(Task t) { if (t.size() < SEQUENTIAL_THRESHOLD) { return t.computeSequentially(); } else { Result left, right; left = compute(p.leftHalf()); right = compute(p.rightHalf()); } } 32 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  113. 113. Result compute(Task t) { if (t.size() < SEQUENTIAL_THRESHOLD) { return t.computeSequentially(); } else { Result left, right; left = compute(p.leftHalf()); right = compute(p.rightHalf()); return combine(left, right); } } 32 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  114. 114. Result compute(Task t) { if (t.size() < SEQUENTIAL_THRESHOLD) { return t.computeSequentially(); } else { Result left, right; left = compute(p.leftHalf()); right = compute(p.rightHalf()); return combine(left, right); } } 33 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  115. 115. Result compute(Task t) { if (t.size() < SEQUENTIAL_THRESHOLD) { return t.computeSequentially(); } else { Result left, right; INVOKE-IN-PARALLEL { left = compute(p.leftHalf()); right = compute(p.rightHalf()); } return combine(left, right); } } 33 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  116. 116. 34 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  117. 117. public class Task extends java.util.concurrent.RecursiveAction { List<Student> students; static final int SEQUENTIAL_THRESHOLD = 1 << 14; Task(List<Student> ss) { double result; students = ss; } protected void compute() { if (students.size() < SEQUENTIAL_THRESHOLD) { Task leftHalf() { result = computeSequentially(); int n = students.size(); } else { return new Task(students.subList(0, n / 2)); Task left = leftHalf(); } Task right = rightHalf(); invokeAll(left, right); // INVOKE-IN-PARALLEL Task rightHalf() { result = Math.max(left.result, right.result); int n = students.size(); } return new Task(students.subList(n / 2, n)); } } static double compute(List<Student> ss) { double computeSequentially() { ForkJoinPool pool = new ForkJoinPool(); double max = Double.MIN_VALUE; Task t = new Task(ss); for (Student s : students) { pool.invoke(t); if (s.gradYear == 2011) return t.result; max = Math.max(max, s.score); } } return max; } } 34 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  118. 118. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework 35 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  119. 119. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework NIO.2 (JSR 203) 35 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  120. 120. New Filesystem API File notifications Directory operations Asynchronous I/O New filesystem provider for zip/jar archives 36 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  121. 121. import java.nio.file.*; 37 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  122. 122. import java.nio.file.*; Path searchDir = Paths.get("c:/Users"); final Path findFile = Paths.get("baby.jpg"); 37 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  123. 123. import java.nio.file.*; Path searchDir = Paths.get("c:/Users"); final Path findFile = Paths.get("baby.jpg"); FileVisitor visitor = new SimpleFileVisitor() { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { if (file.getName().startsWith(findFile)) { System.out.format("%s%n", findFile); } return FileVisitResult.CONTINUE; } }; 37 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  124. 124. import java.nio.file.*; Path searchDir = Paths.get("c:/Users"); final Path findFile = Paths.get("baby.jpg"); FileVisitor visitor = new SimpleFileVisitor() { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { if (file.getName().startsWith(findFile)) { System.out.format("%s%n", findFile); } return FileVisitResult.CONTINUE; } }; EnumSet<FileVisitOption> opts = EnumSet.of(FileVisitOption.FOLLOW_LINKS); 37 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  125. 125. import java.nio.file.*; Path searchDir = Paths.get("c:/Users"); final Path findFile = Paths.get("baby.jpg"); FileVisitor visitor = new SimpleFileVisitor() { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { if (file.getName().startsWith(findFile)) { System.out.format("%s%n", findFile); } return FileVisitResult.CONTINUE; } }; EnumSet<FileVisitOption> opts = EnumSet.of(FileVisitOption.FOLLOW_LINKS); Files.walkFileTree(searchDir, opts, Integer.MAX_VALUE, visitor); 37 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  126. 126. import java.nio.file.*; Path searchDir = Paths.get("c:/Users"); final Path findFile = Paths.get("baby.jpg"); FileVisitor visitor = new SimpleFileVisitor() { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { if (file.getName().startsWith(findFile)) { System.out.format("%s%n", findFile); } return FileVisitResult.CONTINUE; } }; EnumSet<FileVisitOption> opts = EnumSet.of(FileVisitOption.FOLLOW_LINKS); Files.walkFileTree(searchDir, opts, Integer.MAX_VALUE, visitor); 37 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  127. 127. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework Strict class-file checking · Upgrade the class-loader architecture · Method to close a URLClassLoader · Concurrency and collections updates · Unicode 6.0 · Locale enhancement · Separate user and user-interface locales · More new I/O APIs (JSR 203) · Filesystem provider for zip/jar archives · SCTP · SDP · Windows Vista IPv6 stack · TLS 1.2 · Elliptic-curve cryptography (ECC) · JDBC 4.1 · XRender pipeline for Java 2D · New platform APIs for 6u10 graphics features · Nimbus look-and-feel for Swing · Swing JLayer component · Gervill sound synthesizer · Update the XML stack · Enhanced MBeans 38 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  128. 128. 7 Project Coin (JSR 334) InvokeDynamic (JSR 292) Fork/Join Framework NIO.2 (JSR 203) Strict class-file checking · Upgrade the class-loader architecture · Method to close a URLClassLoader · Concurrency and collections updates · Unicode 6.0 · Locale enhancement · Separate user and user-interface locales · More new I/O APIs (JSR 203) · Filesystem provider for zip/jar archives · SCTP · SDP · Windows Vista IPv6 stack · TLS 1.2 · Elliptic-curve cryptography (ECC) · JDBC 4.1 · XRender pipeline for Java 2D · New platform APIs for 6u10 graphics features · Nimbus look-and-feel for Swing · Swing JLayer component · Gervill sound synthesizer · Update the XML stack · Enhanced MBeans 38 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  129. 129. JVM Convergence Copyright © 2010 Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  130. 130. JVM Convergence Copyright © 2010 Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  131. 131. 8 40 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  132. 132. 8 Project Lambda (JSR 335) 40 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  133. 133. 8 Project Lambda (JSR 335) Project Jigsaw (JSR TBD) 40 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  134. 134. 41 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  135. 135. 41 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  136. 136. C# 41 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  137. 137. 41 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  138. 138. 42 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  139. 139. class Student { String name; int gradYear; double score; } 42 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  140. 140. class Student { String name; int gradYear; double score; } List<Student> students = ...; 42 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  141. 141. class Student { String name; int gradYear; double score; } List<Student> students = ...; double max = Double.MIN_VALUE; for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score); } return max; 42 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  142. 142. List<Student> students = ...; public class Task extends java.util.concurrent.RecursiveAction { List<Student> students; static final int SEQUENTIAL_THRESHOLD = 1 << 14; Task(List<Student> ss) { double result; students = ss; } protected void compute() { if (students.size() < SEQUENTIAL_THRESHOLD) { Task leftHalf() { result = computeSequentially(); int n = students.size(); } else { return new Task(students.subList(0, n / 2)); Task left = leftHalf(); } Task right = rightHalf(); invokeAll(left, right); // INVOKE-IN-PARALLEL Task rightHalf() { result = Math.max(left.result, right.result); int n = students.size(); } return new Task(students.subList(n / 2, n)); } } static double compute(List<Student> ss) { double computeSequentially() { ForkJoinPool pool = new ForkJoinPool(); double max = Double.MIN_VALUE; Task t = new Task(ss); for (Student s : students) { pool.invoke(t); if (s.gradYear == 2011) return t.result; max = Math.max(max, s.score); } } return max; } } 42 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  143. 143. class Student { String name; int gradYear; double score; } List<Student> students = ...; double max = Double.MIN_VALUE; for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score); } return max; 42 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  144. 144. class Student { String name; int gradYear; double score; } List<Student> students = ...; double max = Double.MIN_VALUE; for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score); } return max; 43 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  145. 145. class Student { String name; int gradYear; double score; } List<Student> students = ...; double max = Double.MIN_VALUE; for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score); } return max; 43 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  146. 146. class Student { String name; int gradYear; double score; } List<Student> students = ...; double max = Double.MIN_VALUE; for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score); } return max; 43 | Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Thursday, December 15, 2011
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×