The release process for Java 14 has begun. JDK 14 is now in Rampdown Phase One, which means that the overall feature set is frozen and no further features will be targeted to this release.
As is usual for Java releases, a list of JEPs (Java Enhancement Proposals) forms the content for the new version. The set of finalized features is as follows:
- JEP 345: NUMA-Aware Memory Allocation for G1
- JEP 349: JFR Event Streaming
- JEP 352: Non-Volatile Mapped Byte Buffers
- JEP 358: Helpful NullPointerExceptions
- JEP 361: Switch Expressions (Standard)
Two JEPs deal with the arrival of the ZGC garbage collector on additional platforms:
- JEP 364: ZGC on macOS
- JEP 365: ZGC on Windows
Next comes several JEPs that relate to Preview or Incubating Features:
- JEP 305: Pattern Matching for instanceof (Preview)
- JEP 343: Packaging Tool (Incubator)
- JEP 368: Text Blocks (Second Preview)
- JEP 370: Foreign-Memory Access API (Incubator)
- JEP 359: Records (Preview)
This group of JEPs is perhaps more interesting that it initially appears - it actually contains two important building blocks of a major set of new features for Java.
The records feature essentially brings named tuples to Java, and is the first half of the feature called algebraic data types in other languages. The other half is the sealed types feature, which is JEP 360 and is not yet targeted for any release.
The other building block of a future feature is JEP 305 ("Pattern Matching for instanceof"). This feature seems at first sight to be very small, and for now just reduces the boilerplate of unsightly casts when using the `instanceof` operator:
if (obj instanceof String s) { // can use s here } else { // can't use s here }
Although it seems almost trivial, the real power of this feature will only arrive in a future version of Java. The switch expression feature (which is also being standardized as part of Java 14) will be used to build on JEP 305 to produce general pattern matching - which is a major new feature, especially when combined with algebraic data types.
Finally, a group of JEPs that cannot strictly be said to be features - as they deal only with the deprecation or removal of capabilities.
- JEP 362: Deprecate the Solaris and SPARC Ports
- JEP 366: Deprecate the ParallelScavenge + SerialOld GC Combination
- JEP 363: Remove the Concurrent Mark Sweep (CMS) Garbage Collector
- JEP 367: Remove the Pack200 Tools and API
This means that JDK 14 is something of a sad milestone - it marks the end of the road for Java on Solaris, which was the platform where it made its first appearance, back in 1995, as part of the first public release of Java technology.
The removal of the CMS collector is also notable. For almost all modern workloads, G1 performs as well or better than CMS (after a long period of maturation and stabilization). However, there remains a small class of low-latency, pause-sensitive applications that can neither tolerate G1's pause thresholds nor pay the performance overhead of collectors like Shenandoah or ZGC. No solution is offered for these workloads - in practice they must remain on Java 11 to be supported in the short-to-medium term.
Overall, Java 14 represents a significant step forwards for the platform, although the major features it contains are only released in Preview state. It is also true that to date, the Java market has not seen any significant uptake of non-LTS releases, so it remains to be seen whether Java 14 will move the adoption needle very much.
With the feature freeze and rampdown of Java 14 underway, the mainline of the Java development repositories is now looking towards Java 15 (which should arrive in September 2020).