JEP 432: Record Patterns (Second Preview): Enhances the Java language by allowing users to nest record patterns and type patterns to create a powerful, declarative, and composable form of data navigation and processing. This helps increase developer productivity by enabling them to extend pattern matching to allow for more sophisticated and composable data queries.
JEP 433: Pattern Matching for Switch (Fourth Preview): By extending pattern matching to switch, an expression can be tested against a number of patterns—each with a specific action—so that complex data-oriented queries can be expressed concisely and safely. Expanding the expressiveness and applicability of switch expressions and statements helps increase developer productivity.
Project Loom Preview/Incubator Features
JEP 429: Scoped Values (Incubator): Enables the sharing of immutable data within and across threads, which are preferred to thread-local variables – especially when using large numbers of virtual threads. This increases ease-of-use, comprehensibility, robustness, and performance.
JEP 436: Virtual Threads (Second Preview): Significantly streamline the process of writing, maintaining, and observing high-throughput, concurrent applications by introducing lightweight virtual threads to the Java Platform. By enabling developers to easily troubleshoot, debug, and profile concurrent applications with existing JDK tools and techniques, virtual threads helps accelerate application development.
JEP 437: Structured Concurrency (Second Incubator): Simplifies multithreaded programming by treating multiple tasks running in different threads as a single unit of work. This helps development teams streamline error handling and cancellation, improve reliability, and enhance observability.
Project Panama Preview Features
JEP 434: Foreign Function & Memory API (Second Preview): Enables Java programs to interoperate with code and data outside of the Java runtime. By efficiently invoking foreign functions (i.e., code outside the Java Virtual Machine [JVM]), and by safely accessing foreign memory (i.e., memory not managed by the JVM), this feature enables Java programs to call native libraries and process native data without requiring the Java Native Interface. This increases ease-of-use, performance, and safety.
JEP 438: Vector API (Fifth Incubator): Expresses vector computations that reliably compile at runtime to vector instructions on supported CPU architectures. This increases performance compared to equivalent scalar computations.
向量核算由对向量的一系列操作组成。向量 API 用来表达向量核算,该核算能够在运转时可靠地编译为支撑的 CPU 架构上的最佳向量指令,然后完成优于等效标量核算的功用。向量 API 的方针是为用户供给简洁易用且与渠道无关的表达规模广泛的向量核算。
JDK21
方案于 2023 年 9 月发布一个 GA 和下一个 LTS 版别,现在JDK 21的 Proposed to Target 有两个 JEP。
JEP 430,字符串模板(预览版),一种 JEP 类型的特性,提议使用字符串模板来增强 Java 编程言语,字符串模板类似于字符串字面量,但包含在运转时合并到字符串模板中的嵌入式表达式。该特性已被归类为 JDK 21 的 Proposed to Target,但没有正式公布审查日期。
JEP 431,序列调集,提议引进“一个组能新表明调集概念的接口,这些调集的元素依照界说良好的序列或顺序排列,作为调集的结构特点。”其动因是因为调集框架(Collections Framework)中缺乏界说良好的排序和统一操作集。该特性已被归类为 JDK 21 的 Proposed to Target,但没有正式公布审查日期。
然后在InfoQ中找到如下材料:
咱们能够根据一些JEP草案和候选者估测哪些额定的JEP有可能被纳入JDK 21。
由红帽的杰出工程师 Andrew Haley 和 Andrew Dinn 提交的 JEP 草案 8303358,效果域值(预览版)改进了行将发布的 JDK 429 中供给的 JEP 20,效果域值(孵化器)。以前称为*规模局部变量(孵化器),*在 Project Loom 的支撑下,此功用主张在线程内和线程之间同享不行变数据。这优先于线程局部变量,尤其是在使用很多虚拟线程时。尽管该草案没有达到候选状态,但描绘明确指出该 JEP 将添加到 JDK 21 中。
JEP草案8277163,Value Objects(预览版)是Project Valhalla赞助的JEP的一项功用,它主张创立值目标 – 指定其实例行为的无标识值类。此草案与 JEP 401,基元类(预览版)相关,该类仍处于候选状态。
JEP 435,异步堆栈盯梢 VM API,一种功用 JEP 类型,主张界说一个有效的 API,用于从信号处理程序获取异步调用盯梢,以便从具有 Java 和本机帧信息的信号处理程序进行剖析。
JEP 401,基元类(预览版)在Valhalla项意图掌管下,引进了开发人员声明的基元类 – 特殊类型的值类 – 如上述值目标(预览版)JEP草案中所界说 – 界说新的基元类型。