Java 15

Java 15 – Deprecation & Removals and Other Enhancements

Deprecation

Following functionalities are deprecated and are scheduled for removal in future release.

  1. Biased Locking − Biased Locking is disabled by default and all related command line options are deprecated. JDK community is looking to check the need to difficult to maintain legacy synchronization mechanism of biased locking. Biased locking was used in HotSpot virtual machine to reduce overhead of uncontended locking.
  2. RMI Activation − RMI activation is an optional part since Java 8 and is obsolete part of RMI. It was imposing an ongoing maintenance cost.

Removals

Following functionalities are removed.

  1. Nashorn JavaScript engine − Nashorn JavaScript engine introduced in Java 8 is now removed. With advent of GraalVM and other VM technologies, Nashorn was no longer used in Java ecosystem.
  2. Solaris/SPARC ports − Source Code and support for Solaris/SPARC, Solaris/x64, and Linux/SPARC ports which were deprecated in Java 14 are removed. Solaris and SPARC are superseded by Linux OS and Intel processors. So removing their code will help contributors to focus on development of new features to be added to the platform.

Other Enhancements

JEP 383 – Foreign Memory Access API

Java 14 allowed java programs to safely and efficiently access foreign memory outside of the Java heap. Earlier mapDB, memcached, ignite java libraries provided the foreign memory access. It is a cleaner API to operate on all types of foreign memories(native memory, persistent memory, managed heap memory etc.) in a seamless way. It also takes care of safety of JVM regardless of foreign memory type. Garbage collection/Memory deallocation operations should be explicitly mentioned as well.

This API is based on three main abstractions MemorySegment, MemoryAddress and MemoryLayout and is a safe way to access both heap as well as non-heap memory.

Java 15 continue this feature as incubating and added new refinements to the API.

  1. VarHandle API introduced to customize memory access var handles.
  2. Parallel processing of a memory segment is supported using the Spliterator interface.
  3. Mapped memory segments support enhanced.
  4. Native calls addresses can be manipulated and dereferenced.

JEP 339 − Edwards-Curve Digital Signature Algorithm (EdDSA)

Edwards-Curve Digital Signature Algorithm, EdDSA is an advanced elliptic curve scheme and is better than existing signature schemes in the JDK. It has improved security and performance as compared to other signature schemes. It is supported by popular crypto libraries like OpenSSL, BoringSSL etc. EdDSA will only be implemented in java 15 only in the SunEC provider.

JEP 373 − Reimplement the Legacy DatagramSocket API

Legacy implementations of the java.net.DatagramSocket and java.net.MulticastSocket APIs are replaced with simpler and more modern implementations which are easy to maintain and debug.

The current implementations of java.net.datagram.Socket and java.net.MulticastSocket are in jdk from 1.0, IPv6 was still under development.This JEP targets to replace current implementation of MulticastSocket which has reconciled IPv4 and IPv6 in ways that are difficult to maintain.

Text Blocks as Standard

Text blocks from Java 15 are no more preview. Now they are part of standard JDK.

Helpful NullPointerException

Helpful NullPointerException is now enabled by default in Java 15.

About the Author: Elavarasan PK

Technical Specialist, Intersoft Data Labs