Skip to content

Conversation

@leerho
Copy link
Member

@leerho leerho commented Dec 6, 2024

Upgrade much of the API that was based on Java 17 to use new Java 21 FFM API, which is in "preview" mode.

Also was able to remove some duplicated code.

Updated POM, as well as the GH Actions workflows.

This PR upgrades the Main branch to Java 21.

Note: I found a bug in Temurin Java 21.0.2 JDK and had to upgrade to Temurin Java 21.0.2+11 release.

frankgrimes97 and others added 16 commits November 18, 2024 16:11
The project's minimum Java release requirements moved from Java 17 to Java 21.

Package imports changed from `jdk.incubator.foreign` -> `java.lang.foreign`
and a number of API changes were required.
Notably, the new `java.lang.foreign.Arena` class needs to be exposed when allocating
native memory regions as it controls the scope and lifecycle of allocations.

Respective API docs are as follows:
 - https://docs.oracle.com/en/java/javase/17/docs/api/jdk.incubator.foreign/jdk/incubator/foreign/package-summary.html
 - https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/foreign/package-summary.html
This is to try to address file permission errors seen in some GitHub Action
Workflow runs on Windows:
  "[INFO]
   Error:  Failures:
   Error:    LeafImplTest.checkMapLeafs:118 » AccessDenied TestFile2.bin
   Error:    SpecificLeafTest.checkMapLeafs:108 » AccessDenied TestFile2.bin"
This is to try to address following errors seen in some GitHub Action
Workflow runs on Windows:
  "Warning:  Files with unapproved licenses:
  force_original.txt"
Mostly Checkstyle issues
Had to upgrade my Java 21 JDK to Temurin 21.0.5+11 due to a discovered
bug in Java.
README.md Outdated
### *NOTE: The DataSketches Java Memory Component is not thread-safe.*
### *NOTES:*
* The DataSketches Java Memory Component is not thread-safe.
* I recommend Eclipse Adoptium/Temurin 21.0.5+11 or later as earlier releases of 21 have bugs that affect this product.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first person recommendation looks strange

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

long v = wbuf.getLong();
assertEquals(v, i);
}
for (int i = 0; i < n; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happened to alignment here and below? tabs used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! this is weird. No tabs used. Not sure how this happened. We have had two folks editing these files recently, perhaps they used a different indention scheme.

wbuf.getLongArray(arr2, 0, n);
for (int i = 0; i < n; i++) {
assertEquals(arr2[i], i);
wbuf.putLongArray(arr, 0, n);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like some problem with alignment all over the place

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This occurred in a bunch of files. I went through all of them and I think it is OK now.

Copy link
Contributor

@AlexanderSaydakov AlexanderSaydakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see some formatting problems, but I don't think they should stop this effort

@leerho leerho merged commit 3350ab9 into main Dec 9, 2024
4 checks passed
@leerho leerho deleted the frank_grimes_java-21-ffm branch December 9, 2024 22:57
@leerho leerho restored the frank_grimes_java-21-ffm branch December 9, 2024 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants