Skip to content

Commit ebc9d84

Browse files
committed
Reactivate some tests on JDK 21 after upstream fix
eclipse-jdt/eclipse.jdt.core#1466 has finally been fixed. Signed-off-by: Alexander Kriegisch <[email protected]>
1 parent 6f2702e commit ebc9d84

File tree

3 files changed

+1
-28
lines changed

3 files changed

+1
-28
lines changed

tests/features1921/java21/SwitchPatternPreview3Aspect.aj

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ aspect SwitchPatternPreview3Aspect {
3131
}
3232

3333
Object around(Integer i): execution(* doSomethingWithInteger(*)) && args(i) {
34-
// This used to work in preview 4 (Java 20), but fails during runtime with
35-
// java.lang.IndexOutOfBoundsException: Index 4 out of bounds for length 4
36-
// in ECJ 3.36.0-SNAPSHOT with Java 21.
37-
// See:
38-
// https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466.
39-
//
40-
// TODO: Activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466 is fixed.
41-
/*
4234
System.out.println(
4335
switch (i) {
4436
case null -> "value unavailable: " + i;
@@ -47,7 +39,6 @@ aspect SwitchPatternPreview3Aspect {
4739
default -> "other integer: " + i;
4840
}
4941
);
50-
*/
5142
return proceed(i);
5243
}
5344
}

tests/features1921/java21/SwitchPatternPreview4OK.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,12 @@ public static void main(String[] args) {
2929
// constantLabelMustAppearBeforePattern(Integer.valueOf(123));
3030
// constantLabelMustAppearBeforePattern(null);
3131

32-
// TODO: Activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466 is fixed.
33-
/*
3432
constantLabelMustAppearBeforePatternInteger(-1);
3533
constantLabelMustAppearBeforePatternInteger(0);
3634
constantLabelMustAppearBeforePatternInteger(42);
3735
constantLabelMustAppearBeforePatternInteger(-99);
3836
constantLabelMustAppearBeforePatternInteger(Integer.valueOf(123));
3937
constantLabelMustAppearBeforePatternInteger(null);
40-
*/
4138

4239
System.out.println(testGenericSealedExhaustive(new E<Integer>()));
4340
}
@@ -105,15 +102,6 @@ static String constantLabelMustAppearBeforePattern(Object o) {
105102
}
106103
*/
107104

108-
/**
109-
* This used to work in preview 4 (Java 20), but fails during runtime with
110-
* java.lang.IndexOutOfBoundsException: Index 4 out of bounds for length 4
111-
* in ECJ 3.36.0-SNAPSHOT with Java 21.
112-
* See:
113-
* https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466.
114-
*
115-
* TODO: Activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466 is fixed.
116-
*/
117105
static String constantLabelMustAppearBeforePatternInteger(Integer i) {
118106
switch (i) {
119107
case null -> System.out.println("value unavailable: " + i);

tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<ajc-test dir="features1921/java21" vm="21" title="switch pattern matching preview 4 java">
2727
<compile files="SwitchPatternPreview4OK.java" options="-21" />
2828
<run class="SwitchPatternPreview4OK" vmargs="">
29-
<message></message>
29+
<message/>
3030
<stdout>
3131
<line text="null" />
3232
<line text="int 123" />
@@ -40,15 +40,12 @@
4040
<line text="Sealed sub-class A" />
4141
<line text="Sealed sub-class B" />
4242
<line text="Sealed sub-record C" />
43-
<!-- TODO: Activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466 is fixed. -->
44-
<!--
4543
<line text="absolute value 1: -1" />
4644
<line text="other integer: 0" />
4745
<line text="positive integer: 42" />
4846
<line text="other integer: -99" />
4947
<line text="positive integer: 123" />
5048
<line text="value unavailable: null" />
51-
-->
5249
<line text="42" />
5350
</stdout>
5451
</run>
@@ -79,15 +76,12 @@
7976
<line text="Sealed sub-class A" />
8077
<line text="Sealed sub-class B" />
8178
<line text="Sealed sub-record C" />
82-
<!-- TODO: Activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466 is fixed. -->
83-
<!--
8479
<line text="absolute value 1: -1" />
8580
<line text="other integer: 0" />
8681
<line text="positive integer: 42" />
8782
<line text="other integer: -99" />
8883
<line text="positive integer: 123" />
8984
<line text="value unavailable: null" />
90-
-->
9185
</stdout>
9286
</run>
9387
</ajc-test>

0 commit comments

Comments
 (0)