JDK 15 Has Been Released | What's new in JDK 15?

JDK 15 is live! Download it from the Java SE Downloads page. See the JDK 15 Release Notes for detailed information about this release. 

The following are some of the important additions and updates in Java SE 15 and JDK 15:

Java 15 Features:
339: Edwards-Curve Digital Signature Algorithm (EdDSA)
360: Sealed Classes (Preview)
371: Hidden Classes
372: Remove the Nashorn JavaScript Engine
373: Reimplement the Legacy DatagramSocket API
374: Disable and Deprecate Biased Locking
375: Pattern Matching for instanceof (Second Preview)
377: ZGC: A Scalable Low-Latency Garbage Collector
378: Text Blocks
379: Shenandoah: A Low-Pause-Time Garbage Collector
381: Remove the Solaris and SPARC Ports
383: Foreign-Memory Access API (Second Incubator)
384: Records (Second Preview)
385: Deprecate RMI Activation for Removal

What's New in JDK 15 - New Features and Enhancements:

This section describes some of the enhancements in Java SE 15 and JDK 15. 

➜ Added isEmpty Default Method to CharSequence

➜ Support for Unicode 13.0
➜ JEP 371 Hidden Classes
JEP 371 introduces hidden classes in Java 15. Hidden classes have the following implications to existing code:

Class::getName
Class::descriptorString 
Class::getNestMembers

➜ Added Support for SO_INCOMING_NAPI_ID Support
➜ Specialized Implementations of TreeMap Methods
➜ Added Ability to Configure Third Port for Remote JMX
core-svc/tools
➜ New Option Added to jstatd for Specifying RMI Connector Port Number
A new -r <port> option has been added to the jstatd command to specify the RMI connector port number. If a port number is not specified, a random available port is used.

➜ New Option Added to jcmd for Writing a gzipped Heap Dump
A new integer option gz has been added to the GC.heap_dump diagnostic command. 
➜ JEP 378 Text Blocks
Text blocks have been added 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 the format when desired.

➜ New Options Added to jhsdb for debugd Mode
Three new options have been added to the jhsdb command for the debugd mode:

--rmiport <port> is used to specify a RMI connector port number. If a port number is not specified, a random available port is used.
--registryport <port> is used to specify a RMI registry port number. This option overrides the system property sun.jvm.hotspot.rmi.port. If a port number is not specified, the system property is used. If the system property is not set, the default port 1099 is used.
--hostname <hostname> is used to specify a RMI connector host name. The value could be a hostname or an IPv4/IPv6 address. This option overrides the system property java.rmi.server.hostname. If a host name not specified, the system property is used. If the system property is not set, a system host name is used.

➜ Oracle JDK Installer for Windows Provides Executables (javac, etc) in a Path Reachable From Any Command Prompt
The Oracle JDK installer for Windows provides java.exe, javaw.exe, javac.exe, and jshell.exe commands in a system location so that users can run Java applications without needing to provide the path to the Oracle JDK's installation folder. Please see the following CSR for additional technical information:

➜ Added Revocation Checking to jarsigner

➜ Tools Warn If Weak Algorithms Are Used Before Restricting Them
The keytool and jarsigner tools have been updated to warn users about weak cryptographic algorithms being used before they are disabled. In this release, the tools issue warnings for the SHA-1 hash algorithm and 1024-bit RSA/DSA keys.

➜ SunJCE Provider Supports SHA-3 Based Hmac Algorithms
The SunJCE provider has been enhanced to support HmacSHA3-224, HmacSHA3-256, HmacSHA3-384, and HmacSHA3-512. 
➜ New System Properties to Configure the TLS Signature Schemes
Two new system properties have been added to customize the TLS signature schemes in JDK. jdk.tls.client.SignatureSchemes has been added for the TLS client side, and jdk.tls.server.SignatureSchemes has been added for the server side.

➜ Support for certificate_authorities Extension
The "certificate_authorities" extension is an optional extension introduced in TLS 1.3. It is used to indicate the certificate authorities (CAs) that an endpoint supports and should be used by the receiving endpoint to guide certificate selection.

➜ Support for canonicalize in krb5.conf
The 'canonicalize' flag in the krb5.conf file is now supported by the JDK Kerberos implementation. When set to true, RFC 6806 name canonicalization is requested by clients in TGT requests to KDC services (AS protocol). Otherwise, and by default, it is not requested.

Features and Options Removed in jdk 15:
This section describes the APIs, features, and options that were removed in Java SE 15 and JDK 15. 

➜ Removal of Terminally Deprecated Solaris-specific SO_FLOW_SLA Socket Option
➜ Removal of RMI Static Stub Compiler (rmic)
The RMI static stub compiler rmic has been removed. The rmic tool is obsolete and has been deprecated for removal since JDK 13.
➜ Removal of Deprecated Constant RMIConnectorServer.CREDENTIAL_TYPES
The terminally deprecated constant javax.management.remote.rmi.RMIConnectorServer.CREDENTIAL_TYPE has been removed. A filter pattern can be specified instead by using RMIConnectorServer.CREDENTIALS_FILTER_PATTERN.

➜ Removal of Nashorn JavaScript Engine
The Nashorn JavaScript script engine, its APIs, and the jjs tool have been removed. The engine, the APIs, and the tool were deprecated for removal in Java 11 with the express intent to remove them in a future release.

➜ Obsolete -XXUseAdaptiveGCBoundary
The VM option UseAdaptiveGCBoundary is obsolete. Use of this option will produce an obsolete option warning but will otherwise be ignored.

➜ Removal of Comodo Root CA Certificate
The following expired Comodo root CA certificate has been removed from the cacerts keystore

➜ Removal of DocuSign Root CA Certificate
The following expired DocuSign root CA certificate has been removed from the cacerts keystore

➜ Retired the Deprecated SSLSession.getPeerCertificateChain() Method Implementation
The implementation of the deprecated SSLSession.getPeerCertificateChain() method has been removed from the JDK in the SunJSSE provider and the HTTP client implementation. The default implementation of this method has been changed to throw UnsupportedOperationException.

➜ Removal of com.sun.net.ssl.internal.ssl.Provider Name
The legacy SunJSSE provider name, "com.sun.net.ssl.internal.ssl.Provider" has been removed and should no longer be used. The "SunJSSE" name should be used 

➜ Deprecated -XXForceNUMA Option
The VM option ForceNUMA is deprecated. Use of this option will produce a deprecation warning. This option will be removed in a future release.

➜ Disabled Biased-locking and Deprecated Biased-locking Flags

➜ Disabled Native SunEC Implementation by Default
The SunEC crypto provider no longer advertises curves that are not implemented by using modern formulas and techniques. Arbitrary and named curves, listed at the bottom of this note, are disabled. Commonly used named curves, secp256r1, secp384r1, secp521r1, x25519, and x448, remain supported and enabled by SunEC because they use modern techniques. Applications that still require the disabled curves from the SunEC provider can re-enable them by setting the System property jdk.sunec.disableNative to false. For example: java -Djdk.sunec.disableNative=false ....
If this property is set to any other value, the curves will remain disabled. Exceptions thrown when the curves are disabled will contain the message Legacy SunEC curve disabled, followed by the name of the curve. Methods affected by the change are KeyPair.generateKeyPair(), KeyAgreement.generateSecret(), Signature.verify(), and Signature.sign(). These methods throw the same exception class they had before when the curve was not supported.

The following curves are disabled: 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


➜ Added forRemoval=true to Previously Deprecated ContentSigner APIs


Other notes
client-libs
➜ Workaround for Windows GDI API's memory restrictions
It has been found that some Windows GDI functions don't support all types of Java heap memory allocation schemes. This problem can cause repaint issues and printing bugs. It has been worked around by allocating temporary buffers off heap.

➜ java.awt.Robot.delay() Method Completes With Interrupt Status Set When Interrupted
When it is interrupted, the implementation of the java.awt.Robot.delay() method has been changed to complete with the interrupt status set.

➜ Improved Serialization Handling
When setting a serialization filter by using java.io.ObjectInputStream.setObjectInputFilter the method must be called before reading any objects from the stream. If the methods readObject or readUnshared are called, the setObjectInputFilter method throws IllegalStateException.
➜ Optimized Empty Substring Handling
The implementation of String.substring and related methods stripLeading and stripTrailing have changed in this release to avoid redundantly creating a new empty String. This may impact code that depends on unspecified behaviour and the identity of empty sub-strings.
➜ LookupdefineClass Links the Class
Lookup::defineClass is specified to throw LinkageError if a linkage error occurs, but the implementation was not actually linking the class. In this release, the implementation has been changed to link the class before returning, so conforming to the specification. If Lookup::defineClass is called to define a class that fails linking, LinkageError will be thrown.

➜ DatagramSocketdisconnect Allows an Implementation to Throw UncheckedIOException
Previously, DatagramChannel::disconnect threw an IOException while DatagramSocket::disconnect did not. As a result, the DatagramChannel::socket adapter, which calls DatagramChannel::disconnect, catches the thrown IOException and rethrows it as an Error. However, this was undocumented behavior and not user-friendly.

➜ java.net.HttpClient Does Not Override Protocols Specified in SSLContext Default Parameters
During the setup of new connections, java.net.http.HttpClient now uses the default set of protocols provided by the SSLContext when negotiating the TLS handshake. In the absence of any SSLParameters explicitly supplied to the HttpClient.builder, the HttpClient has been updated to no longer override any default-selected protocols in the SSLContext. As a result, the actual TLS version that is negotiated might differ from that of previous releases, or it might even succeed or fail to negotiate when it previously might not have.

➜ Filtering and Ordering of Addresses Returned by Alternative Hosts File Name Service Provider
In this release, the behavior of InetAddress.getAllByName has been modified when the alternative hosts file name service is selected .

➜ DatagramPacket.getPort() Returns 0 When the Port Is Not Set
In this release, the default port number for a datagram packet has been changed to 0. Previously, this value was -1, which was undocumented. The port can be retrieved by using DatagramPacket::getPort.

➜ Modified the MS950 charset Encoder's Conversion Table
In this release, some of the one-way byte-to-char mappings have been aligned with the preferred mappings provided by the Unicode Consortium.

➜ Support Monetary Grouping Separator in DecimalFormat/DecimalFormatSymbols
DecimalFormat/DecimalFormatSymbols classes are now capable of dealing with grouping separators for currency values. For example, the monetary grouping separator for the German language used in Austria (the de-AT locale) is '.', whereas the monetary grouping separator in other German locales is ' '.

➜ localizedBy() Overrides Localized Values With Default Values
java.time.format.DateTimeFormatter.localizedBy(Locale) method now honors the default locale values, such as Chronologyand/or DecimalStyle of the specified locale argument.

For example, in previous JDK releases:

jshell> DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)
    .localizedBy(Locale.forLanguageTag("fa"))
    .format(LocalDate.now())
$3 ==> "جمعه 1 مهٔ 2020"
the numbers are in Arabic (Western) numerals.

In JDK 15:

jshell> DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)
    .localizedBy(Locale.forLanguageTag("fa"))
    .format(LocalDate.now())
$3 ==> "جمعه Û± مهٔ Û²Û°Û²Û°"
the numbers are in Extended Arabic-Indic numerals because it is the default numbering system for the Farsi locale.

➜ ValueRange.of(long, long, long) Does Not Throw IAE on Invalid Inputs
java.time.temporal.ValueRange.of() methods are now correctly throwing an InvalidArgumentException on given invalid arguments. For example, of(5, 2, 10) which is invalid because the minimum is greater than the smallest maximum, now throws the exception.

➜ Performance Improvement for InflaterOutputStream.write
InflaterOutputStream(OutputStream out, Inflater infl, int bufLen) allows for specifying the decompressor and buffer size to be used.

➜ Case Insensitive Matching Doesn't Work Correctly for Some Character Classes
The Java regular expression engine supports the case insensitive mode. When this mode is turned on, the engine is supposed to match the input text without regard to the case of the characters it consists of.

➜ Better Listing of Arrays
The preferred way to copy a collection is to use a "copy constructor." For example, to copy a collection into a new ArrayList, one would write new ArrayList<>(collection). In certain circumstances, an additional, temporary copy of the collection's contents might be made in order to improve robustness. If the collection being copied is exceptionally large, then the application should be (aware of/monitor) the significant resources required involved in making the copy.

➜ Support for CLDR version 37

➜ Localized Time Zone Name Inconsistency Between English and Other Locales
English time zone names provided by the CLDR locale provider are now correctly synthesized following the CLDR spec, rather than substituted from the COMPAT provider. For example, SHORT style names are no longer synthesized abbreviations of LONG style names, but instead produce GMT offset formats.

➜ [macos] Support for Notarizing jpackage app-image and dmg
jpackage cannot create packages on macOS that are suitable for notarization.

➜ Flags Controlling C1 Inlining Have New Names
A number of flags controlling inlining in the C1 and C2 compilers have been split up into separate flags. The C2 compiler keeps the flags with the old names, and the C1 compiler gets the new flags.

Old flags now only controlling C2

MaxInlineLevel
MaxRecursiveInlineLevel
MaxInlineSize
MaxTrivialSize
InlineSmallCode
FreqInlineSize
New flags for C1 that replace the old ones

C1MaxInlineLevel
C1MaxRecursiveInlineLevel
C1MaxInlineSize
C1MaxTrivialSize
Deprecation


➜ Improved Ergonomics for G1 Heap Region Size
The default heap region size calculation has been changed to return larger regions by default. The calculation still aims to have 2048 regions, but two aspects have changed:
➜ JEP 377 ZGC A Scalable Low-Latency Garbage Collector (Production)
The Z Garbage Collector (ZGC) is now ready for use in production and no longer marked as an experimental feature. ZGC is enabled by using the -XX:+UseZGC command-line option (using -XX:+UnlockExperimentalVMOptions is no longer needed).

➜ Disabling large pages on Windows
-XX:+UseLargePages has no effect on Windows in this release. It was found that GDI APIs used by java2d don't support large pages. The JVM detects this problem and both warns about this and reverts to using small pages.

➜ Disabling NUMA Interleaving on Windows
-XX:+UseNUMAInterleaving has no effect on Windows in this release. It was found that GDI APIs used by java2d don't support the memory reservation scheme used for NUMA interleaving. The JVM detects this problem and both warns about this and turns off NUMA interleaving. 
➜ Field Layout Computation Changed
The way that field layout is computed has been changed, with more aggressive optimizations to avoid unused gaps in instances. These new optimizations can be disabled by using a new VM option -XX:-UseEmptySlotsInSupers.

➜ Enable ShowCodeDetailsInExceptionMessages by default
The default of the flag ShowCodeDetailsInExceptionMessages was changed to 'true'. The helpful NullPointerException messages of JEP 358 are now printed by default. The messages contain snippets of the code where the NullPointerException was raised.

➜ Signature and SignatureSpi Get Parameter Methods May Return null When Unsupported
Signature.getParameters() and SignatureSpi.engineGetParameters() may return null if the underlying provider does not support returning the parameters as AlgorithmParameters. For further details, see the Signature and SignatureSpi method descriptions.

➜ SunPKCS11 Initialization With NSS When External FIPS Modules Are in Security Modules Database
The SunPKCS11 security provider can now be initialized with NSS when FIPS-enabled external modules are configured in the Security Modules Database (NSSDB). Before this change, when such a library was configured for NSS in non-FIPS mode, the SunPKCS11 provider would throw a RuntimeException with the message "FIPS flag set for non-internal module".

➜ Default SSLEngine Should Create in Server Role
In JDK 11 and later, javax.net.ssl.SSLEngine by default used client mode when handshaking. As a result, the set of default enabled protocols may differ to what is expected. SSLEngine would usually be used in server mode. From this JDK release onwards, SSLEngine will default to server mode. The javax.net.ssl.SSLEngine.setUseClientMode​(boolean mode) method may be used to configure the mode.

➜ JEP 375 Pattern Matching for instanceof (Second Preview)
Pattern matching for the instanceof operator is a preview feature of the Java language in JDK 15. Pattern matching allows common logic in a Java program to be expressed more concisely and safely, namely the conditional extraction of components from objects. Preview features must not be used in production, but feedback from Java developers on the usability of preview features is welcome.

➜ Standard Doclet Index Files Compression
The Standard Doclet no longer generates pre-compressed index files. Decisions about compression are now left to the underlying means of delivery (for example, application layer protocols such as HTTP).

Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept