]> source.dussan.org Git - aspectj.git/commitdiff
Reactivate some tests on JDK 21 after upstream fix
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Mon, 27 Nov 2023 04:17:27 +0000 (11:17 +0700)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Mon, 27 Nov 2023 04:41:19 +0000 (11:41 +0700)
https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466 has finally
been fixed.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
tests/features1921/java21/SwitchPatternPreview3Aspect.aj
tests/features1921/java21/SwitchPatternPreview4OK.java
tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml

index cab9a2bcdfada0dbcd563192f85799e718726f24..ae147dad7c41e42150c85d2fa7bf7f21cc1a6f54 100644 (file)
@@ -31,14 +31,6 @@ aspect SwitchPatternPreview3Aspect {
   }
 
   Object around(Integer i): execution(* doSomethingWithInteger(*)) && args(i) {
-    // This used to work in preview 4 (Java 20), but fails during runtime with
-    //   java.lang.IndexOutOfBoundsException: Index 4 out of bounds for length 4
-    // in ECJ 3.36.0-SNAPSHOT with Java 21.
-    // See:
-    //   https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466.
-    //
-    // TODO: Activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466 is fixed.
-    /*
     System.out.println(
       switch (i) {
         case null -> "value unavailable: " + i;
@@ -47,7 +39,6 @@ aspect SwitchPatternPreview3Aspect {
         default -> "other integer: " + i;
       }
     );
-    */
     return proceed(i);
   }
 }
index c9caf7ecae9eefa533148b6468a462915f3399dc..40854a0078d2913b6c4a97b3ebf4167833cde6f5 100644 (file)
@@ -29,15 +29,12 @@ public class SwitchPatternPreview4OK {
 //    constantLabelMustAppearBeforePattern(Integer.valueOf(123));
 //    constantLabelMustAppearBeforePattern(null);
 
-    // TODO: Activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466 is fixed.
-    /*
     constantLabelMustAppearBeforePatternInteger(-1);
     constantLabelMustAppearBeforePatternInteger(0);
     constantLabelMustAppearBeforePatternInteger(42);
     constantLabelMustAppearBeforePatternInteger(-99);
     constantLabelMustAppearBeforePatternInteger(Integer.valueOf(123));
     constantLabelMustAppearBeforePatternInteger(null);
-    */
 
     System.out.println(testGenericSealedExhaustive(new E<Integer>()));
   }
@@ -105,15 +102,6 @@ public class SwitchPatternPreview4OK {
   }
 */
 
-  /**
-   * This used to work in preview 4 (Java 20), but fails during runtime with
-   *   java.lang.IndexOutOfBoundsException: Index 4 out of bounds for length 4
-   * in ECJ 3.36.0-SNAPSHOT with Java 21.
-   * See:
-   *   https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466.
-   *
-   * TODO: Activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466 is fixed.
-   */
   static String constantLabelMustAppearBeforePatternInteger(Integer i) {
     switch (i) {
       case null -> System.out.println("value unavailable: " + i);
index ec46822164055baa90b98a2c7d0074514c867989..42a58da0c6c8a8867e39adb635d0c29c02febb37 100644 (file)
@@ -26,7 +26,7 @@
        <ajc-test dir="features1921/java21" vm="21" title="switch pattern matching preview 4 java">
                <compile files="SwitchPatternPreview4OK.java" options="-21" />
                <run class="SwitchPatternPreview4OK" vmargs="">
-                       <message></message>
+                       <message/>
                        <stdout>
                                <line text="null" />
                                <line text="int 123" />
                                <line text="Sealed sub-class A" />
                                <line text="Sealed sub-class B" />
                                <line text="Sealed sub-record C" />
-                               <!-- TODO: Activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466 is fixed. -->
-                               <!--
                                <line text="absolute value 1: -1" />
                                <line text="other integer: 0" />
                                <line text="positive integer: 42" />
                                <line text="other integer: -99" />
                                <line text="positive integer: 123" />
                                <line text="value unavailable: null" />
-                               -->
                                <line text="42" />
                        </stdout>
                </run>
                                <line text="Sealed sub-class A" />
                                <line text="Sealed sub-class B" />
                                <line text="Sealed sub-record C" />
-                               <!-- TODO: Activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466 is fixed. -->
-                               <!--
                                <line text="absolute value 1: -1" />
                                <line text="other integer: 0" />
                                <line text="positive integer: 42" />
                                <line text="other integer: -99" />
                                <line text="positive integer: 123" />
                                <line text="value unavailable: null" />
-                               -->
                        </stdout>
                </run>
        </ajc-test>