JDK 26 新特性概览
JEP 500: Prepare to Make Final Mean Final
Issue warnings about uses of deep reflection to mutate final fields. These warnings aim to prepare developers for a future release that ensures integrity by default by restricting final field mutation, which will make Java programs safer and potentially faster. Application developers can avoid both current warnings and future restrictions by selectively enabling the ability to mutate final fields where essential.
JEP 500: 准备让 final 真正意味着 final
针对使用深度反射修改 final 字段的行为发出警告。这些警告旨在让开发者准备好迎接未来的版本,该版本将通过限制 final 字段修改来确保默认完整性,从而使 Java 程序更安全,并可能更快。应用程序开发者可以通过在必要时选择性地启用修改 final 字段的能力,来避免当前警告和未来的限制。
JEP 504: Remove the Applet API
Remove the Applet API, which was deprecated for removal in JDK 17 (2021). It is obsolete because neither recent JDK releases nor current web browsers support applets.
JEP 504: 移除 Applet API
移除 Applet API,该 API 在 JDK 17 中已被标记为待移除(2021 年)。由于近期的 JDK 版本和当前的网络浏览器均不再支持 Applet,因此它已过时。
JEP 516: Ahead-of-Time Object Caching with Any GC
Enhance the ahead-of-time cache, which enables the HotSpot Java Virtual Machine to improve startup and warmup time, so that it can be used with any garbage collector, including the low-latency Z Garbage Collector (ZGC). Achieve this by making it possible to load cached Java objects sequentially into memory from a neutral, GC-agnostic format, rather than map them directly into memory in a GC-specific format.
JEP 516: 使用任意 GC 的提前对象缓存
增强 AOT 缓存,使 HotSpot Java 虚拟机能够改善启动和预热时间,从而可与任何垃圾收集器一起使用,包括低延迟的 Z Garbage Collector (ZGC)。为此,需要能够从中立的、与 GC 无关的格式将缓存的 Java 对象按顺序加载到内存中,而不是以特定于 GC 的格式将它们直接映射到内存中。
JEP 517: HTTP/3 for the HTTP Client API
Update the HTTP Client API to support the HTTP/3 protocol, so that libraries and applications can interact with HTTP/3 servers with minimal code change.
JEP 517: 为 HTTP Client API 提供 HTTP/3
更新 HTTP Client API 以支持 HTTP/3 协议,以便库和应用程序能够以最少的代码更改与 HTTP/3 服务器交互。
JEP 522: G1 GC: Improve Throughput by Reducing Synchronization
Increase application throughput when using the G1 garbage collector by reducing the amount of synchronization required between application threads and GC threads.
JEP 522: G1 GC: 通过减少同步提高吞吐量
在使用 G1 垃圾收集器时,通过减少应用程序线程与 GC 线程之间所需的同步量,来提高应用程序吞吐量。
JEP 524: PEM Encodings of Cryptographic Objects (Second Preview)
Introduce an API for encoding objects that represent cryptographic keys, certificates, and certificate revocation lists into the widely-used Privacy-Enhanced Mail (PEM) transport format, and for decoding from that format back into objects. This is a preview API.
JEP 524: 密码学对象的 PEM 编码(第二次预览)
介绍一个 API,用于将表示加密密钥、证书和证书吊销列表的对象编码为广泛使用的 Privacy-Enhanced Mail (PEM) 传输格式,并从该格式解码回对象。这是一个 preview API。
JEP 525: Structured Concurrency (Sixth Preview)
Simplify concurrent programming by introducing an API for structured concurrency. Structured concurrency treats groups of related tasks running in different threads as single units of work, thereby streamlining error handling and cancellation, improving reliability, and enhancing observability. This is a preview API.
JEP 525: 结构化并发(第六次预览)
通过引入一个用于 structured concurrency 的 API 来简化并发编程。Structured concurrency 将运行在不同线程中的相关任务组视为单个工作单元,从而简化错误处理和取消,提高可靠性,并增强可观测性。这是一个 preview API。
JEP 526: Lazy Constants (Second Preview)
Introduce an API for lazy constants, which are objects that hold unmodifiable data. Lazy constants are treated as true constants by the JVM, enabling the same performance optimizations that are enabled by declaring a field final. Compared to final fields, however, lazy constants offer greater flexibility as to the timing of their initialization. This is a preview API.
JEP 526: Lazy Constants (第二次预览)
引入一个用于惰性常量的 API,这些对象持有不可修改的数据。惰性常量被 JVM 视为真正的常量,从而能够获得与将字段声明为 final 时相同的性能优化。然而,与 final 字段相比,惰性常量在其初始化时机方面提供了更大的灵活性。这是一个预览 API。
JEP 529: Vector API (Eleventh Incubator)
Introduce an API to express vector computations that reliably compile at runtime to optimal vector instructions on supported CPUs, thus achieving performance superior to equivalent scalar computations.
JEP 529: Vector API (第十一次孵化)
引入一个 API,用于表达向量计算,该 API 能在支持的 CPU 上于运行时可靠地编译为最优向量指令,从而实现优于等效标量计算的性能。
JEP 530: Primitive Types in Patterns, instanceof, and switch (Fourth Preview)
Enhance pattern matching by allowing primitive types in all pattern contexts, and extend instanceof and switch to work with all primitive types. This is a preview language feature.
JEP 530: 模式、instanceof 和 switch 中的原始类型 (第四次预览)
通过允许在所有模式上下文中使用基本类型来增强模式匹配,并扩展 instanceof 和 switch,使其适用于所有基本类型。这是一个预览语言特性。