一、core-libs/java.nio

添加 FileSystems.newFileSystem(Path, Map<String, ?>) 方法

java.nio.file.FileSystems 针对任何将文件内容视作文件系统的文件系统提供者,添加了三个扩展方法:

  • newFileSystem(Path)
  • newFileSystem(Path, Map<String, ?>)
  • newFileSystem(Path, Map<String, ?>, ClassLoader)

需要说明的是 newFileSystem(Path, Map<String, ?>) 方法是在现有 newFileSystem(Path, ClassLoader) 方法基础上,对参数 class loader 作 null处理的调用。因此需要避免如下使用:

FileSystem fs = FileSystems.newFileSystem(path, null);

详细参见: JDK-8218875

二、core-libs/java.nio

 java.nio.ByteBuffer 添加了批处理方法 get/put Methods,不需要再通过索引处理。

详细参见:JDK-5029431

三、core-libs/java.time

JapaneseEra.of(3) or JapaneseEra.valueOf("Reiwa") 替换 JapaneseEra.valueOf("NewEra")

详细参见: JDK-8205432
 
 
四、core-libs/java.util:i18n

更新支持 Unicode 12.1

  • java.lang.Character 更新支持Unicode 12 字符库, 11.0 至 12.0 添加了 554 字符,总计 137,928。包括4个新的 UnicodeScript,UnicodeScript总数达到150个;61 个 emoji 符号。12.1只添加了一个字符:U+32FF SQUARE ERA NAME REIWA。
  • java.text.Bidi 和java.text.Normalizer 更新支持Unicode 12(Unicode Standard Annexes, #9 and #15)
  • java.util.regex 更新支持Unicode 12(Unicode Standard Annex #29)

详细参见:JDK-8221431

五、hotspot/gc

JEP 351 ZGC Uncommit Unused Memory 

ZGC 垃圾回收加强,会将未使用的堆内存返还给操作系统。助益于内存敏感的应用及服务环境。

这个特性默认开启,可以通过配置关闭 -XX:-ZUncommit。另外,因为未使用内存不会被提交,所以堆大小会收缩至最小堆内存(-Xms)以内,这也就意味着当 -Xms 和 -Xmx 配置大小相同是,这一特性会被禁用。

-XX:ZUncommitDelay=<seconds> (默认300s):堆内存多久未使用会被置于未提交状态。

更多信息:JEP 351

详细参见:JDK-8220347

六、hotspot/gc

添加可管理的 -XXSoftMaxHeapSize 配置

使用ZGC垃圾回收器时有效 (-XX:+UseZGC).

使用此配置时,垃圾回收器会尽量避免堆内存超过执行配置的堆内存大小,特殊情况除外,如为了避免发生OutOfMemoryError异常。SoftMaxHeapSize 大小不能超过最大堆配置大小(-Xmx),此配置默认生效,默认配置值为最大堆配置值。

可管理即为可运行时调整配置。可以通过jcmd命令:VM.set_flag SoftMaxHeapSize <bytes> 或者 HotSpot MXBean 来修改。

此配置适用情景:

  • 服务资源敏感:使堆容量使用保持较低水平,同时能够应对临时的大容量使用需求。

  • When using a concurrent GC (such as ZGC), you might want to play it safe and increase the confidence level that you will not run into an allocation stall because of an unforeseen increase in allocation rate. Setting a soft max heap size encourages the GC to maintain a smaller heap, which means the GC will collect garbage more aggressively than it otherwise would, making it more resilient to a sudden increase in the application allocation rate.

详细参见:JDK-8222145

七、hotspot/gc

ZGC 最大堆内存上限调整为 16TB 

详细参见:JDK-8221786
八、hotspot/runtime

JEP 350 Dynamic CDS Archiving 

JEP 350 extends application class-data sharing (AppCDS) to allow the dynamic archiving of classes as a Java application is exiting. It also improves the usability of AppCDS by eliminating the need for users to do trial runs to create a class list for each application. The existing static archiving enabled by the -Xshare:dump option, using a class list, continues work as is.

The dynamically-generated archive is created on top of the default system archive packaged with the running JDK image. A separate top-layer archive file is generated for each application. The user can specify the filename of the dynamic archive name as the argument to the -XX:ArchiveClassesAtExit option. For example, the following command creates hello.jsa:

% bin/java -XX:ArchiveClassesAtExit=hello.jsa -cp hello.jar Hello

To run the same application using this dynamic archive:

% bin/java -XX:SharedArchiveFile=hello.jsa -cp hello.jar Hello

The user could also specify both the base and the dynamic archives in the -XX:SharedArchiveFile option such as:

-XX:SharedArchiveFile=<base archive>:<dynamic archive>

CSR JDK-8221706 has more details on the command line option.

详细参见:JDK-8207812

九、security-libs/java.security

CRLs 可配置的超时配置

The com.sun.security.crl.readtimeout CRL查询超时配置(默认15s),配置小于0时使用默认值,配置为0时,超时不起作用。

详细参见:JDK-8191808

十、security-libs/java.security

新命令:-showinfo -tls 用于查询 TLS 配置信息

详细参见:JDK-8219861

十一、security-libs/javax.crypto

MS Cryptography Next Generation (CNG) 支持

SunMSCAPI 提供程序现在支持读取Cryptography Next Generation (CNG) 格式私钥。如Windows秘钥存储器存储的RSA,EC秘钥及EC相关的签名算法如(SHA1withECDSASHA256withECDSA等)。

详细参见:See JDK-8026953

十二、security-libs/javax.crypto:pkcs11

SunPKCS11 提供程序升级支持 PKCS#11 v2.40 

这个版本的 SunPKCS11 提供程序支持添加了更多的加密算法支持,如AES/GCM/NoPadding 加解、使用 SHA-2家族消息摘要的DSA签名及RSASSA-PSS签名。

详细参见:JDK-8080462

十三、security-libs/javax.net.ssl

TLS X25519、X448 支持

The named elliptic curve groups x25519 and x448 are now available for JSSE key agreement in TLS versions 1.0 to 1.3, with x25519 being the most preferred of the default enabled named groups. The default ordered list is now:

x25519, secp256r1, secp384r1, secp521r1, x448,
  sect283k1, sect283r1, sect409k1, sect409r1, sect571k1, sect571r1,
  secp256k1,
  ffdhe2048, ffdhe3072, ffdhe4096, ffdhe6144, ffdhe8192

The default list can be overridden using the system property jdk.tls.namedGroups.

详细参见:JDK-8171279

十四、security-libs/javax.net.ssl

Session Resumption without Server-Side State in JSSE 

The feature allows for the server-side of JSSE to operate stateless. As described in RFC 50771 for TLS 1.2 and below, and RFC 84462 for TLS 1.3, the TLS server sends internal session information in the form of an encrypted session ticket to a client that supports stateless. That session ticket is presented to the server during the TLS handshake to resume the session. This should improve the performance and memory usage of the TLS server under large workloads as the session cache will seldom be used. With less session information cached, some session information may not be available. This feature is not enabled by default and can be turned on by setting two properties.

Note that invalidated stateless TLS sessions could be resumed in the current implementation. The behavior is not guaranteed to be the same in future releases and updates (see bugid JDK-8229148).

Note that in the current implementation, the return value of SSLSession.getID() is not persistent across resumption for TLS 1.3 and stateless TLS 1.2 connections. This could be an issue if applications rely on the session identifier values. This may change to be consistent a future release (see bugid JDK-8229149).

Two new System properties are added in support of this feature: jdk.tls.client.enableSessionTicketExtension is used on the client side to toggle the Session Ticket Extension on the ClientHello message for TLS 1.2. Property value: "true" sends the extension, "false" does not (default).

jdk.tls.server.enableSessionTicketExtension enables a server to use stateless session tickets if the client supports it. Clients that do not support stateless session tickets will use the cache. Property value: "true" enables stateless, "false" does not (default).

详细参见:JDK-8211018

十五、security-libs/javax.security

SASL 机制禁用配置

属性 jdk.sasl.disabledMechanisms 用户配置禁用 SASL 机制。可以通过配置 Sasl.createSaslClient 或者 the mechanism argument of Sasl.createSaslServer 的参数启用配置。配置默认为空,不禁用

详细参见:JDK-8200400

十六、security-libs/javax.xml.crypto

 Canonical XML 1.1 URIs 添加新的字符串常量 INCLUSIVE_11、INCLUSIVE_11_WITH_COMMENTS

位置:javax.xml.crypto.dsig.CanonicalizationMethod API。

详细参见:JDK-8224767

十七、security-libs/javax.xml.crypto

[xmldsig] Added KeyValueEC_TYPE 

The ECKeyValue type as described in the W3C Recommendation for XML-Signature Syntax and Processing is now supported. A new EC_TYPE constant has been added to the javax.xml.crypto.dsig.keyinfo.KeyValue interface. Please note that only the NamedCurve domain parameter type is currently supported, and the ECParameters explicit curve parameter type is not supported.

详细参见:JDK-8223053

十八、security-libs/org.ietf.jgss

Added a Default Native GSS-API Library on Windows 

A native GSS-API library has been added to JDK on the Windows platform. The library is client-side only and uses the default credentials. It will be loaded when the sun.security.jgss.native system property is set to "true". A user can still load a third-party native GSS-API library by setting the system property sun.security.jgss.lib to its path.

详细参见:JDK-6722928

十九、security-libs/org.ietf.jgss:krb5

Support for Kerberos Cross-Realm Referrals (RFC 6806) 

The Kerberos client has been enhanced with the support of principal name canonicalization and cross-realm referrals, as defined by the RFC 6806 protocol extension.

As a result of this new feature, the Kerberos client can take advantage of more dynamic environment configurations and does not necessarily need to know (in advance) how to reach the realm of a target principal (user or service).

Support is enabled by default and 5 is the maximum number of referral hops allowed. To turn it off, set the sun.security.krb5.disableReferrals security or system property to false. To configure a custom maximum number of referral hops, set the sun.security.krb5.maxReferrals security or system property to any positive value.

See further information in JDK-8223172.

详细参见:JDK-8215032

二十、tools/javac

JEP 354 Switch Expressions (Preview) 

Extend switch so it can be used as either a statement or an expression, and so that both forms can use either traditional case ... : labels (with fall through) or new case ... -> labels (with no fall through), with a further new statement for yielding a value from a switch expression. These changes will simplify everyday coding, and prepare the way for the use of pattern matching in switch. This is a preview language feature in JDK 13.

详细参见:JDK-8222184

二十一、tools/javac

JEP 355 Text Blocks (Preview) 

Add text blocks to the Java language. A text block is a multi-line string literal that avoids the need for most escape sequences, automatically formats the string in a predictable way, and gives the developer control over format when desired. This is a preview language feature in JDK 13.

JDK-8223930 (not public)

二十二、tools/javadoc(tool)

Improved Javadoc Search

The search feature in API documentation generated by Javadoc has been improved. You can now consistently search API documentation using partial terms and camel-case abbreviations. See Javadoc Search Specification for a full description of search features.

详细参见:JDK-8220497

二十三、xml/jaxp

DOM 和 SAX 新的工厂类创建方法:

  • newDefaultNSInstance()
  • newNSInstance()
  • newNSInstance(String factoryClassName, ClassLoader classLoader)

如下:

DocumentBuilder db = DocumentBuilderFactory.newDefaultNSInstance().newDocumentBuilder();

等同于:

DocumentBuilderFactory dbf = DocumentBuilderFactory.newDefaultInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();

 
详细参见:JDK-8219692

origin doc:https://www.oracle.com/technetwork/java/13-relnote-issues-5460548.html#NewFeature

Java 13 新特性的更多相关文章

  1. Java 13新特性

    switch表达式 switch表达式是Java 12开始就提供的预览特性,到了Java 13仍然没有被转正.此特性可以把switch的执行结果组合到复合表达式中进行运算. import java.t ...

  2. Java 8 新特性终极版

    声明:本文翻译自Java 8 Features Tutorial – The ULTIMATE Guide,翻译过程中发现并发编程网已经有同学翻译过了:Java 8 特性 – 终极手册,我还是坚持自己 ...

  3. Java 8新特性探究(八)精简的JRE详解

    http://www.importnew.com/14926.html     首页 所有文章 资讯 Web 架构 基础技术 书籍 教程 Java小组 工具资源 - 导航条 - 首页 所有文章 资讯 ...

  4. 【整理】Java 8新特性总结

    闲语: 相比于今年三月份才发布的Java 10 ,发布已久的Java 8 已经算是老版本了(传闻Java 11将于9月25日发布....).然而很多报道表明:Java 9 和JJava10不是 LTS ...

  5. Java-Runoob-高级教程:Java 9 新特性

    ylbtech-Java-Runoob-高级教程:Java 9 新特性 1.返回顶部 1. Java 9 新特性 Java 9 发布于 2017 年 9 月 22 日,带来了很多新特性,其中最主要的变 ...

  6. Java 8新特性之旅:使用Stream API处理集合

    在这篇“Java 8新特性教程”系列文章中,我们会深入解释,并通过代码来展示,如何通过流来遍历集合,如何从集合和数组来创建流,以及怎么聚合流的值. 在之前的文章“遍历.过滤.处理集合及使用Lambda ...

  7. Java 8 新特性终极指南

    1.前言 毫无疑问,Java 8的发布是自从Java5以来Java世界中最重大的事件,它在编译器.工具类和Java虚拟机等方面为Java语言带来的很多新特性.在本文中我们將一起关注下这些新变化,使用实 ...

  8. Java 11 新特性介绍

    Java 11 已于 2018 年 9 月 25 日正式发布,之前在Java 10 新特性介绍中介绍过,为了加快的版本迭代.跟进社区反馈,Java 的版本发布周期调整为每六个月一次——即每半年发布一个 ...

  9. [转帖]Java 8新特性探究 前言

    Java 8新特性探究 前言 https://my.oschina.net/benhaile/blog/174136 讲下java的历史 感觉挺好的. 评论 17 jdk8java8javase新特性 ...

随机推荐

  1. 何时使用异步或同步AJAX

    通常最好使用异步调用 通过优锐课核心java学习笔记中,我们可以看到,码了很多专业的相关知识, 分享给大家参考学习. AJAX代表异步JavaScript和XML,是一项允许异步更新网页的技术,这意味 ...

  2. PL/SQL不安装Oracle连接,Oracle instantclient安装

    ================================ ©Copyright 蕃薯耀 2020-01-07 https://www.cnblogs.com/fanshuyao/ 第一步: 下 ...

  3. linux系统下apache服务的启动、停止、重启命令

    本文章简单的介绍了关于linux下在利用命令来操作apache的基本操作如启动.停止.重启等操作,对入门者不错的选择.本文假设你的apahce安装目录为 usr local apache2,这些方法适 ...

  4. 【python基础语法】第6天作业练习题

    ''' 二.作业(每一道题封装成一个函数) 1.输出99乘法表,结果如下:(提示嵌套for循环,格式化输出) 2.有1 2 3 4 这四个数字,设计程序计算能组成多少个互不相同且无重复数字的3位数?分 ...

  5. C#在屏幕画点

    Graphics类没有提供直接画点的方法,最开始想使用填充圆形区域來实现,结果发现点很大,占据了4个像素.使用起点和终点一样来划线什么也没画出.画矩形,画椭圆都没实现.最后试到填充矩形,这次成功了. ...

  6. 线段树区间染色 ZOJ 1610

    Count the Colors ZOJ - 1610 传送门 线段树区间染色求染色的片段数 #include <cstdio> #include <iostream> #in ...

  7. app简单压力测试

    step1:手机开发者选项中,将USB调试选上 step2:确认手机和电脑已经连接成功:adb devices step3:安装测试app:adb install package.apk (1)cd命 ...

  8. 【Android】LitePal的基础

    一.环境配置 LitePal 在GitHub地址为:https://github.com/LitePalFramework/LitePal 我们使用起来也很方便,直接在gradle中配置即可. 如果你 ...

  9. Auto-scaling scikit-learn with Apache Spark

    来源:https://databricks.com/blog/2016/02/08/auto-scaling-scikit-learn-with-apache-spark.html Data scie ...

  10. phyon tensorflow 安装(centos)

    1.phyon27 安装 1.1 下载 wget https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgz 1.2  解压 tar -zxv ...