JDK 22 RDP2 & Deprecate sun.misc.Unsafe Memory-Access Methods…
by David Delabassee
Greetings!
We are starting 2024 with JDK 22 as it has just entered Rampdown Phase 2 [1]. And with the initial JDK 22 Release Candidates now less than 2 weeks away (Feb. 8th) [2], it is time to shift our attention to JDK 23.
After multiple rounds of incubations and preview, the Foreign Function & Memory API is becoming standard and permanent in JDK 22. If we put its 'Function' angle aside, this API also offers a standard and secure way to access off-heap API. And that brings us to the …
[View More]heads-up below 'Deprecate the memory-access methods in sun.misc.Unsafe for removal in a future release' as developers still using sun.misc.Unsafe for accessing memory are strongly encouraged to start preparing their plans to migrate away from those unsafe methods.
[1] https://mail.openjdk.org/pipermail/jdk-dev/2024-January/008675.html
[2] https://openjdk.org/projects/jdk/22/
## Heads-up: Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal in a Future Release
The effort focused on enforcing the integrity of the Java platform [3] continues! The next phase in that long but important initiative will most likely target the sun.misc.Unsafe API used for accessing memory. Those methods alone represent 79 methods out of the 87 sun.misc.Unsafe methods!
This draft JEP [4] outlines the plan to deprecate for removal the sun.misc.Unsafe Memory-Access methods, the reasons, and the standard alternatives. As the draft plan suggests, the first step will be to deprecate all memory-access methods (on-heap, off-heap, and bimodal) for removal. This will cause compile-time deprecation warnings for code that refers to the methods, alerting library developers to their forthcoming removal. In addition, a new command-line option will allow users to receive runtime warnings when those methods are used. This command-line will help users to assess if their codebase uses those unsafe API to access memory. It should be mentioned that other tools such as JFR and jdeprscan can also be used to detect the use of those deprecated APIs.
Library developers are strongly encouraged to migrate from sun.misc.Unsafe to the supported replacements, so that applications can migrate smoothly to modern JDKs. The initial step will be to conduct investigations to understand if, how, and where sun.misc.Unsafe methods are used to access memory.
[3] https://openjdk.org/jeps/8305968
[4] https://openjdk.org/jeps/8323072
## Heads-up: Java Array Element Alignment - Weakening of Some Methods Guarantees ?
Some methods make promises about Java array element alignment that are too strong. There are some ongoing reflexions to change the implementation (and the specification) of `MethodHandles::byteArrayViewVarHandle`, `MethodHandles::byteBufferViewVarHandle`, `ByteBuffer::alignedSlice`, and `ByteBuffer::alignmentOffset` to weaken the guarantees they make about the alignment of Java array elements, in order to bring them in line with the guarantees made by an arbitrary JVM implementation.
For more details, make sure to check JDK-8320247 [5] and the related PR [6] but in a nutshell, the new behaviour would be :
- The `VarHandle` returned by `MethodHandles::byteArrayViewVarHandle` would only support `get` and `set` methods, and all other access methods would throw an exception.
- The `VarHandle` returned by `MethodHandles::byteBufferViewHandle` would only support the `get` and `set` access methods when a heap buffer is used, and all other access methods would throw an exception when used with a heap buffer. Direct byte buffers will continue to work the same way.
- The `ByteBuffer::alignmentOffset` and `ByteBuffer::alignedSlice` methods would throw an exception if the buffer is a heap buffer, and the given `unitSize` is greater than 1.
If you have relevant feedback about this potential change, please make sure to bring it to the core-libs-dev mailing list [7], or comment on the PR [6].
[5] https://bugs.openjdk.org/browse/JDK-8320247
[6] https://github.com/openjdk/jdk/pull/16681
[7] https://mail.openjdk.org/pipermail/core-libs-dev/
## JDK 22 Early-Access Builds
JDK 22 Early-Access builds 33 are now available [8], and are provided under the GNU General Public License v2, with the Classpath Exception. The Release Notes [9] and the javadocs [10] are also available.
### Changes in recent JDK 22 builds that may be of interest:
- JDK-8320597: RSA signature verification fails on signed data that does not encode params correctly [Reported by Apache POI]
- JDK-8322214: Return value of XMLInputFactory.getProperty() changed from boolean to String in JDK 22 early access builds [Reported by Apache POI]
- JDK-8322725: (tz) Update Timezone Data to 2023d
- JDK-8321480: ISO 4217 Amendment 176 Update
- JDK-8314468: Improve Compiler loops
- JDK-8314295: Enhance verification of verifier
- JDK-8316976: Improve signature handling
- JDK-8317547: Enhance TLS connection support
- JDK-8318971: Better Error Handling for Jar Tool When Processing Non-existent Files
- JDK-8323659: LinkedTransferQueue add and put methods call overridable offer
Note: A complete list of changes can be found here [11].
[8] https://jdk.java.net/22/
[9] https://jdk.java.net/22/release-notes
[10] https://download.java.net/java/early_access/jdk22/docs/api/
[11] https://github.com/openjdk/jdk/compare/jdk-22+27...jdk-22+33
## JDK 23 Early-Access builds
JDK 23 Early-Access builds 7 are available [12] for testing. These EA builds are provided under the GNU General Public License v2, with the Classpath Exception. The Release Notes [13] are also available.
### Changes in recent JDK 23 builds that may be of interest:
- JDK-8320597: RSA signature verification fails on signed data that does not encode params correctly [Reported by Apache POI]
- JDK-8322214: Return value of XMLInputFactory.getProperty() changed from boolean to String in JDK 22 early access builds [Reported by Apache POI]
- JDK-8321545: Override toString() for Format subclasses
- JDK-8322366: Add IEEE rounding mode corruption check to JNI checks
- JDK-8322383: G1: Only preserve marks on objects that are actually moved
- JDK-8275338: Add JFR events for notable serialization situations
- JDK-8320458: Improve structural navigation in API documentation
- JDK-8320786: Remove ThreadGroup.stop
- JDK-8320532: Remove Thread/ThreadGroup suspend/resume
- JDK-8312150: Remove -Xnoagent option
- JDK-8322829: Refactor nioBlocker to avoid blocking while holding Thread's interrupt lock
- JDK-8322725: (tz) Update Timezone Data to 2023d
- JDK-8321480: ISO 4217 Amendment 176 Update
- JDK-8318971: Better Error Handling for Jar Tool When Processing Non-existent Files
- JDK-8321594: NativeThreadSet should use placeholder for virtual threads
- JDK-8321940: Improve CDSHeapVerifier in handling of interned strings
- JDK-8321802: (zipfs) Add validation of incorrect LOC signature in ZipFileSystem
- JDK-8322841: Parallel: Remove unused using-declaration in MutableNUMASpace
- JDK-8319626: Override toString() for ZipFile
- JDK-8322878: Including sealing information Class.toGenericString()
Note: A more exhaustive changes list can be found here [14].
[12] https://jdk.java.net/23/
[13] https://jdk.java.net/23/release-notes
[14] https://github.com/openjdk/jdk/compare/jdk-23+1...jdk-23+7
## JavaFX 22 & 23 Early-Access Builds
These are early access builds of the JavaFX 22 Runtime built from openjdk/jfx [14]. These builds enable JavaFX application developers to build and test their applications with JavaFX 22 on JDK 22. Although JavaFX 22 is designed to work with JDK 22, it is also known to work with JDK 17 and later versions.
The latest early access builds of JavaFX 22 Builds 26 (2024/1/20) are available [15], under the GNU General Public License, version 2, with the Classpath Exception. JavaFX 22 API Javadocs [16] are also available.
The first early access builds (2024/1/19) of JavaFX 23 are now also available [17].
[14] https://github.com/openjdk/jfx
[15] https://jdk.java.net/javafx22/
[16] https://download.java.net/java/early_access/javafx22/docs/api/overview-su...
[17] https://jdk.java.net/javafx23/
## Topics of Interest
- Podcast “The Panama Effect” with Jorn Vernee
https://inside.java/2024/01/08/podcast-032/
- Java's Plans for 2024 - Inside Java Newscast
https://inside.java/2024/01/18/newscast-61/
- Java 22 Unpacking - Inside Java Newscast
https://inside.java/2023/12/07/newscast-59/
- Java Highlights of 2023 - Inside Java Newscast
https://inside.java/2023/12/21/newscast-60/
- JDK 21: The GCs keep getting better
https://kstefanj.github.io/2023/12/13/jdk-21-the-gcs-keep-getting-better....
- Java SE Security Developer’s Guide
https://docs.oracle.com/en/java/javase/21/security/index.html#Java-Platfo...
- Another VS Code Extension for Java
https://inside.java/2023/12/03/java-vscode-extension/
## January 2024 Critical Patch Update Released
As part of the January 2024 CPU, Oracle released OpenJDK 21.0.2, JDK 21.0.2 LTS, JDK 17.0.10 LTS, 11.0.22 LTS, 8u401, and 8u401-perf.
~
As usual, let us know if you find any quirks while testing your project(s) with the latest JDK early-access builds.
--David
[View Less]
1 year, 2 months
WildFly 31 is released
by Brian Stansberry
I'm pleased to announce that WildFly 31.0.0.Final is now available at
https://www.wildfly.org/downloads/.
There's a lot to be happy about in what we've accomplished in the 31 cycle;
I suspect my announcement post at
https://www.wildfly.org/news/2024/01/25/WildFly31-Released/ is my longest
ever. I think it's great how much we've gotten done outside of the main
server code base.
Big thanks in particular to:
Eduardo Martins -- for driving the huge quickstarts enhancements efforts,
and a bunch …
[View More]of other QS improvements.
Paul Ferraro -- for the stability level work, and the new WildFly Core
'subsystem' and 'service' modules.
Jean Francois Denise and Kabir Khan -- for WildFly Glow.
Harald Pehl, Jeff Mesnil, Farah Juma, Ashwin Mehendale, Prarthona Paul,
Wolfgang Knauf for the work on Getting Started and the user guides.
And to all of you for the many other improvements I'm not mentioning here
-- and for making WildFly such a vibrant project.
Best regards,
Brian Stansberry
Principal Architect, Red Hat JBoss EAP
WildFly Project Lead
He/Him/His
[View Less]
1 year, 2 months
Triage of 'Critical' WFLY and WFCORE issues
by Brian Stansberry
Can we do some housekeeping of the open 'Critical' issues in WFCORE and
WFLY?
1) Can the assignees and relevant component leads go through them and
change the priority for any that aren't truly critical?
2) Simultaneously, we can have a discussion here of what we want 'Critical'
to mean going forward. My 2 cents is it needs to have more of a meaning of
'Priority' (which is what the field is), i.e. it gives a clue as to what
needs to be worked on next. And less of a meaning of 'subjective
…
[View More]importance'.
My sense is right now we have a lot of things where 'Critical' means
someone thought it was 'Important' but there is no corresponding priority
to get it done. At some point that calls into question whether it's truly
critical.
For 1) above I'm not asking that we have a big discussion and then people
can review issues. I'm looking for a quick triage to clean up things where
the experts decided 'nah, that's not really critical.' Just try and get rid
of some noise so it's easier for new Critical items to stand out.
Also, in a preview of coming attractions, I expect later this quarter we'll
kick off a more general JIRA housekeeping initiative. This is something
that Alessio Soldano suggested last year, and it's sorely needed, but I
didn't have time to get anything going. But it's a New Year, and my New
Year's Resolution is to tidy this up.
Best regards,
Brian Stansberry
Principal Architect, Red Hat JBoss EAP
WildFly Project Lead
He/Him/His
[View Less]
1 year, 2 months