JDK 16 Early-Access Release Notes

This is a draft of the release notes that will accompany JDK 16. The contents are subject to change until release.

Build 25

Day period support added to java.time formats (JDK-8247781)

core-libs/java.time

A new formatter pattern letter 'B', and its supporting method is added to java.time.format.DateTimeFormatter/DateTimeFormatterBuilder classes, which translates day periods defined in Unicode Consortium's CLDR (https://unicode.org/reports/tr35/tr35-dates.html#dayPeriods). Applications can now express periods in a day not only just am/pm, but something like "in the morning" or "at night". An example to demonstrate the day periods is as follows:

DateTimeFormatter.ofPattern("B").format(LocalTime.now())

which produces the day period text depending on the time of the day and locale.

Build 24

`HttpPrincipal::getName` returns incorrect name (JDK-8255584)

core-libs/java.net

The behavior of the HttpPrincipal::getName method has been updated to return the name in the correct format as outlined in its specification i.e. "realm:username". Previously, the method incorrectly returned "username" only.

Build 23

Removal of experimental features AOT and Graal JIT (JDK-8255616)

hotspot/compiler

The Java Ahead-of-Time compilation experimental tool jaotc has been removed. Using HotSpot VM options defined by JEP295 will produce a not supported option warning but will otherwise be ignored.

The experimental Java-based JIT compiler, Graal JEP317, has been removed. Attempt to use it will produce JVMCI error: JVMCI compiler 'graal' not found.

Build 21

Signed JAR support for RSASSA-PSS and EdDSA (JDK-8242068)

security-libs/java.security

This enhancement includes two main changes:

  1. The JarSigner API and the jarsigner tool now support signing a JAR file with an RSASSA-PSS or EdDSA key.

  2. Instead of signing the .SF file directly, jarsigner creates a SignerInfo signedAttributes field which contains ContentType, MessageDigest, SigningTime, and CMSAlgorithmProtection. The field will not be generated if an alternative signing mechanism is specified by the jarsigner -altsigner option. Please note that although this field was not generated by jarsigner before this code change, it has always been supported when parsing the signature. This means newly signed JAR files with the field can be verified by earlier JDK releases.

Refine ZipOutputStream.putNextEntry() to recalculate ZipEntry's compressed size (JDK-8253952)

core-libs/java.util.jar

Prior to JDK 16, ZipOutputStream.putnextEntry() would not recalculate the compressed size for a compressed (DEFLATED) entry. This could result in the ZipException, "invalid entry compressed size", being thrown if the current ZLIB implementation used when ZipOutputStream.putNextEntry() is called differs from the implementation at the time when the entry was added to the original ZIP file.

Starting with JDK 16, if the compressed size has not been explicitly set with the ZipEntry.setCompressedSize(long) method when writing a compressed(DEFLATED) entry, then the compressed size will be set to the actual compressed size after deflation.

Build 20

Removal of java.awt.PeerFixer (JDK-8253965)

client-libs/java.awt

The non-public class java.awt.PeerFixer was removed in this release. This class was used to provide deserialization support of ScrollPane objects created prior JDK 1.1.1.

Build 18

Removal of Legacy Elliptic Curves (JDK-8235710)

security-libs/javax.crypto

The SunEC provider no longer supports the following elliptic curves that are either obsolete or not implemented using modern formulas and techniques: secp112r1, secp112r2, secp128r1, secp128r2, secp160k1, secp160r1, secp160r2, secp192k1, secp192r1, secp224k1, secp224r1, secp256k1, sect113r1, sect113r2, sect131r1, sect131r2, sect163k1, sect163r1, sect163r2, sect193r1, sect193r2, sect233k1, sect233r1, sect239k1, sect283k1, sect283r1, sect409k1, sect409r1, sect571k1, sect571r1, X9.62 c2tnb191v1, X9.62 c2tnb191v2, X9.62 c2tnb191v3, X9.62 c2tnb239v1, X9.62 c2tnb239v2, X9.62 c2tnb239v3, X9.62 c2tnb359v1, X9.62 c2tnb431r1, X9.62 prime192v2, X9.62 prime192v3, X9.62 prime239v1, X9.62 prime239v2, X9.62 prime239v3, brainpoolP256r1 brainpoolP320r1, brainpoolP384r1, brainpoolP512r1

To continue using any of these curves users will need to find third-party alternatives.

Build 17

Object monitors no longer keep strong references to their associated object (JDK-8247281)

hotspot/runtime

When synchronization is performed on an object, an association is established between the object and the object monitor that implements the synchronization. In the past, the reference from a monitor to its associated object was a strong reference. These strong references would be observable through JVM TI functions that walk the heap (reported as JVMTI_HEAP_ROOT_MONITOR or JVMTI_HEAP_REFERENCE_MONITOR) and in heap dumps (reported as HPROF_GC_ROOT_MONITOR_USED). As of this release, a weak reference is used and these are not observable to JVM TI or heap dumps, and consequently JVMTI_HEAP_ROOT_MONITOR, JVMTI_HEAP_REFERENCE_MONITOR and HPROF_GC_ROOT_MONITOR_USED will no longer be reported.

Build 16

SUN, SunRsaSign, and SunEC Providers Supports SHA-3 Based Signature Algorithms (JDK-8172366)

security-libs/java.security

SUN, SunRsaSign, and SunEC provider have been enhanced to support SHA-3 based signature algorithms. DSA signatures, RSA, and ECDSA signature implementations with SHA-3 family of digests are now supported through these providers. In addition, RSASSA-PSS signature implementation from SunRsaSign provider can recognize SHA-3 family of digests when specified in signature parameters.

Build 14

The default HttpClient implementation returns cancelable futures (JDK-8245462)

core-libs/java.net

In this release, the default HttpClient returns cancelable futures.

The default HttpClient is created by a call to HttpClient.newHttpClient(), or by invoking the build method on builders returned by HttpClient.newBuilder(). The implementation of the sendAsync methods in the default HttpClient now return CompletableFuture objects that are cancelable. Invoking cancel(true) on a cancelable future that is not completed, attempts to cancel the HTTP exchange in an effort to release underlying resources as soon as possible. More information can be obtained by reading the API documentation of the HttpClient::sendAsync methods.

Deprecate java.security.cert APIs that represent DNs as Principal or String objects (JDK-8241003)

security-libs/java.security

The following APIs have been deprecated:

java.security.cert.X509Certificate.getIssuerDN()
java.security.cert.X509Certificate.getSubjectDN()
java.security.cert.X509CRL.getIssuerDN()
java.security.cert.X509CertSelector.setIssuer(String)
java.security.cert.X509CertSelector.setSubject(String)
java.security.cert.X509CertSelector.getIssuerAsString()
java.security.cert.X509CertSelector.getSubjectAsString()
java.security.cert.X509CRLSelector.addIssuerName(String)

These APIs either take or return Distinguished Names as Principal or String objects which can cause issues due to loss of encoding information or differences when comparing names across different Principal implementations. All of them have alternative APIs which use X500Principal objects instead.

Build 11

HttpClient.newHttpClient and HttpClient.Builder.build might throw UncheckedIOException (JDK-8248006)

core-libs/java.net

Creation of an instance of java.net.http.HttpClient may fail with UncheckedIOException if the underlying resources required by the implementation cannot be allocated.

Typically, this may happen if the underlying resources required to opening a java.nio.channels.Selector are not available. In this case Selector.open() will throw an IOException which the default implementation of java.net.http.HttpClient will wrap in an UncheckedIOException. The API documentation of HttpClient.newHttpClient() and HttpClient.newBuilder().build() have been updated to specify that UncheckedIOException may be thrown if the underlying resources required by the implementation cannot be allocated. Prior to this change, an undocumented InternalError would have been thrown.

Build 9

Added 3 SSL Corporation Root CA Certificates (JDK-8243320)

security-libs/java.security

The following root certificates have been added to the cacerts truststore:

+ SSL Corporation
  + sslrootrsaca
    DN: CN=SSL.com Root Certification Authority RSA, O=SSL Corporation, L=Houston, ST=Texas, C=US

  + sslrootevrsaca
    DN: CN=SSL.com EV Root Certification Authority RSA R2, O=SSL Corporation, L=Houston, ST=Texas, C=US

  + sslrooteccca
    DN: CN=SSL.com Root Certification Authority ECC, O=SSL Corporation, L=Houston, ST=Texas, C=US

Added Entrust Root Certification Authority - G4 certificate (JDK-8243321)

security-libs/java.security

The following root certificate has been added to the cacerts truststore:

+ Entrust
  + entrustrootcag4
    DN: CN=Entrust Root Certification Authority - G4, OU="(c) 2015 Entrust, Inc. - for authorized use only", OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US

Build 8

Support supplementary characters in String case insensitive operations (JDK-8248655)

core-libs/java.lang

Case insensitive operations in java.lang.String class now correctly do case insensitive comparisons for supplementary characters (characters which have code point values over U+FFFF). For details, see the updates to the methods:

   - compareToIgnoreCase(String other)
   - equalsIgnoreCase(String other)
   - regionMatches(boolean ignoreCase, ...)

For example,

"ud801udc00".equalsIgnoreCase("ud801udc28")

returns true, because '𐐀' ("ud801udc00") and '𐐨' ("ud801udc28") are equal to each other character in case insensitive comparison.

Build 5

jarsigner now preserves POSIX file permission and symlink attributes (JDK-8218021)

security-libs/java.security

When signing a file that contains POSIX file permission or symlink attributes, jarsigner will now preserve these attributes in the newly signed file but will warn that these attributes are unsigned and not protected by the signature. The same warning will be printed during the jarsigner -verify operation for such files.

Note that the jar tool does not read/write these attributes. This change would be more visible to tools like unzip where these attributes are preserved.

java.util.logging.LogRecord is updated to support long thread ids. (JDK-8245302)

core-libs/java.util.logging

In this release java.util.logging.LogRecord is updated to support long thread ids.

LogRecord::getThreadID and LogRecord::setThreadID are deprecated: new accessors LogRecord::getLongThreadID and LogRecord::setLongThreadID are provided and should be used instead.

The serial field threadID has been deprecated and a new serial field longThreadID that can support long values has been introduced. The deprecated threadID field is kept in the serial form for backward compatibility. Long thread ids that are less than Integer.MAX_VALUE are directly mapped to threadID (and longThreadID has the same value). For longThreadID greater than Integer.MAX_VALUE, a new negative value for the int threadID is synthesized, using a deterministic algorithm based on the longThreadID hash, and such that the resulting value is guaranteed to be a negative value.

Delivered

Enhanced Support of Proxy Class (JDK-8236862)

core-libs/java.io:serialization

The deserialization of java.lang.reflect.Proxy objects can be limited by setting the system property jdk.serialProxyInterfaceLimit. The limit is the maximum number of interfaces allowed per Proxy in the stream. Setting the limit to zero prevents any Proxies from being deserialized including Annotations, a limit of less than 2 might interfere with RMI operations.

Improve Certificate Chain Handling (JDK-8245417)

security-libs/javax.net.ssl

A new system property, jdk.tls.maxHandshakeMessageSize, has been added to set the maximum allowed size for the handshake message in TLS/DTLS handshaking. The default value of the system property is 32768 (32 kilobytes).

A new system property, jdk.tls.maxCertificateChainLength, has been added to set the maximum allowed length of the certificate chain in TLS/DTLS handshaking. The default value of the system property is 10.

Added Property to Control LDAP Authentication Mechanisms Allowed to Authenticate Over Clear Connections (JDK-8237990)

core-libs/javax.naming

A new environment property, jdk.jndi.ldap.mechsAllowedToSendCredentials, has been added to control which LDAP authentication mechanisms are allowed to send credentials over clear LDAP connections - a connection not secured with TLS. An encrypted LDAP connection is a connection opened by using ldaps scheme, or a connection opened by using ldap scheme and then upgraded to TLS with a STARTTLS extended operation.

The value of the property, which is by default not set, is a comma separated list of the mechanism names that are permitted to authenticate over a clear connection. If a value is not specified for the property, then all mechanisms are allowed. If the specified value is an empty list, then no mechanisms are allowed (except for none and anonymous). The default value for this property is 'null' ( i.e. System.getProperty("jdk.jndi.ldap.mechsAllowedToSendCredentials") returns 'null'). To explicitly permit all mechanisms to authenticate over a clear connection, the property value can be set to "all". If a connection is downgraded from encrypted to clear, then only the mechanisms that are explicitly permitted are allowed.

The property can be supplied to the LDAP context environment map, or set globally as a system property. When both are supplied, the environment map takes precedence.

Note: none and anonymous authentication mechanisms are exempted from these rules and are always allowed regardless of the property value.