JDK 20 is now GA, JDK 21 Early-Access builds, and important heads-up!

David Delabassee david.delabassee at oracle.com
Tue Mar 28 14:29:27 UTC 2023

Welcome to the latest OpenJDK Quality Outreach update!

Last week was busy as we released both Java 20 and JavaFX 20. To 
celebrate the launch, we hosted a live event focused on Java 20, i.e. 
Level Up Java Day. All the sessions recordings will be made available 
shortly on the YouTube Java channel.

Some recent events shown us that it is useful to conduct tests using the 
latest early-access OpenJDK builds. This will benefit the OpenJDK 
codebase but also your own codebase. Sometime, a failure could be due to 
an actual regression introduced in OpenJDK. In that case, we obviously 
want to hear about it while we can still address it. But sometime, a 
failure could also be due to a subtle behaviour change… that works as 
expected. Regardless of if it's a bug or a test that is now broken due 
to a behaviour change, we want to hear from you. In the latter case, it 
might also mean that we should probably communicate more about those 
changes even if they might seem subtle. On that note, please make sure 
to check all the 2 Heads-Up below: "Support for Unicode CLDR Version 42" 
and "New network interface names on Windows".

So please, let us know if you observe anything using the latest 
early-access builds of JDK 21.

## Heads-Up - JDK 20 - Support for Unicode CLDR Version 42

The JDK's locale data is based on the Unicode Consortium's Unicode 
Common Locale Data Repository (CLDR). As mentioned in the December 2022 
Quality Outreach newsletter [1], JDK 20 upgraded CLDR [2] to version 42 
[3], which was released in October 2022. This version includes a "more 
sophisticated handling of spaces" [4] that replaces regular spaces with 
non-breaking spaces (NBSP / `\u00A0`) or narrow non-breaking spaces 
(NNBSP / `\u202F`):
- in time formats between `a` and time
- in unit formats between {0} and unit
- in Cyrillic date formats before year marker such as `г`

Other noticeable changes include:
* " at " is no longer used for standard date/time format ’ [5]
* fix first day of week info for China (CN) [6]
* Japanese: Support numbers up to 9999京 [7]

As a consequence, production and test code that produces or parses 
locale-dependent strings like formatted dates and times may change 
behavior in potentially breaking ways (e.g. when a handcrafted datetime 
string with a regular space is parsed, but the parser now expects an 
NBSP or NNBSP). Issues can be hard to analyze because expected and 
actual strings look very similar or even identical in various text 
representations. To detect and fix these issues, make sure to use a text 
editor that displays different kinds of spaces differently.

If the required fixes can't be implemented when upgrading to JDK 20, 
consider using the JVM argument `-Djava.locale.providers=COMPAT` to use 
legacy locale data. Note that this limits some locale-related 
functionality and treat it as a temporary workaround, not a proper 
solution. Moreover, the `COMPAT` option will be eventually removed in 
the future.

It is also important to keep in mind that this kind of locale data 
evolves regularly so programs parsing/composing the locale data by 
themselves should be routinely checked with each JDK release.

[2] https://bugs.openjdk.org/browse/JDK-8284840
[3] https://cldr.unicode.org/index/downloads/cldr-42
[4] https://unicode-org.atlassian.net/browse/CLDR-14032
[5] https://unicode-org.atlassian.net/browse/CLDR-14831
[6] https://unicode-org.atlassian.net/browse/CLDR-11510
[7] https://unicode-org.atlassian.net/browse/CLDR-15966

## Heads-Up - JDK 21 - New network interface names on Windows

Network Names that the JDK assigns to network interfaces on Windows are 
changing in JDK 21 [8].

The JDK historically synthesized names for network interfaces on 
Windows. This has changed to use the names assigned by the Windows 
operating system. For example, the JDK may have historically assigned a 
name such as “eth0” for an ethernet interface and “lo” for the loopback. 
The equivalent names that Windows assigns may be names such as 
“ethernet_32768” and “loopback_0".

This change may impact code that does a lookup of network interfaces 
with the `NetworkInterace.getByName(String name)` method. It also may 
also be surprising to code that enumerates all network interfaces with 
the `NetworkInterfaces.networkInterfaces()` or 
`NetworkInterface.getNetworkInterfaces()` methods as the names of the 
network interfaces will look different to previous releases. Depending 
on configuration, it is possible that enumerating all network interfaces 
will enumerate network interfaces that weren’t previously enumerated 
because they didn’t have an Internet Protocol address assigned. The 
display name returned by `NetworkInterface::getDisplayName` has not 
changed so this should facilitate the identification of network 
interfaces when using Windows native tools.

[8] https://bugs.openjdk.org/browse/JDK-8303898

## JDK 20 General Availability

JDK 20, the reference implementation of Java 20, is now Generally 
Available [9]. The GA builds 36 are available [10], and are provided 
under the GNU General Public License v2, with the Classpath Exception. 
The Release Notes are available here [11] and the javadocs here [12].

This release includes 7 JEPs, all in various stages of incubation and 
- JEP 429: Scoped Values (Incubator)
- JEP 432: Record Patterns (2nd Preview)
- JEP 433: Pattern Matching for switch (4th Preview)
- JEP 434: Foreign Function & Memory API (2nd Preview)
- JEP 436: Virtual Threads (2nd Preview)
- JEP 437: Structured Concurrency (2nd Incubator)
along with hundreds of smaller enhancements and thousands of bug fixes.

Thank you to everyone who contributed to this release, including 
participants in this program who provided feedback on JDK 20.

[9] https://mail.openjdk.org/pipermail/jdk-dev/2023-March/007517.html
[10] https://jdk.java.net/20/
[11] https://jdk.java.net/20/release-notes
[12] https://docs.oracle.com/en/java/javase/20/docs/api/

## JavaFX 20 General Availability

Open-source builds of JavaFX 20 are now Generally Available [13], under 
the GNU General Public License, version 2, with the Classpath Exception.
The JavaFX runtime is delivered as an SDK and as a set of jmods for each 
platform. You can use the SDK to compile and run JavaFX applications. 
You can use the jmods with jlink to create a JDK that includes the 
JavaFX modules, and optionally, your modular application. JavaFX 20 is 
designed to work with JDK 20, but it is known to work with JDK 17 and 
later versions.

The Release Notes are available here [14], JavaFX 20 API javadocs are 
also available [15].

[13] https://jdk.java.net/javafx20/
[14] https://github.com/openjdk/jfx/blob/jfx20/doc-files/release-notes-20.md

## JDK 21 Early-Access builds

The latest early-access, i.e., builds 15 are available [16], and are 
provided under the GNU General Public License v2, with the Classpath 
The Release Notes are available here [17].

[16] https://jdk.java.net/21/
[17] https://jdk.java.net/21/release-notes

### Changes in recent builds that may be of interest:

JDK 21 build 15
- JDK-8303018: Unicode Emoji Properties
- JDK-8298469: Obsolete legacy parallel class loading workaround for 
non-parallel-capable class loaders
- JDK-8191565: Last-ditch Full GC should also move humongous objects
- JDK-8292818: replace 96-bit representation for field metadata with 
variable-sized streams
- JDK-8304303: implement VirtualThread class notifyJvmti methods as C2 
- JDK-8303648: Add String.indexOf(String str, int beginIndex, int endIndex)
- JDK-8304139: Add <init> and <clinit> method constants to ConstantDescs
- JDK-8015831: Add lint check for calling overridable methods from a 

JDK 21 build 14:
- JDK-8303410: Remove ContentSigner APIs and jarsigner -altsigner and 
-altsignerpath options
- JDK-8302659: Modernize Windows native code for NetworkInterface
- JDK-8298966: Deprecate JMX Subject Delegation and the method 
JMXConnector.getMBeanServerConnection(Subject) for removal.
- JDK-8294982: Implementation of Classfile API
- JDK-8303820: Simplify type metadata

JDK 21 build 13:
- JDK-8303413: (fs) Ignore polling interval sensitivity modifiers in 
- JDK-8303175: (fs) Deprecate 
com.sun.nio.file.SensitivityWatchEventModifier for removal
- JDK-8295425: Match the default priv exp length between SunPKCS11 and 
other JDK providers
- JDK-8303409: Add Windows AArch64 ABI support to the Foreign Function & 
Memory API
- JDK-8302590: Add String.indexOf(int ch, int fromIndex, int toIndex)

JDK 21 build 12:
- JDK-8301119: Support for GB18030-2022
- JDK-8026369: javac potentially ambiguous overload warning needs an 
improved scheme
- JDK-8293667: Align jlink's --compress option with jmod's --compress option
- JDK-8282319: java.util.Locale method to stream available Locales

JDK 21 build 11:
- JDK-8302385: Remove MetaspaceReclaimPolicy=none
- JDK-8300575: JVMTI support when using alternative virtual thread 
- JDK-8301992: Embed SymbolTable CHT node
- JDK-8301749: Tracking malloc pooled memory size

JDK 21 build 10:
- JDK-8301700: Increase the default TLS Diffie-Hellman group size from 
1024-bit to 2048-bit
- JDK-8301260: Add system property to toggle XML Signature secure 
validation mode
- JDK-8297632: InputStream.transferTo() method should specify what the 
return value should be when the number of bytes …
- JDK-8245654: Add Certigna Root CA
- JDK-8301819: Enable continuations code by default
- JDK-8300914: Allow `@` as an escape in documentation comments
- JDK-8225409: G1: Remove the Hot Card Cache

## JavaFX 21 Early-Access Builds

These are early access builds of the JavaFX 21 Runtime, built from 
openjdk/jfx [18]. It is intended to allow JavaFX application developers 
to build and test their applications with JavaFX 21 on JDK 21.

The latest builds 9 (2023/3/20) are now available [19] and are provided 
under the GNU General Public License, version 2, with the Classpath 
Please report feedback on the openjfx-dev mailing list [20].

[18] https://github.com/openjdk/jfx
[19] https://jdk.java.net/javafx21/
[20] http://mail.openjdk.org/mailman/listinfo/openjfx-dev

## New Generational ZGC Early-Access Builds

The latest builds 21-genzgc+5-33 (2023/3/9) are available [21]. These 
open-source binaries of Generational ZGC [22] are based on an incomplete 
version of JDK 21 and are provided under the GNU General Public License, 
version 2, with the Classpath Exception.
Please send feedback on the zgc-dev mailing list [23].

[21] https://jdk.java.net/genzgc/
[22] https://openjdk.org/jeps/439
[23] http://mail.openjdk.org/mailman/listinfo/zgc-dev

## Topics of Interest:

The Arrival of Java 20!

Video: Java First. Java Always. | Level Up Keynote

Video: Java 20 Unboxing - Inside Java Newscast

JDK 20 Security Enhancements

G1/Parallel/Serial GC improvements in JDK 20

Podcast: “Preview Features: A Look Back and A Look Ahead” with Alex Buckley

Video: Write performant Java code with the Vector API - JEP Café

Video: Data-Oriented Programming in Java

Video: ZGC - Java’s Highly Scalable Low-Latency Garbage Collector

Video: The Holy Grail of Java Performance - Inside Java Newscast

Video: Programmer's Guide to JDK Flight Recorder

Video: Foreign Function & Memory API Live

JEP targeted to JDK 21: 430: String Templates (Preview)

JEP targeted to JDK 21: 431: Sequenced Collections


Thanks for participating in the OpenJDK Quality Outreach program. And as 
always, if you find an issue, please let us know through the usual channels.


More information about the quality-discuss mailing list