wtf is in Java/JDK/wtf7?

  • 3,063 views
Uploaded on

Slides for a short lightning talk I gave at Near Infinity (www.nearinfinity.com) on what exactly is in JDK7.

Slides for a short lightning talk I gave at Near Infinity (www.nearinfinity.com) on what exactly is in JDK7.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
3,063
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
40
Comments
1
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. wtf is in Java/JDK/wtf 7 ??? Scott Leberknight
  • 2. "Making Java suck (a little) less..."
  • 3. jsr-203(NIO.2)
  • 4. // old way (deprecated)File file = new File("foo.txt");// new wayPath path = Paths.get("foo.txt");Path path = file.toPath();java.nio.file
  • 5. Files(finally, you can copy a file...only took ~15 years)FileSystem(s)FileStore
  • 6. scalable, asynchronous I/O (AsynchronousChannel & friends)socket-channel binding& config(NetworkChannel & friends)
  • 7. jsr-292(invokedynamic)
  • 8. invokedynamicinvokestatic invokespecialinvokevirtual invokeinterfaceinvokedynamic (new) "...an invokedynamic instruction is used to call methods which have linkage and dispatch semantics defined by non-Java languages..." - http://www.infoq.com/articles/invokedynamic
  • 9. jsr-334 (Project Coin)
  • 10. strings in switchswitch (action) { case "Red": stop(); break; case "Yellow": slowDown(); break; case "Green": go(); break; case "Blue": danceAJig(); break;}
  • 11. binary literalsint clutchSong = 0b10001110101; http://www.amazon.com/Robot-Hive-Exodus-Clutch/dp/B0009NSE1K
  • 12. short/byte literalsbyte b = 42y;short s = 32767s;
  • 13. underscores in numeric literalslong max = 9_223_372_036_854_775_807L;int song = 0b0100_0111_0101;
  • 14. multi-catchtry { // code...}catch (FileNotFoundException | NoSuchFileException | AccessDeniedException ex) { // handle...}
  • 15. final re-throwtry { actionThatThrowsIOException(); actionThatThrowsSQLException();}catch (final Exception e) { // handle... throw e; // IOException or SQLException}
  • 16. ARM (automatic resource management)try (InputStream is = url.openStream(); OutputStream os = new FileOutputStream(file)) { // use resources...} (AutoCloseable)
  • 17. diamond operatorMap<String, Map<Integer, List<String>>> things = new HashMap<>();
  • 18. modified JSRsJava Compiler API (jsr 199)JAXP 1.3 (jsr 206)JAXB 2.2 (jsr 222)JAX-WS 2.2 (jsr 224)Pluggable Annotation Processing (jsr 269)
  • 19. honorable mentionjava.util.Objects jsr166y - Concurrency & collections updatesEnhanced JMX agent andMBeans Autoloading of JDBC driversMethod to close aURLClassLoader JDBC 4.1
  • 20. assembly-codingClass Loader architecture updates (parallel-capable)Strict class file checkingElliptic curve cryptography (ECC)New garbage collector (lower pause times & betterpredictability than current CMS collector)
  • 21. deferred until JDK 8 (sometime next century)
  • 22. Project Lambda re d r (a.k.a. closures)de fe Collection Literals List<Integer> items = [1, 2, 3, 4, 5]; Modularity (JSR 294 modules, formerly superpackages)
  • 23. referenceshttp://jdk7.java.net/http://openjdk.java.net/projects/jdk7/features/http://jdk7.java.net/preview/http://download.java.net/jdk7/docs/api/http://www.infoq.com/articles/invokedynamichttp://www.vineetmanohar.com/2011/03/installing-java-7-on-mac-os-x/http://marxsoftware.blogspot.com/2011/03/jdk-7-new-interfaces-classes-enums-and.html
  • 24. (the end)scott.leberknight@nearinfinity.comwww.nearinfinity.com/blogs/twitter: sleberknight