Translate-CS 板


LINE

Blog 版: http://blog.dontcareabout.us/2020/07/jdk-15.html BBS 版以 markdown 格式撰写 底子不够,很多句子拆开来都看得懂,但是合并起来就死翘翘... (艹 ---------------------------------------------------------------------- 原文网址:https://www.infoworld.com/article/3534133/ jdk-15-the-new-features-in-java-15.html [Java Development Kit 15] 是 Java SE 的下个版本, Oracle 的实做在 6/11 进入到初期的 ramp-down phase, 该版本的功能集已经定型了。 JDK 15 的亮点包含 text block、hidden class、 foreign memory 存取 API 以及 sealed class、record 的 preview 版本。 Java upgrade 也进入到 ramp-down phase, 两个候选版本会在 8/20 之前释出。 general availability 会在 9/15。 JDK 15 的前身是 3/17 发布的 [JDK 14]。 Oracle 在 Java SE 保持着 6 个月发布一次新版的步调, 每年会有两个新的版本问世。 OpenJDK 15 的新功能与改变: * 第二个 [foreign memory 存取 API] 的孵化版本, 这可以让 Java 程式安全且有效率地存取 Java heap 以外的 foreign memory。 API 可以操作数种不同的 foreign memory, 像是 native、persistent、managed heap。 许多 Java 程式会存取 foreign memory,像是 Ignite、MapDB。 这个 API 会协助避免产生与 garbage collection、 跨 process 的 share memory、将档案对应至记忆体的序列化...... 相关的成本与不确定性。 目前的 Java API 没有提供令人满意的 foreign memory 存取方法。 但在新的提案当中,API 应该也不会损害到 JVM 的安全性。 这个功能在 [JDK 14] 当中完成了早期孵化板, 在 JDK 15 当中提供的是精链过的版本。 * [sealed class] 的 preview 版本。 除了 interface,sealed class 限制其他 class 或 interface 如何继承或实做 sealed class 的方式。 这个功能的目标包含 class 或 interface 的设计者 可以控制哪些程式码是有实做的责任、 提供一个比 access modifier 更具表达力的方法来限制 super class 的使用、 以及 support future directions in pattern matching by underpinning the exhaustive analysis of patterns。 * 移除 Solaris/SPARC、Solaris/x64、Linux/SPARC 的支援。(细节略) * [record] 是一种 class、它是 immutable 资料的透明载体。 在 JDK 14 当中以前期 preview 版面世, JDK 15 应该会包含 preview 二版。 这个计画的目标包含设计一个 OO 建造法来表达一个简单的数据集合、 帮助程式设计师专住在建构 immutable data 而不是可继承的行为、 自动实做资料相关的 method(像是 equals 跟 assessor)、 保持 Java 长期以来的原则(像是 nominal typing 以及移植能力)。 record 可以视为是 nominal tuple。 * 基於 [Edwards-Curve Digital Signature Algorithm (EdDSA)] 的加密签章演算法。 EdDSA 是现代的 elliptic curve scheme 胜过目前 JDK 当中的签章 scheme。 EdDSA 只有在 SunEC provider 当中会实做。 EdDSA 会被需要是因为相较於其他签章 scheme 它加强了安全度及效能。 一些加密的 library(例如 OpenSSL 跟 BoringSSL)已支援这个演算法。 * [重新实做古老的 DatagramSocket API], 将底层 `java.net.datagram.Socket` 以及 `java.net.MulticastSocket` API 换成简单且较现代的实做方式。 这带来几点好处:1. 容易除错与维护。 2. 使用 [Project Loom] 正在开发的 virtual thread。 新的计画会依循 JEP 353(重新实做古老的 Socket API)。 目前 `java.net.datagram.Socket` 以及 `java.net.MulticastSocket` 的实做 可以回溯至 JDK 1.0, 那时 IPv6 还在开发中。这造成目前 `MulticastSocket` 的实做 试着调解 IPv4 跟 IPv6 导致很难维护。 * 预设[关掉 biased locking], 所有相关的 command-line 选项也都 deprecate。(细节略) * 延续 [JDK 14] 的 preview 版本, 推出 [`instanceof` 的 pattern matching] 的 preview 二版。 pattern matching 主要可以让 「在程式当中用特定条件取出 object 的 component」的表示法变得更简洁。 像 Haskell 跟 C# 都因为其简约与安全的特性而包含 pattern matching。 * [hidden class] 是无法让其他 class 在 bytecode 当中直接使用的 class, 这让 framework 在 runtime 制造出 class 然後透过 reflection 的方式间接地使用这些 class。 hidden class 可以被定义为 [access control nest] 的 member, 并且可以独立 unload。 这个提案透过启用标准 API 来定义 无法被找到且有 limited lifecycle 的 hidden class, 会增加所有 JVM 上语言的效能。 无论 JDK 内外的 framework 将可以动态地制造 class 而不是定义 hidden class。 许多在 JVM 上的语言依赖动态制造 class 来达到弹性与效率。 这个提案的目标包含:让 framework 定义找不到实做细节的 class, 这样其他 class 就无法连结到、也无法用 reflection 的方式发现到; support for extending an access control nest with non-discoverable classes; 以及支援无法找到的 class 的侵入式 unload, 这样 framework 就有弹性可以想定义多少就定义多少。 另外一个目标是 deprecate 一个非标准 API `misc.Unsafe::defineAnonymousClass`, 这代表未来的版本会移除掉。 同样地,Java 语言并不会因为这个提案而有所改变。 * [Z Garbage Collector][ZGC]([ZGC])将从实现性质的功能转变成产品。 2018 年 9 月整合进 [JDK 11] 的 ZGC 是一个可拓展、低延迟的 GC。 ZGC 以实验性功能的身份导入, 是因为 Java 开发人员认为 ZGC 的大小与复杂度应该小心地逐步带入。 从那之後补强了许多部份, ranging from concurrent class unloading, uncommitting of unused memory, and support for data-class sharing to improved NUMA awareness and multi-threaded heap pre-touching。 heap 的最大值也从 4TB 增加到 16 TB。 支援的平台包括 Linux、Windows 与 MacOS。 * text block 在 JDK 14 与 [JDK 13] 都出过 preview 版, 要让 Java 程式码当中撰写多行字串的工作便得简单、 同时避免大多数情况下的 escape sequence。 一个 text block 是多行的字串,其中不包含 escape sequence、 自动用可预测的方式格式化、 并且提供开发人员控制格式的能力。 A goal of the text blocks proposal is enhancing the readability of strings in Java programs that denote code written in non-Java languages. Another goal is to support migration from string literals by stipulating that any new construct can express the same set of strings as a string literal, interpret the same escape sequences, and be manipulated in the same fashion as a string literal. OpenJDK 开发人员希望增加 escape sequence 以管理明确的 white space 以及换行符号。 * [Shenandoah low-pause-time garbage collector] 从实验性的功能转变成产品。 这在 [JDK 12] 时候导入,已经经过一年了。 * 移除 [Nashorn]。(细节略) * [Deprecation of the RMI Activation mechanism](细节略) [Java Development Kit 15]: https://openjdk.java.net/projects/jdk/15/ [JDK 14]: https://www.infoworld.com/article/3436795/jdk-14-the-new-features-in-java-14.html [foreign memory 存取 API]: https://openjdk.java.net/jeps/383 [sealed class]: https://openjdk.java.net/jeps/360 [record]: https://openjdk.java.net/jeps/384 [Edwards-Curve Digital Signature Algorithm (EdDSA)]: https://openjdk.java.net/jeps/339 [重新实做古老的 DatagramSocket API]: https://openjdk.java.net/jeps/373 [Project Loom]: https://www.infoworld.com/article/3230507/java-jdk-10-what-new-features-to-expect-in-the-next-java.html [关掉 biased locking]: https://openjdk.java.net/jeps/374 [`instanceof` 的 pattern matching]: https://openjdk.java.net/jeps/375 [hidden class]: https://www.infoworld.com/article/3520792/hidden-classes-could-be-coming-to-java.html [access control nest]: https://openjdk.java.net/jeps/181 [ZGC]: https://openjdk.java.net/jeps/377 [JDK 11]: https://www.infoworld.com/article/3265447/java-jdk-11-all-the-new-features-now-available.html [JDK 13]: https://www.infoworld.com/article/3340052/jdk-13-the-new-features-in-java-13.html [Shenandoah low-pause-time garbage collector]: https://www.infoworld.com/article/2888189/red-hat-shenandoah-boosts-java-garbage-collection.html [JDK 12]: https://www.infoworld.com/article/3301197/jdk-12-the-new-features-in-java-12.html [Nashorn]: https://www.infoworld.com/article/3279893/nashorn-javascript-engine-for-jvm-could-be-axed.html [Deprecation of the RMI Activation mechanism]: https://openjdk.java.net/jeps/385 -- 钱锺书: 说出来的话 http://www.psmonkey.org 比不上不说出来的话 Hiking / Singapore 板 只影射着说不出来的话 and more...... --



※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.39.40.175 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Translate-CS/M.1593620987.A.CB3.html







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:iOS站内搜寻

TOP