Skip to content

Conversation

graalvmbot
Copy link
Collaborator

@graalvmbot graalvmbot commented Jun 28, 2024

Currently, exactly two JDK releases are supported: JDK Latest (currently 24) and JDK 21. All other version checks are not needed and cause confusion. Thus, this PR does the following:

  • replace JDK22OrEarlier with JDK21OrEarlier
  • replace JDK22OrLater with JDK23OrLater
  • rename JDK23OrLater to JDKLatest

JDKLatest is implemented in a way that we don't need to update the condition for every JDK version bump (boils down to JAVA_SPEC > 21).

There are also predicates for JDK 11 and JDK 17. Those are deprecated and unused, but kept for backwards compatibility reasons.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 28, 2024
@zapster zapster self-assigned this Jun 28, 2024
Comment on lines +32 to +33
* Denotes the latest supported JDK version. It corresponds to the highest key in the
* {@code JVMCI_MIN_VERSIONS} map in {@link jdk.graal.compiler.hotspot.JVMCIVersionCheck}.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it make sense to move this map in a package that is accessible here and actually reference the highest key instead of hardcoding the check to 21?

Copy link
Member

Choose a reason for hiding this comment

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

The package is accessible, it is just the field that is private. The LTS version change so seldomly that IMHO it is fine to have a few references to it.

@Override
public boolean getAsBoolean() {
return JavaVersionUtil.JAVA_SPEC <= 22;
return JavaVersionUtil.JAVA_SPEC > 21;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick: I understand that 21 is used here to avoid having to update the code with each STS JDK release, but this doesn't match the javadoc, nor represents the latest JDK.

Copy link
Member

Choose a reason for hiding this comment

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

From my perspective, that is just an implementation detail. 21 is the most stable version we have and it only changes once every few years.

@graalvmbot graalvmbot closed this Jul 3, 2024
@graalvmbot graalvmbot deleted the je/svm-cleanup-jdk-predicates-GR-54918 branch July 3, 2024 13:02
@graalvmbot graalvmbot merged commit b211b3c into master Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants