7.
Evolving the Language From “Evolving the Java Language” - JavaOne 2005 • Java language principles – Reading is more important than writing – Code should be a joy to read – The language should not hide what is happening – Code should do what it seems to do – Simplicity matters – Every “good” feature adds more “bad” weight – Sometimes it is best to leave things out • One language: with the same meaning everywhere • No dialects • We will evolve the Java language • But cautiously, with a long term view • “first do no harm” also “Growing a Language” - Guy Steele 1999 “The Feel of Java” - James Gosling 1997 7Thursday, September 8, 2011

26.
The Details • Compiler desugars try-with-resources into nested try- finally blocks with variables to track exception state • Suppressed exceptions are recorded for posterity using a new facillity of Throwable • API support in JDK 7 • New superinterface java.lang.AutoCloseable • All AutoCloseable and by extension java.io.Closeable types useable with try-with-resources • anything with a void close() method is a candidate • JDBC 4.1 retrefitted as AutoCloseable too 26Thursday, September 8, 2011

27.
More Informative Backtraces java.io.IOException at Suppress.write(Suppress.java:19) at Suppress.main(Suppress.java:8) Suppressed: java.io.IOException at Suppress.close(Suppress.java:24) at Suppress.main(Suppress.java:9) Suppressed: java.io.IOException at Suppress.close(Suppress.java:24) at Suppress.main(Suppress.java:9) 27Thursday, September 8, 2011

39.
Fork Join Framework • Goal is to take advantage of multiple processor • Designed for task that can be broken down into smaller pieces – Eg. Fibonacci number fib(10) = fib(9) + fib(8) • Typical algorithm that uses fork join if I can manage the task perform the task else fork task into x number of smaller/similar task join the results 39Thursday, September 8, 2011

58.
Conclusions • Java SE 7 • Incremental changes • Evolutionary, not revolutionary • Good solid set of features to make developers life easier • Java SE 8 • Major new features: Modularisation and Closures • More smaller features to be defined • Java continues to grow and adapt to the changing world of IT 58Thursday, September 8, 2011

59.
The preceding 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. 59Thursday, September 8, 2011