JDK 14 List Of Targeted Features, Here’s What’s Expected To Come With Java 14 (Updated)

JDK 14

Java Development Kit, or JDK 14 is scheduled for a production release on March 17, 2020. This is following the usual 6 month release time frame for a new Java version.

Although JAVA 14 is still about a year away, JDK 14 is already taking shape. Two features have already been officially proposed: An improvement to NullPointerExceptions , and joining Non-volatile Mapped Byte Buffers are already expected as an official feature for Java 14.

A third expected feature is switch expressions, but this has yet to be officially proposed.

Here are the features proposed for Java 14:

Dominate the App Store.

Get the latest industry news first.

  • The planned improvement to NullPointerExceptions pertains to improving the usability of the exceptions generated by the JVM by describing exactly which variable was null. Authors of the proposal are looking to provide helpful information to developers and support staff about the premature termination of a program and improve program understanding by more clearly associating a dynamic exception with static program code. One goal is to reduce confusion and concern developers have about NullPointerExceptions.
  • Non-volatile mapped byte buffers would add new JDK-specific file mapping modes that allow the FileChannel API to be used to create MappedByteBuffer instances that refer to non-volatile memory (NVM). NVM enables programmers to build and update program state across program runs without incurring the significant copying or translation costs that input and output operations usually require. This is particularly significant for transactional programs. Thus the chief goal of this JDK Enhancement Proposal is to ensure that clients can access and update NVM from a Java program coherently and efficiently. A secondary goal is to implement this commit behavior using a restricted, JDK-internal API defined in class Unsafe, so it can be re-used by classes other than MappedByteBuffer that may need to commit to NVM. Another goal is to allow buffers mapped over NVM to be tracked by existing APIs for monitoring and management. Target OS/CPU platforms include Linux/x64 and Linux/AArch64.
  • Switch expressions simplify coding by extending switch so that it can be used as either a statement or an expression. Switch expressions are expected to be a permanent feature in JDK 14, after being previewed in both JDK 12 and JDK 13. Switch expressions also prepare for the use of pattern matching in switch, which will allow developers to conditionally extract components from objects more concisely and safely.

Here’s an updated list of the features officially proposed for Java 14:

  • JFR Event Streaming provides an API for the continuous consumption of JFR data from both in-process and out-of-process applications. JFR is a tool for collecting profiling and diagnostic data about a running Java application. The event streaming proposal records the same set of events as for the non-streaming case, with overhead of less than one percent if possible. Event streaming must co-exist with non-streaming recordings, both disk-based and memory-based. Motivating this proposal is a situation in which the HotSpot VM emits more than 500 data points using JFR, most of them available only by parsing log files. Currently, a user must start a recording, stop it, dump the contents to disk, and then parse the recording file. This works well for application profiling, but not for monitoring purposes. An example of monitoring usage is a dashboard that displays dynamic updates to data. There is overhead with creating a recording, such as copying data from the disk repository to a separate recording file. If there were a way to read data being recorded from the disk repository without creating a new recording file, much of the overhead could be avoided.
  • The planned improvement to NullPointerExceptions pertains to improving the usability of the exceptions generated by the JVM by describing exactly which variable was null. Authors of the proposal are looking to provide helpful information to developers and support staff about the premature termination of a program and improve program understanding by more clearly associating a dynamic exception with static program code. One goal is to reduce confusion and concern developers have about NullPointerExceptions.
  • Non-volatile mapped byte buffers would add new JDK-specific file mapping modes that allow the FileChannel API to be used to create MappedByteBuffer instances that refer to non-volatile memory (NVM). NVM enables programmers to build and update program state across program runs without incurring the significant copying or translation costs that input and output operations usually require. This is particularly significant for transactional programs. Thus the chief goal of this JDK Enhancement Proposal is to ensure that clients can access and update NVM from a Java program coherently and efficiently. A secondary goal is to implement this commit behavior using a restricted, JDK-internal API defined in class Unsafe, so it can be re-used by classes other than MappedByteBuffer that may need to commit to NVM. Another goal is to allow buffers mapped over NVM to be tracked by existing APIs for monitoring and management. Target OS/CPU platforms include Linux/x64 and Linux/AArch64.
  • Switch expressions simplify coding by extending switch so that it can be used as either a statement or an expression. Switch expressions are expected to be a permanent feature in JDK 14, after being previewed in both JDK 12 and JDK 13. Switch expressions also prepare for the use of pattern matching in switch, which will allow developers to conditionally extract components from objects more concisely and safely.
    Switch expressions, which simplify coding by extending switch so that it can be used as either a statement or an expression. Switch expressions were previewed in both JDK 12 and JDK 13. Switch expressions also prepare for the use of pattern matching in switch, which will allow developers to conditionally extract components from objects more concisely and safely.
  • NUMA-aware memory allocation for the G1 garbage collector, intended to improve G1 performance on large machines.
    Removal of the Concurrent Mark Sweep (CMS) garbage collector, which previously was deprecated and slated for removal. Successors to CMS have arisen including ZGC and Shenandoah.
  • Porting of ZGC to MacOS. It has been supported only on Linux thus far.
  • Removal of the pack200 and unpack200 tools and the Pack200 API in the java.util.jar package. These all were deprecated in Java SE 11 with the intent to remove them in the future. Pack200 is a compression scheme for JAR files.
  • Records, which would provide a compact syntax for declaring classes that are transparent holders for shallowly immutable data. The proposal states it should be easy and concise to declare shallowly immutable, well-behaved, nominal data aggregates.
  • A packaging tool, in an incubator phase of development, for packaging self-contained Java applications. The tool would be based on the JavaFX javapackager. Such a tool had been included in Java but was cut from JDK 11 as part of the removal of JavaFX.
  • Enhance the language with pattern matching for the instanceof operator. This would be a preview feature in JDK 14. Pattern matching allows common logic in a program, principally the conditional extraction of components from objects, to be more concisely and safely expressed.
  • A second preview of text blocks, a multi-line string literal that avoids the need for most escape sequences and automatically formats the string in a predictable way. Text blocks would give the developer control over the format when desired, simplify the writing of Java programs, and enhance the readability of strings. Text blocks was previewed in JDK 13; the JDK 14 iteration would add two new escape sequences.
  • Deprecating the combination of the Parallel Scavenge and Serial Old garbage collection algorithms. Java maintainers believe this combination is used very little but requires a lot of maintenance.

JDK 14 beta builds are already available for Linux, MacOS, and Windows and you can download the open source JDK 14 beta build here.

 

 

Dominate the App Store.

Get the latest industry news first.

Roamni Case Study
How Jason & Greg Built an App Worth Over $5 Million
  • How to Get $100,000s in Funding for Your App
  • What Makes a Profitable and Successful App
  • 7 Critical Entrepreneurial Lessons From Jason and Greg
  • How to Create Apps that Get People Hooked