My Java 8 Wishlist
Full Runtime Generics Support
I think the thing I would most like to see in a future version of Java (and the sooner the better) is reified generics. Although there are many minor syntactic sugar changes that would be nice, the erasure of generics type erasure would be most welcome.
JMX 2.0 Features
In the first response comment to Julian Exenberger's DZone-syndicated version of Java 8.0 Wishlist, Jonathan Fisher states that he'd like, among other things, "Annotation based JMX." I was disappointed when it was announced in the summer of 2009 that JMX 2.0 would be deferred until Java 8. Unfortunately, the relevant Java Specification Request (JSR 255) is in the Inactive state. There are numerous proposed features of JMX 2.0 that I'd like to see. Like Fisher, I'd appreciate annotation-based JMX. Other nice JMX 2.0 features included improved querying and the associated support for JMX web services.
Improved Date/Time Support
In the beginning, there was Date. This class had more than its share of problems and now 2/3 of its constructors (four out of six) are deprecated and nearly all of its methods are deprecated (the exceptions being largely methods overriding Object or implementing the Cloneable and Comparable interfaces).
The Calendar interface and its primary implementation class (GregorianCalendar) were attempts to address the problems associated with Date (though there are arguments for situations when Date is preferable to Calendar).
Calendarhas issues of its own and is not particularly pleasing to use because it sacrifices usability in the name of generality and flexibility (a benefit which is seldom applied because most of us use
GregorianCalendaranyway). Many Java developers have found the Joda Time library to be a refreshing approach to handling dates and times in Java.
Many of us were excited at the prospect of Java 7 delivering an improved date/time approach via JSR 310 ("Date and Time API"). Sadly, JSR 310 was not included in Java 7, but it sounds like there's the possibility that it could be part of Java 8. The reference implementation of JSR 310 is the ThreeTen project. It is summarized with this text: "ThreeTen provides a modern date and time library for Java and is the reference implementation for JSR 310. It includes many of the lessons of the Joda-Time project and aims to standardise date and time concepts in computing." I'd love to see JSR 310 implemented in Java 8.
Others' Java 8 Desires
The previously mentioned post Java 8.0 Wishlist outlines some of Julian Exenberger's most desired features for Java 8. These include properties, operator overloading, "finish autoboxing" (methods on literals), and "[making] JavaFX useful." Some of the people commenting on this post vehemently don't want properties or operator overloading. Other people stated their own desired features in comment on this post. These included annotations for checking preconditions and postconditions, modularization, "complete JavaFX," JRE on more platforms, and cleaned up SDK/libraries.
My guess is that one of the most sought-after features for Java 8 is "closures." Indeed, one of the best ways to identify which features are most likely to be most desired for Java 8 is to see what is "most missed" from the proposed but dropped Java 7 additions. I blogged that features such as closures, properties, reified generics, beans binding, operator overloading, and BigDecimal syntax that were dropped from Java 7. The Java.net poll on these features had almost half the respondents state that closures was their most-missed feature dropped from Java SE 7.
Charles Nutter would like to see Java 8 add coroutines and he has initiated that effort.
What's Likely to Make Java 8?
We will hopefully have a better idea of what will be in Java 8 by JavaOne 2011. However, we have some information that provides hints as to what we're most likely to see in Java 8. First, Mark Reinhold's famous Plan B gives us a good idea of initial tentative ideas for Java 8: modularity, "Lambda expressions (informally, 'closures')," Java types annotations, and more small language enhancements ("Project Coin 2").
Another good source of what is likely to really be in Java 8 is the article Looking Ahead to Java SE 7 and 8: A Discussion with Oracle’s Java Language Architect, Brian Goetz. In this article, Goetz talks about tentative Java 8 features such as "upgrades to the core Java libraries to more easily express parallel calculations on collections" and "virtual extension methods" (allows adding of " methods to interfaces that specify a reference to a default implementation").
Java is one of the most used programming languages in the world and the sheer size of its developer base means that there will be a wide disparity of opinions on which features Java would most benefit from. However, I believe that dynamic languages on the JVM (such as Groovy) have influenced many of us to favor closures and that is one feature that sounds destined for Java 8.