Java Growth Equipment 19, a non-LTS (long-term assist) launch due in September, has reached the second and last launch candidate stage. Seven options goal the discharge together with structured concurrency, document patterns, a preview of a international operate and reminiscence API, and assist for the open supply Linux/RISC-V instruction set structure (ISA).
With the function set for JDK 19 now frozen, different planned capabilities such as universal generics and value objects should await a later model of the platform. JDK 19 follows the March 22 arrival of JDK 18. Normal Java is on a six-month launch cadence.
JDK 19 is slated to be formally launched for manufacturing use on September 20. The second launch candidate was printed in late August. An preliminary launch candidate was printed August 11, preceded by two rampdown phases in June and July. A second launch candidate is due August 25. Early entry builds of JDK 19 may be downloaded from jdk.java.net/19. The JDK 19 options embrace:
- Structured concurrency, in an incubator section, is meant to simplify multithreaded programming by way of a structured concurrency API. This concurrency treats a number of duties operating in numerous threads as a single unit of labor, to streamline error dealing with and cancellation. Reliability and observability are improved.
- A preview of record patterns, to deconstruct document values. Report patterns and sort patterns may be nested to allow a declarative, highly effective, and composable type of knowledge navigation and processing. Objectives of the proposal embrace extending sample matching to precise extra refined, composable knowledge queries whereas not altering the syntax or semantics of kind patterns. This proposal builds on sample matching for
instanceof
, delivered in JDK 16 in March 2021. Future plans might name for document patterns to be prolonged with capabilities similar to array patterns andvararg
patterns. Report patterns is a part of Project Amber, an effort to discover and incubate smaller, productivity-oriented Java options. - A preview of a foreign function and memory API, which might introduce an API by which Java packages can interoperate with code and knowledge exterior the Java runtime. By effectively invoking international features (i.e., code exterior the JVM) and safely accessing international reminiscence (i.e., reminiscence not managed by the JVM) the API allows Java packages to name native libraries and course of native knowledge with out the hazard and brittleness of the Java Native Interface (JNI). The international operate and reminiscence API combines two earlier incubating APIs: the international reminiscence entry API and the international linker API. The international operate and reminiscence API was beforehand incubated in JDK 17 and reincubated in JDK 18. The proposal’s objectives embrace ease of use, efficiency, generality, and security.
- A preview of virtual threads, that are light-weight threads that dramatically scale back the hassle of writing, sustaining, and observing high-throughput, concurrent functions. Objectives embrace enabling server functions written within the easy thread-per-request model to scale with near-optimal {hardware} utilization, enabling current code that makes use of the
java.lang
Thread API to undertake digital threads with minimal change, and allow troubleshooting, debugging, and profiling of digital threads with current JDK instruments. It’s not a purpose of this proposal to alter the fundamental concurrency mannequin in Java or supply a brand new knowledge parallelism assemble in both the Java language or Java libraries. Neither is it a purpose to take away the standard implementation of threads or to silently migrate current functions to make use of digital threads. - A 3rd preview of pattern matching for switch expressions and statements, extending sample matching to
change
, to permit an expression to be examined towards a lot of patterns, every with a particular motion, so advanced data-oriented queries may be expressed concisely and safely. This functionality beforehand was previewed in JDK 17 and JDK 18. The third preview would add refinements together with the substitute of guarded patterns withwhen
clauses inchange
blocks. Additionally, the runtime semantics of a sample change when the worth of the selector expression is null are extra carefully aligned with legacychange
semantics. The plan’s objectives embrace increasing the expressiveness and applicability ofchange
expressions and statements by permitting patterns to look in case labels. Different objectives embrace permitting builders to loosen up the historic null-hostility ofchange
when desired, rising the protection ofchange
statements and guaranteeing that currentchange
expressions and statements proceed to compile with no modifications and execute with equivalent semantics. - A fourth incubation of a vector API that may categorical vector computations that reliably compile at runtime to optimum vector directions on supported CPU architectures, thus attaining efficiency superior to equal scalar computations. Builders utilizing the API acquire a approach to write advanced vector algorithms in Java, utilizing the HotSpot auto-vectorizer however with a consumer mannequin that makes vectorizations extra predictable and sturdy. The vector API beforehand was incubated into JDK 16, JDK 17, and JDK 19.
Enhancements to the API proposed for JDK 19 embrace enhancements to load and retailer vectors to and fromMemorySegments
, as outlined by the International Operate and Reminiscence API preview. JDK 19 would additionally add two cross-lane vector operations, compress and develop, along with a complementary vector masks compress operation. The compress vector operation maps lanes of a supply vector, chosen by a masks, to a vacation spot vector in lane order, whereas the develop operation does the inverse. The compress operation is helpful in filtering question outcomes.
In one other addition to the vector API, bitwise integral lanewise operations can be expanded, together with operations such counting the variety of one bits, reversing the order of bits, and compressing and increasing bits. Objectives of the API included being clear and concise, platform-agnostic, having dependable runtime and compilation efficiency on x64 and AArch64 architectures, and enabling “swish” degradation, for conditions wherein a vector computation can’t be totally expressed at runtime as a sequence of vector operations. - With the Linux/RISC-V port, Java would acquire assist for a {hardware} instruction set that’s already supported by a variety of language toolchains. RISC-V really is a household of associated ISAs. The Linux/RISC-V port would solely assist the RV64GV configuration of RISC-V, a common objective 64-bit ISA that features vector directions. The builders of Java might take into account different RISC-V configurations sooner or later.
The port would assist the next HotSpot VM choices: the template interpreter, C1 (consumer) JIT compiler, C2 (server) JIT compiler, and all present mainline rubbish collectors together with ZGC and Shenandoah. The precise porting is sort of full; the main focus of the JDK Enhancement Proposal (JEP) is integration of the port into the JDK mainline repository.
Like JDK 18, JDK 19 is because of be a short-term launch, with solely six months of top-level, Premier assist.
The previous launch, JDK 17, was a Lengthy Time period Assist (LTS) launch, with a number of years of assist. It arrived September 14, 2021.
Copyright © 2022 IDG Communications, Inc.