Pure Danger Tech


Java 7 Update

16 Feb 2009

It’s been a long while since I posted any kind of Java 7 update so I thought maybe it was time in case you haven’t been paying attention.

It seems that the dam broke at Devoxx in December. We got some clear direction on the expected timeline and what features will be in and out. There will be a Java 7 preview build available by JavaOne 2009 and theoretically an official Java 7 by January of 2010. I say theoretically because there still seem to be a lot of question marks to fill in pretty quickly.

The Java modularity story got turned upside down yet again. JSR 277 bit the dust and JSR 294 was revived. Project Jigsaw was announced as part of the new focus on modularizing the JDK rather than providing tools for modularizing your apps. This gives Sun a bit more flexibility to work outside the JCP but makes the general applicability a bit more ambiguous. Subsequently, there has been some new and vigorous discussion on the JSR 294 mailing lists where the observer list has been opened to writing. Alex Buckley has provided some initial proposals and Peter Kriens has added a proposal on nesting. Project Jigsaw has been approved. It appears that communication lines are open and work is proceeding.

In the language space, we learned that most importantly closures will not be included in Java 7. Java 7 will also NOT include property support, reified generics, operator overloading, and BigDecimal syntax. That leaves us with the opportunity for a few well-defined, high-value changes and Joe Darcy owns a new Project Coin to accept and process those proposals. At this point some of the most considered are:

A number of polls have now happened to collect information on possible language changes and the null-handling and exception enhancments seem to score consistently high. I agree that these would definitely help but they are small changes.

In the library space, it seems that JSR 203 (NIO2), JSR 308 (Annotations on Types) and some portion of JSR 166 (Concurrency updates) will definitely be included.

JSR 166 has started to narrow down exactly what will be included and the current proposal is the fork/join library but NOT the ParallelArray portions. Java 7 likely will include TransferQueues, Phasers, ConcurrentReferenceHashMap, and possibly a Fences API of some sort. Many of these will seem esoteric to most developers but several are of critical importance to those writing concurrency code.

One of my favorite JSRs, JSR 310 (Date and Time) announced in December that they were running behind and might not make it in time for Java 7. It seems that many people have stepped up to help out based on the mailing list but there is still work to be done. If you have some knowledge in this space or even can just try out the API for your own needs and provide feedback, that would help a lot.

In the Swing space, it seems that JSR 295 (Beans Binding) is out, JSR 296 (Swing Application Framework) is in, and JSR 303 (Bean Validation) is ambiguous. :) JSR 303 recently completed their public review and have collected a lot of feedback from the community but it’s unclear to me what the thinking is from Sun on it.

The new G1 garbage collector seems to finally be reaching stability and will be ported back to JDK 6 in JDK 6u14 in May. G1 is a new concurrent garbage collector designed to take the place of CMS, which many people find problematic. It’s great to have another option in GC.

Last but certainly not least, things are hopping in support for dynamic languages. John Rose is coordinating a whole bunch of sub-projects proceeding in parallel and it’s a feast for JVM-based language implementors. Projects include dynamic invocation, lightweight method handles, lightweight bytecode loading, interface injection, tail calls, continuations, and more. Surely not all of these will make it into Java 7 but some will and they will allow language implementors to do more and do it faster. From a future-looking perspective, these changes are crucial and will allow the JVM to continue to be a place to build great new languages.

All in all, it’s great to see things start to shape up for Java 7! I know some people are disappointed that closures and other features won’t be included. Personally, I think there is a lot of great and compelling stuff here if you’re currently running on Java and the innovative work being done on the JVM makes it a solid choice for new and existing languages moving forward.