· mashup,java

1. New Language Features

JEP 394 Pattern Matching for instanceof

Pattern Matching enhances the Java programming language with pattern matching for the instanceof operator.

Pattern matching allows common logic in a program, namely the conditional extraction of components from objects, to be expressed more concisely and safely.

JEP 395 Records

Records provide a compact syntax for declaring classes which are transparent holders for shallowly immutable data.

This will significantly reduce the verbosity of these classes and improve code readability and maintainability.

2. JVM Improvements

JEP 376 ZGC Concurrent Thread Processing

JEP 376 move ZGC thread-stack processing from safepoints to a concurrent phase, allows sub-millisecond pauses inside GC safepoints,

it will greatly improve performance and efficiencys.

JEP 387 Elastic Metaspace

This feature returns unused HotSpot VM class-metadata (i.e. metaspace) memory to the operating system more promptly, reducing metaspace footprint.

3. New Tools and Libraries

JEP 380 Unix-Domain Socket Channels

This feature adds Unix-domain (AF_UNIX) socket support to the socket channel and server-socket channel APIs in the java.nio.channels package.

JEP 392 Packaging Tool

This tool allows for packaging self-contained Java applications.

4. Futureproofing Your Work

JEP 390 Warning for Value-Based Classes

This feature designates the primitive wrapper classes (java.lang.Integer, java.lang.Double, etc) as value-based (similar to java.util.Optional and java.time.LocalDateTime)

and add forRemoval to their constructors, which are deprecated since JDK 9, prompting new warnings.

JEP 396 Strongly Encapsulate JDK Internals by default

This feature strongly encapsulates all internal elements of the JDK by default, except for critical internal APIs such as sun.misc.Unsafe.

5. Incubator and Preview Features

JEP 338 Vector API (Incubator)

This incubator API provides an initial iteration of an API to express vector computations that reliably compile at runtime

to optimal vector hardware instructions on supported CPU architectures and thus achieve superior performance to equivalent scalar computations.

JEP 389 Foreign Linker API (Incubator)

This incubator API offers statically-typed, pure-Java access to native code.

JEP 393 Foreign Memory Access API (3rd Incubator)

First introduced as an incubator API in Java 14 and again in Java 15,

this API allows Java programs to safely and efficiently operate on various kinds of foreign memory.

JEP 397 Sealed Classes (2nd Preview)

This preview feature restricts which other classes or interfaces may extend or implement them.

It allows the author of a class or interface to control which code is responsible for implementing it.

6. Improving Productivity for OpenJDK Developers

JEP 347 Enable C++14 Language Features (in JDK source code)

This allows the use of C++14 language features in JDK C++ source code and gives specific guidance about which of those features may be used in HotSpot code.

JEP 357 Migrate from Mercurial to Git

JEP 369 Migrate to GitHub

These JEPs migrate the OpenJDK Community's source code repositories from Mercurial (hg) to Git and host them on GitHub for JDK 11 and later.

JEP 386 Alpine Linux Port

JEP 388 Windows/AArch64 Port

The focus of these JEPs is not the porting effort itself, which was already done, but integrating them into the JDK main-line repository.