aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test/java/org/aspectj/systemtest/ajc1921
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/test/java/org/aspectj/systemtest/ajc1921
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/test/java/org/aspectj/systemtest/ajc1921')
-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
2 files changed, 9 insertions, 9 deletions
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() {