Skip to content

Commit

Permalink
hardcoded ClassFileConstants.JDK21
Browse files Browse the repository at this point in the history
To let it compile with older target platforms
  • Loading branch information
LorenzoBettini committed May 16, 2024
1 parent 6cfdc4f commit cc880a1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public void testToJdtClassFileConstant() {
assertEquals(ClassFileConstants.JDK10, JavaVersion.JAVA10.toJdtClassFileConstant());
assertEquals(ClassFileConstants.JDK11, JavaVersion.JAVA11.toJdtClassFileConstant());
assertEquals(ClassFileConstants.JDK17, JavaVersion.JAVA17.toJdtClassFileConstant());
assertEquals(ClassFileConstants.JDK21, JavaVersion.JAVA21.toJdtClassFileConstant());
// until we use the newer JDT as minimal requirement, we cannot refer to ClassFileConstants.JDK21
// or the test won't compile with older target platforms
// assertEquals(ClassFileConstants.JDK21, JavaVersion.JAVA21.toJdtClassFileConstant());
assertEquals(4259840, JavaVersion.JAVA21.toJdtClassFileConstant());
// try {
// long value = ClassFileConstants.class.getField("JDK17").getLong(null);
// assertEquals(value, JavaVersion.JAVA17.toJdtClassFileConstant());
Expand Down

0 comments on commit cc880a1

Please sign in to comment.