aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2024-02-19 13:19:49 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2024-02-19 13:19:49 +0700
commitf3450726d21518bd51deaf46629682d328bb3338 (patch)
tree7dfb501fe253bd06ed577fe7317c81eeb9507908 /tests/src
parent198957fd26d1e5cd347c0c1c3a0c9100295af4cf (diff)
downloadaspectj-f3450726d21518bd51deaf46629682d328bb3338.tar.gz
aspectj-f3450726d21518bd51deaf46629682d328bb3338.zip
Remove most MINOR_*, MINOR_* BCEL class file versions
in favour of Constants.ClassFileVersion.of(int, int). The few ones retained are used from production code, the vast majority of removed ones only from test code. This gets rid of yet another 'AspectJ_JDK_Update' tag. One less place to check and update with each newly supported Java version. :-) Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc160/SanityTests.java4
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc190/SanityTests19.java4
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc191/SanityTestsJava10.java4
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1919/Java19PreviewFeaturesTests.java11
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1919/SanityTestsJava19.java4
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc192/SanityTestsJava11.java4
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1920/Java20PreviewFeaturesTests.java15
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1920/SanityTestsJava20.java4
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1921/Ajc1921TestsJava.java14
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1921/SanityTestsJava21.java4
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc195/SanityTestsJava13.java4
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196Tests.java6
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc196/Java14PreviewFeaturesTests.java3
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc196/SanityTestsJava14.java4
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc197/Ajc197TestsJava.java14
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc197/Java16PreviewFeaturesTests.java9
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc197/SanityTestsJava15.java4
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc197/SanityTestsJava16.java4
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc198/Ajc198TestsJava.java8
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc198/CompileWithReleaseTests.java2
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc198/Java17PreviewFeaturesTests.java11
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc198/SanityTestsJava17.java4
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java17
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc199/SanityTestsJava18.java4
24 files changed, 84 insertions, 78 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc160/SanityTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc160/SanityTests.java
index 4a7c39a01..619114dfa 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc160/SanityTests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc160/SanityTests.java
@@ -26,7 +26,7 @@ import junit.framework.Test;
* rather than executing them.
*/
public class SanityTests extends org.aspectj.testing.XMLBasedAjcTestCase {
- public static final int bytecode_version_for_JDK_level = Constants.MAJOR_1_6;
+ public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(6).MAJOR;
// Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
public void testSimpleJava_A() {
@@ -83,7 +83,7 @@ public class SanityTests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testVersionCorrect4() throws ClassNotFoundException {// check it is 49.0 when -1.5 is specified
runTest("simple - m");
- checkVersion("A", Constants.MAJOR_1_5, 0);
+ checkVersion("A", Constants.ClassFileVersion.of(5).MAJOR, 0);
}
// Check the stackmap stuff appears for methods in a Java6 file
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc190/SanityTests19.java b/tests/src/test/java/org/aspectj/systemtest/ajc190/SanityTests19.java
index ac5b109e6..38678b750 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc190/SanityTests19.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc190/SanityTests19.java
@@ -21,7 +21,7 @@ import junit.framework.Test;
* to check code generation and modification with that version specified.
*/
public class SanityTests19 extends org.aspectj.testing.XMLBasedAjcTestCase {
- public static final int bytecode_version_for_JDK_level = Constants.MAJOR_1_9;
+ public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(9).MAJOR;
// Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
public void testSimpleJava_A() {
@@ -73,7 +73,7 @@ public class SanityTests19 extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testVersionCorrect4() throws ClassNotFoundException { // check it is 49.0 when -1.5 is specified
runTest("simple - m");
- checkVersion("A", Constants.MAJOR_1_5, 0);
+ checkVersion("A", Constants.ClassFileVersion.of(5).MAJOR, 0);
}
// Check the stackmap stuff appears for methods in a Java6 file
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc191/SanityTestsJava10.java b/tests/src/test/java/org/aspectj/systemtest/ajc191/SanityTestsJava10.java
index 5d5a04564..79c6ba1ae 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc191/SanityTestsJava10.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc191/SanityTestsJava10.java
@@ -20,7 +20,7 @@ import junit.framework.Test;
* @author Andy Clement
*/
public class SanityTestsJava10 extends org.aspectj.testing.XMLBasedAjcTestCase {
- public static final int bytecode_version_for_JDK_level = Constants.MAJOR_10;
+ public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(10).MAJOR;
// Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
public void testSimpleJava_A() {
@@ -71,7 +71,7 @@ public class SanityTestsJava10 extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testVersionCorrect4() throws ClassNotFoundException { // check it is 49.0 when -1.5 is specified
runTest("simple - m");
- checkVersion("A", Constants.MAJOR_1_5, 0);
+ checkVersion("A", Constants.ClassFileVersion.of(5).MAJOR, 0);
}
// ///////////////////////////////////////
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1919/Java19PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1919/Java19PreviewFeaturesTests.java
index b4dc12f39..1207f5cc6 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc1919/Java19PreviewFeaturesTests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1919/Java19PreviewFeaturesTests.java
@@ -16,18 +16,19 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava19Only;
* @author Alexander Kriegisch
*/
public class Java19PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava19Only {
+ private static final Constants.ClassFileVersion classFileVersion = Constants.ClassFileVersion.of(19);
public void testSwitchPatternMatchingPreview3Java() {
runTest("switch pattern matching preview 3 java");
- checkVersion("SwitchPatternPreview3OK", Constants.MAJOR_19, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("SwitchPatternPreview3OK", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public void testSwitchPatternMatchingPreview3Aspect() {
runTest("switch pattern matching preview 3 aspect");
- checkVersion("SwitchPatternPreview3Aspect", Constants.MAJOR_19, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("Application", Constants.MAJOR_19, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("Shape", Constants.MAJOR_19, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("S", Constants.MAJOR_19, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("SwitchPatternPreview3Aspect", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("Application", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("Shape", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("S", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public void testSwitchPatternMatchingCaseLabelDominatedByPrecedingError() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1919/SanityTestsJava19.java b/tests/src/test/java/org/aspectj/systemtest/ajc1919/SanityTestsJava19.java
index a8a3826ea..9f70c3ff2 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc1919/SanityTestsJava19.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1919/SanityTestsJava19.java
@@ -21,7 +21,7 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava19OrLater;
*/
public class SanityTestsJava19 extends XMLBasedAjcTestCaseForJava19OrLater {
- public static final int bytecode_version_for_JDK_level = Constants.MAJOR_19;
+ public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(19).MAJOR;
// Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
public void testSimpleJava_A() {
@@ -73,7 +73,7 @@ public class SanityTestsJava19 extends XMLBasedAjcTestCaseForJava19OrLater {
public void testVersionCorrect4() {
runTest("simple - m");
// Must be 49.0 when -1.5 is specified
- checkVersion("A", Constants.MAJOR_1_5, 0);
+ checkVersion("A", Constants.ClassFileVersion.of(5).MAJOR, 0);
}
public static Test suite() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc192/SanityTestsJava11.java b/tests/src/test/java/org/aspectj/systemtest/ajc192/SanityTestsJava11.java
index b0f2cdb67..e0b9034f8 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc192/SanityTestsJava11.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc192/SanityTestsJava11.java
@@ -21,7 +21,7 @@ import junit.framework.Test;
* @author Andy Clement
*/
public class SanityTestsJava11 extends XMLBasedAjcTestCaseForJava11OrLater {
- public static final int bytecode_version_for_JDK_level = Constants.MAJOR_11;
+ public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(11).MAJOR;
// Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
public void testSimpleJava_A() {
@@ -72,7 +72,7 @@ public class SanityTestsJava11 extends XMLBasedAjcTestCaseForJava11OrLater {
public void testVersionCorrect4() throws ClassNotFoundException { // check it is 49.0 when -1.5 is specified
runTest("simple - m");
- checkVersion("A", Constants.MAJOR_1_5, 0);
+ checkVersion("A", Constants.ClassFileVersion.of(5).MAJOR, 0);
}
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1920/Java20PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Java20PreviewFeaturesTests.java
index 89a0a61c6..1a305bce1 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc1920/Java20PreviewFeaturesTests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1920/Java20PreviewFeaturesTests.java
@@ -16,10 +16,11 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava20Only;
* @author Alexander Kriegisch
*/
public class Java20PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava20Only {
+ private static final Constants.ClassFileVersion classFileVersion = Constants.ClassFileVersion.of(20);
public void testSwitchPatternMatchingPreview4Java() {
runTest("switch pattern matching preview 4 java");
- checkVersion("SwitchPatternPreview4OK", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("SwitchPatternPreview4OK", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public void testSwitchPatternMatchingPreview4Error() {
@@ -28,10 +29,10 @@ public class Java20PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava20Only
public void testSwitchPatternMatchingPreview3Aspect() {
runTest("switch pattern matching preview 3 aspect");
- checkVersion("SwitchPatternPreview3Aspect", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("Application", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("Shape", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("S", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("SwitchPatternPreview3Aspect", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("Application", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("Shape", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("S", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public void testSwitchPatternMatchingCaseLabelDominatedByPrecedingError() {
@@ -54,8 +55,8 @@ public class Java20PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava20Only
public void testRecordPatternsPreview1Error() {
// https://github.com/eclipse-jdt/eclipse.jdt.core/issues/450 (fixed for preview 2 in Eclipse 2023-03, 4.27)
runTest("record patterns error");
- checkVersion("RecordPatternsPreview1Error", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("Box", Constants.MAJOR_20, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("RecordPatternsPreview1Error", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("Box", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public void testRecordPatternsPreview1ExhaustivenessOK1() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1920/SanityTestsJava20.java b/tests/src/test/java/org/aspectj/systemtest/ajc1920/SanityTestsJava20.java
index 88b9670e9..6cd0fd6b7 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc1920/SanityTestsJava20.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1920/SanityTestsJava20.java
@@ -21,7 +21,7 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava20OrLater;
*/
public class SanityTestsJava20 extends XMLBasedAjcTestCaseForJava20OrLater {
- public static final int bytecode_version_for_JDK_level = Constants.MAJOR_20;
+ public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(20).MAJOR;
// Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
public void testSimpleJava_A() {
@@ -73,7 +73,7 @@ public class SanityTestsJava20 extends XMLBasedAjcTestCaseForJava20OrLater {
public void testVersionCorrect4() {
runTest("simple - m");
// Must be 49.0 when -1.5 is specified
- checkVersion("A", Constants.MAJOR_1_5, 0);
+ checkVersion("A", Constants.ClassFileVersion.of(5).MAJOR, 0);
}
public static Test suite() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1921/Ajc1921TestsJava.java b/tests/src/test/java/org/aspectj/systemtest/ajc1921/Ajc1921TestsJava.java
index b0eaf3939..466135dc2 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc1921/Ajc1921TestsJava.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1921/Ajc1921TestsJava.java
@@ -19,7 +19,7 @@ public class Ajc1921TestsJava extends XMLBasedAjcTestCaseForJava21OrLater {
public void testSwitchPatternMatchingPreview4Java() {
runTest("switch pattern matching preview 4 java");
- checkVersion("SwitchPatternPreview4OK", Constants.MAJOR_21, Constants.MINOR_21);
+ checkVersion("SwitchPatternPreview4OK", Constants.ClassFileVersion.of(21).MAJOR, Constants.ClassFileVersion.of(21).MINOR);
}
public void testSwitchPatternMatchingPreview4Error() {
@@ -28,10 +28,10 @@ public class Ajc1921TestsJava extends XMLBasedAjcTestCaseForJava21OrLater {
public void testSwitchPatternMatchingPreview3Aspect() {
runTest("switch pattern matching preview 3 aspect");
- checkVersion("SwitchPatternPreview3Aspect", Constants.MAJOR_21, Constants.MINOR_21);
- checkVersion("Application", Constants.MAJOR_21, Constants.MINOR_21);
- checkVersion("Shape", Constants.MAJOR_21, Constants.MINOR_21);
- checkVersion("S", Constants.MAJOR_21, Constants.MINOR_21);
+ checkVersion("SwitchPatternPreview3Aspect", Constants.ClassFileVersion.of(21).MAJOR, Constants.ClassFileVersion.of(21).MINOR);
+ checkVersion("Application", Constants.ClassFileVersion.of(21).MAJOR, Constants.ClassFileVersion.of(21).MINOR);
+ checkVersion("Shape", Constants.ClassFileVersion.of(21).MAJOR, Constants.ClassFileVersion.of(21).MINOR);
+ checkVersion("S", Constants.ClassFileVersion.of(21).MAJOR, Constants.ClassFileVersion.of(21).MINOR);
}
public void testSwitchPatternMatchingCaseLabelDominatedByPrecedingError() {
@@ -54,8 +54,8 @@ public class Ajc1921TestsJava extends XMLBasedAjcTestCaseForJava21OrLater {
public void testRecordPatternsPreview1Error() {
// https://github.com/eclipse-jdt/eclipse.jdt.core/issues/450 (fixed for preview 2 in Eclipse 2023-03, 4.27)
runTest("record patterns error");
- checkVersion("RecordPatternsPreview1Error", Constants.MAJOR_21, Constants.MINOR_21);
- checkVersion("Box", Constants.MAJOR_21, Constants.MINOR_21);
+ checkVersion("RecordPatternsPreview1Error", Constants.ClassFileVersion.of(21).MAJOR, Constants.ClassFileVersion.of(21).MINOR);
+ checkVersion("Box", Constants.ClassFileVersion.of(21).MAJOR, Constants.ClassFileVersion.of(21).MINOR);
}
public void testRecordPatternsPreview1ExhaustivenessOK1() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1921/SanityTestsJava21.java b/tests/src/test/java/org/aspectj/systemtest/ajc1921/SanityTestsJava21.java
index ed2216fdb..2f4810e4e 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc1921/SanityTestsJava21.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1921/SanityTestsJava21.java
@@ -21,7 +21,7 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava21OrLater;
*/
public class SanityTestsJava21 extends XMLBasedAjcTestCaseForJava21OrLater {
- public static final int bytecode_version_for_JDK_level = Constants.MAJOR_21;
+ public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(21).MAJOR;
// Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
public void testSimpleJava_A() {
@@ -73,7 +73,7 @@ public class SanityTestsJava21 extends XMLBasedAjcTestCaseForJava21OrLater {
public void testVersionCorrect4() {
runTest("simple - m");
// Must be 49.0 when -1.5 is specified
- checkVersion("A", Constants.MAJOR_1_5, 0);
+ checkVersion("A", Constants.ClassFileVersion.of(5).MAJOR, 0);
}
public static Test suite() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc195/SanityTestsJava13.java b/tests/src/test/java/org/aspectj/systemtest/ajc195/SanityTestsJava13.java
index 54397cf2f..34901eb00 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc195/SanityTestsJava13.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc195/SanityTestsJava13.java
@@ -22,7 +22,7 @@ import junit.framework.Test;
*/
public class SanityTestsJava13 extends XMLBasedAjcTestCaseForJava13OrLater {
- public static final int bytecode_version_for_JDK_level = Constants.MAJOR_13;
+ public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(13).MAJOR;
// Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
public void testSimpleJava_A() {
@@ -73,7 +73,7 @@ public class SanityTestsJava13 extends XMLBasedAjcTestCaseForJava13OrLater {
public void testVersionCorrect4() throws ClassNotFoundException { // check it is 49.0 when -1.5 is specified
runTest("simple - m");
- checkVersion("A", Constants.MAJOR_1_5, 0);
+ checkVersion("A", Constants.ClassFileVersion.of(5).MAJOR, 0);
}
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196Tests.java
index 1669f7956..5659b2931 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196Tests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196Tests.java
@@ -24,17 +24,17 @@ public class Ajc196Tests extends XMLBasedAjcTestCaseForJava14OrLater {
public void testSwitch1() {
runTest("switch 1");
- checkVersion("Switch1", Constants.MAJOR_14, 0);
+ checkVersion("Switch1", Constants.ClassFileVersion.of(14).MAJOR, 0);
}
public void testSwitch2() {
runTest("switch 2");
- checkVersion("Switch2", Constants.MAJOR_14, 0);
+ checkVersion("Switch2", Constants.ClassFileVersion.of(14).MAJOR, 0);
}
public void testSwitch3() {
runTest("switch 3");
- checkVersion("Switch3", Constants.MAJOR_14, 0);
+ checkVersion("Switch3", Constants.ClassFileVersion.of(14).MAJOR, 0);
}
public static Test suite() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc196/Java14PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc196/Java14PreviewFeaturesTests.java
index 6c31f0af2..24b02101e 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc196/Java14PreviewFeaturesTests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc196/Java14PreviewFeaturesTests.java
@@ -17,10 +17,11 @@ import junit.framework.Test;
* @author Alexander Kriegisch
*/
public class Java14PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava14Only {
+ private static final Constants.ClassFileVersion classFileVersion = Constants.ClassFileVersion.of(14);
public void testRecords() {
runTest("simple record");
- checkVersion("Person", Constants.MAJOR_14, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("Person", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public void testRecords2() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc196/SanityTestsJava14.java b/tests/src/test/java/org/aspectj/systemtest/ajc196/SanityTestsJava14.java
index 960ba4420..13094e048 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc196/SanityTestsJava14.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc196/SanityTestsJava14.java
@@ -22,7 +22,7 @@ import junit.framework.Test;
*/
public class SanityTestsJava14 extends XMLBasedAjcTestCaseForJava14OrLater {
- public static final int bytecode_version_for_JDK_level = Constants.MAJOR_14;
+ public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(14).MAJOR;
// Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
public void testSimpleJava_A() {
@@ -74,7 +74,7 @@ public class SanityTestsJava14 extends XMLBasedAjcTestCaseForJava14OrLater {
public void testVersionCorrect4() {
runTest("simple - m");
// Must be 49.0 when -1.5 is specified
- checkVersion("A", Constants.MAJOR_1_5, 0);
+ checkVersion("A", Constants.ClassFileVersion.of(5).MAJOR, 0);
}
public static Test suite() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc197/Ajc197TestsJava.java b/tests/src/test/java/org/aspectj/systemtest/ajc197/Ajc197TestsJava.java
index 5e18926fc..8a1f794f4 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc197/Ajc197TestsJava.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc197/Ajc197TestsJava.java
@@ -19,37 +19,37 @@ public class Ajc197TestsJava extends XMLBasedAjcTestCaseForJava16OrLater {
public void testHiddenClass() {
runTest("hidden class");
- checkVersion("HiddenClassDemo", Constants.MAJOR_16, Constants.MINOR_16);
+ checkVersion("HiddenClassDemo", Constants.ClassFileVersion.of(16).MAJOR, Constants.ClassFileVersion.of(16).MINOR);
}
public void testTextBlock1() {
runTest("textblock 1");
- checkVersion("Code", Constants.MAJOR_16, Constants.MINOR_16);
+ checkVersion("Code", Constants.ClassFileVersion.of(16).MAJOR, Constants.ClassFileVersion.of(16).MINOR);
}
public void testTextBlock2() {
runTest("textblock 2");
- checkVersion("Code2", Constants.MAJOR_16, Constants.MINOR_16);
+ checkVersion("Code2", Constants.ClassFileVersion.of(16).MAJOR, Constants.ClassFileVersion.of(16).MINOR);
}
public void testRecords() {
runTest("simple record");
- checkVersion("Person", Constants.MAJOR_16, Constants.MINOR_16);
+ checkVersion("Person", Constants.ClassFileVersion.of(16).MAJOR, Constants.ClassFileVersion.of(16).MINOR);
}
public void testRecords2() {
runTest("using a record");
- checkVersion("UsingPersonRecord", Constants.MAJOR_16, Constants.MINOR_16);
+ checkVersion("UsingPersonRecord", Constants.ClassFileVersion.of(16).MAJOR, Constants.ClassFileVersion.of(16).MINOR);
}
public void testAdvisingRecords() {
runTest("advising records");
- checkVersion("TraceRecordComponents", Constants.MAJOR_16, Constants.MINOR_16);
+ checkVersion("TraceRecordComponents", Constants.ClassFileVersion.of(16).MAJOR, Constants.ClassFileVersion.of(16).MINOR);
}
public void testInstanceofPatterns() {
runTest("instanceof patterns");
- checkVersion("Jep305", Constants.MAJOR_16, Constants.MINOR_16);
+ checkVersion("Jep305", Constants.ClassFileVersion.of(16).MAJOR, Constants.ClassFileVersion.of(16).MINOR);
}
public static Test suite() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc197/Java16PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc197/Java16PreviewFeaturesTests.java
index dbcbcf06a..f2c04e08c 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc197/Java16PreviewFeaturesTests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc197/Java16PreviewFeaturesTests.java
@@ -16,21 +16,22 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava16Only;
* @author Alexander Kriegisch
*/
public class Java16PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava16Only {
+ private static final Constants.ClassFileVersion classFileVersion = Constants.ClassFileVersion.of(16);
public void testSealedClassWithLegalSubclasses() {
runTest("sealed class with legal subclasses");
- checkVersion("Employee", Constants.MAJOR_16, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("Manager", Constants.MAJOR_16, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("Employee", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("Manager", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public void testSealedClassWithIllegalSubclass() {
runTest("sealed class with illegal subclass");
- checkVersion("Person", Constants.MAJOR_16, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("Person", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public void testWeaveSealedClass() {
runTest("weave sealed class");
- checkVersion("PersonAspect", Constants.MAJOR_16, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("PersonAspect", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public static Test suite() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc197/SanityTestsJava15.java b/tests/src/test/java/org/aspectj/systemtest/ajc197/SanityTestsJava15.java
index a7ee41d5f..d244ebea7 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc197/SanityTestsJava15.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc197/SanityTestsJava15.java
@@ -21,7 +21,7 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava15OrLater;
*/
public class SanityTestsJava15 extends XMLBasedAjcTestCaseForJava15OrLater {
- public static final int bytecode_version_for_JDK_level = Constants.MAJOR_15;
+ public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(15).MAJOR;
// Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
public void testSimpleJava_A() {
@@ -73,7 +73,7 @@ public class SanityTestsJava15 extends XMLBasedAjcTestCaseForJava15OrLater {
public void testVersionCorrect4() {
runTest("simple - m");
// Must be 49.0 when -1.5 is specified
- checkVersion("A", Constants.MAJOR_1_5, 0);
+ checkVersion("A", Constants.ClassFileVersion.of(5).MAJOR, 0);
}
public static Test suite() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc197/SanityTestsJava16.java b/tests/src/test/java/org/aspectj/systemtest/ajc197/SanityTestsJava16.java
index 185660b15..1e42ce6d7 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc197/SanityTestsJava16.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc197/SanityTestsJava16.java
@@ -21,7 +21,7 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava16OrLater;
*/
public class SanityTestsJava16 extends XMLBasedAjcTestCaseForJava16OrLater {
- public static final int bytecode_version_for_JDK_level = Constants.MAJOR_16;
+ public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(16).MAJOR;
// Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
public void testSimpleJava_A() {
@@ -73,7 +73,7 @@ public class SanityTestsJava16 extends XMLBasedAjcTestCaseForJava16OrLater {
public void testVersionCorrect4() {
runTest("simple - m");
// Must be 49.0 when -1.5 is specified
- checkVersion("A", Constants.MAJOR_1_5, 0);
+ checkVersion("A", Constants.ClassFileVersion.of(5).MAJOR, 0);
}
public static Test suite() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/Ajc198TestsJava.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/Ajc198TestsJava.java
index 3e6ead467..4df003921 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc198/Ajc198TestsJava.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/Ajc198TestsJava.java
@@ -19,18 +19,18 @@ public class Ajc198TestsJava extends XMLBasedAjcTestCaseForJava17OrLater {
public void testSealedClassWithLegalSubclasses() {
runTest("sealed class with legal subclasses");
- checkVersion("Employee", Constants.MAJOR_17, Constants.MINOR_17);
- checkVersion("Manager", Constants.MAJOR_17, Constants.MINOR_17);
+ checkVersion("Employee", Constants.ClassFileVersion.of(17).MAJOR, Constants.ClassFileVersion.of(17).MINOR);
+ checkVersion("Manager", Constants.ClassFileVersion.of(17).MAJOR, Constants.ClassFileVersion.of(17).MINOR);
}
public void testSealedClassWithIllegalSubclass() {
runTest("sealed class with illegal subclass");
- checkVersion("Person", Constants.MAJOR_17, Constants.MINOR_17);
+ checkVersion("Person", Constants.ClassFileVersion.of(17).MAJOR, Constants.ClassFileVersion.of(17).MINOR);
}
public void testWeaveSealedClass() {
runTest("weave sealed class");
- checkVersion("PersonAspect", Constants.MAJOR_17, Constants.MINOR_17);
+ checkVersion("PersonAspect", Constants.ClassFileVersion.of(17).MAJOR, Constants.ClassFileVersion.of(17).MINOR);
}
public static Test suite() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/CompileWithReleaseTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/CompileWithReleaseTests.java
index c24c7e58e..b0fb2745b 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc198/CompileWithReleaseTests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/CompileWithReleaseTests.java
@@ -32,7 +32,7 @@ public class CompileWithReleaseTests extends XMLBasedAjcTestCaseForJava9OrLater
// Check compiled byte code version
String className = "Buffers";
- checkVersion(className, Constants.MAJOR_1_8, Constants.MINOR_1_8);
+ checkVersion(className, Constants.ClassFileVersion.of(8).MAJOR, Constants.ClassFileVersion.of(8).MINOR);
// Disassemble method and check if Java 8 API is used as expected
JavaClass javaClass;
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/Java17PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/Java17PreviewFeaturesTests.java
index c1b0f8c44..abd9213f4 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc198/Java17PreviewFeaturesTests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/Java17PreviewFeaturesTests.java
@@ -16,6 +16,7 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava17Only;
* @author Alexander Kriegisch
*/
public class Java17PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava17Only {
+ private static final Constants.ClassFileVersion classFileVersion = Constants.ClassFileVersion.of(17);
public void testSwitchPatternMatchingCaseLabelDominatedByPrecedingError() {
runTest("switch pattern matching error");
@@ -23,15 +24,15 @@ public class Java17PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava17Only
public void testSwitchPatternMatchingJava() {
runTest("switch pattern matching java");
- checkVersion("SwitchPatternOK", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("SwitchPatternOK", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public void testSwitchPatternMatchingAspect() {
runTest("switch pattern matching aspect");
- checkVersion("SwitchPatternAspect", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("Application", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("Shape", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("S", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("SwitchPatternAspect", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("Application", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("Shape", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("S", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public static Test suite() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/SanityTestsJava17.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/SanityTestsJava17.java
index a9c247dad..10363e965 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc198/SanityTestsJava17.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/SanityTestsJava17.java
@@ -21,7 +21,7 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava17OrLater;
*/
public class SanityTestsJava17 extends XMLBasedAjcTestCaseForJava17OrLater {
- public static final int bytecode_version_for_JDK_level = Constants.MAJOR_17;
+ public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(17).MAJOR;
// Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
public void testSimpleJava_A() {
@@ -73,7 +73,7 @@ public class SanityTestsJava17 extends XMLBasedAjcTestCaseForJava17OrLater {
public void testVersionCorrect4() {
runTest("simple - m");
// Must be 49.0 when -1.5 is specified
- checkVersion("A", Constants.MAJOR_1_5, 0);
+ checkVersion("A", Constants.ClassFileVersion.of(5).MAJOR, 0);
}
public static Test suite() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java
index 8afe68946..078a47671 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java
@@ -16,6 +16,7 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava18Only;
* @author Alexander Kriegisch
*/
public class Java18PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava18Only {
+ private static final Constants.ClassFileVersion classFileVersion = Constants.ClassFileVersion.of(18);
public void testSwitchPatternMatchingCaseLabelDominatedByPrecedingError() {
runTest("switch pattern matching error");
@@ -23,15 +24,15 @@ public class Java18PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava18Only
public void testSwitchPatternMatchingJava() {
runTest("switch pattern matching java");
- checkVersion("SwitchPatternOK", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("SwitchPatternOK", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public void testSwitchPatternMatchingAspect() {
runTest("switch pattern matching aspect");
- checkVersion("SwitchPatternAspect", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("Application", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("Shape", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("S", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("SwitchPatternAspect", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("Application", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("Shape", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("S", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public void testSwitchPatternMatchingPreview2Error1() {
@@ -44,13 +45,13 @@ public class Java18PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava18Only
public void testSwitchPatternMatchingPreview2Java() {
runTest("switch pattern matching preview 2 java");
- checkVersion("SwitchPatternPreview2OK", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("SwitchPatternPreview2OK", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public void testSwitchPatternMatchingPreview2Aspect() {
runTest("switch pattern matching preview 2 aspect");
- checkVersion("SwitchPatternPreview2Aspect", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
- checkVersion("Application", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION);
+ checkVersion("SwitchPatternPreview2Aspect", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
+ checkVersion("Application", classFileVersion.MAJOR, classFileVersion.PREVIEW_MINOR);
}
public static Test suite() {
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc199/SanityTestsJava18.java b/tests/src/test/java/org/aspectj/systemtest/ajc199/SanityTestsJava18.java
index a4c8ee9e2..e2d308ab5 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc199/SanityTestsJava18.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/SanityTestsJava18.java
@@ -21,7 +21,7 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava18OrLater;
*/
public class SanityTestsJava18 extends XMLBasedAjcTestCaseForJava18OrLater {
- public static final int bytecode_version_for_JDK_level = Constants.MAJOR_18;
+ public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(18).MAJOR;
// Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
public void testSimpleJava_A() {
@@ -73,7 +73,7 @@ public class SanityTestsJava18 extends XMLBasedAjcTestCaseForJava18OrLater {
public void testVersionCorrect4() {
runTest("simple - m");
// Must be 49.0 when -1.5 is specified
- checkVersion("A", Constants.MAJOR_1_5, 0);
+ checkVersion("A", Constants.ClassFileVersion.of(5).MAJOR, 0);
}
public static Test suite() {