diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0eac36f..820261ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,9 @@ jobs: - 11 - 17 - 21 - - 22-ea + - 22 + # not yet supported by Groovy + #- 23-ea compiler: - javac - ecj @@ -40,6 +42,8 @@ jobs: exclude: - java: 8 compiler: ecj + - java: 11 + compiler: ecj runs-on: ${{ matrix.os }} name: "JDK ${{ matrix.java }}, ${{ matrix.compiler}}, params: ${{ matrix.parameters }}, ${{ matrix.os }}" steps: @@ -55,7 +59,7 @@ jobs: - name: Set up Maven uses: stCarolas/setup-maven@v5 with: - maven-version: 3.8.7 + maven-version: 3.9.7 - name: Build with Maven shell: bash diff --git a/core/src/test/java/org/jboss/jandex/test/AnnotationAccessTest.java b/core/src/test/java/org/jboss/jandex/test/AnnotationAccessTest.java index eec3335e..8cf8f959 100644 --- a/core/src/test/java/org/jboss/jandex/test/AnnotationAccessTest.java +++ b/core/src/test/java/org/jboss/jandex/test/AnnotationAccessTest.java @@ -85,7 +85,7 @@ public void test() throws IOException { assertEquals(1, clazz.declaredAnnotationsWithRepeatable(myAnn, index).size()); assertEquals(3, clazz.declaredAnnotations().size()); verify(clazz.declaredAnnotations(), myAnn, "c1"); - assertEquals(CompiledWith.ecj() ? 14 : 9, clazz.annotationsWithRepeatable(myRepAnn, index).size()); + assertEquals(9, clazz.annotationsWithRepeatable(myRepAnn, index).size()); assertEquals(3, clazz.declaredAnnotationsWithRepeatable(myRepAnn, index).size()); verify(clazz.declaredAnnotationsWithRepeatable(myRepAnn, index), myRepAnn, "cr1", "cr2", "cr3"); } @@ -103,7 +103,7 @@ public void test() throws IOException { assertEquals(1, field.declaredAnnotationsWithRepeatable(myAnn, index).size()); assertEquals(3, field.declaredAnnotations().size()); verify(field.declaredAnnotations(), myAnn, "f1"); - assertEquals(CompiledWith.ecj() ? 8 : 3, field.annotationsWithRepeatable(myRepAnn, index).size()); + assertEquals(3, field.annotationsWithRepeatable(myRepAnn, index).size()); assertEquals(3, field.declaredAnnotationsWithRepeatable(myRepAnn, index).size()); verify(field.declaredAnnotationsWithRepeatable(myRepAnn, index), myRepAnn, "fr1", "fr2", "fr3"); } diff --git a/core/src/test/java/org/jboss/jandex/test/BasicTestCase.java b/core/src/test/java/org/jboss/jandex/test/BasicTestCase.java index aa7018f1..356f39d3 100644 --- a/core/src/test/java/org/jboss/jandex/test/BasicTestCase.java +++ b/core/src/test/java/org/jboss/jandex/test/BasicTestCase.java @@ -673,19 +673,9 @@ private void verifyDummy(Index index, boolean v2features) { assertEquals(0, nestedParamAnnotated.position()); assertTrue(nestedParamAnnotated.hasAnnotation(DotName.createSimple(ParameterAnnotation.class.getName()))); assertNotNull(nestedParamAnnotated.annotation(DotName.createSimple(ParameterAnnotation.class.getName()))); - if (!CompiledWith.ecj()) { - // javac DOESN'T put the annotation on the _type_ of the parameter - assertEquals(1, nestedParamAnnotated.annotations().size()); - assertTrue(nestedParamAnnotated.type().annotations().isEmpty()); - assertNull(nestedParamAnnotated.type().annotation(DotName.createSimple(ParameterAnnotation.class.getName()))); - } else { - // ecj DOES put the annotation on the _type_ of the parameter, contrary to the `@Target` declaration - assertEquals(2, nestedParamAnnotated.annotations().size()); - assertTrue( - nestedParamAnnotated.type().hasAnnotation(DotName.createSimple(ParameterAnnotation.class.getName()))); - assertNotNull( - nestedParamAnnotated.type().annotation(DotName.createSimple(ParameterAnnotation.class.getName()))); - } + assertEquals(1, nestedParamAnnotated.annotations().size()); + assertTrue(nestedParamAnnotated.type().annotations().isEmpty()); + assertNull(nestedParamAnnotated.type().annotation(DotName.createSimple(ParameterAnnotation.class.getName()))); ClassInfo enumClass = index.getClassByName(DotName.createSimple(Enum.class.getName())); assertNotNull(enumClass); diff --git a/core/src/test/java/org/jboss/jandex/test/StackedIndexTest.java b/core/src/test/java/org/jboss/jandex/test/StackedIndexTest.java index b7f38970..c23f0833 100644 --- a/core/src/test/java/org/jboss/jandex/test/StackedIndexTest.java +++ b/core/src/test/java/org/jboss/jandex/test/StackedIndexTest.java @@ -114,19 +114,19 @@ public void test() throws IOException { // on the _types_ of `AnnotatedClassN.field` and `method`, contrary to the `@Target` declarations annotations = index.getAnnotations(MyRepeatableAnnotation.DOT_NAME); - assertEquals(CompiledWith.ecj() ? 11 : 5, annotations.size()); + assertEquals(5, annotations.size()); for (AnnotationInstance annotation : annotations) { assertFalse(annotation.value().asString().startsWith("XXX")); } annotations = index.getAnnotations(MyRepeatableAnnotation.List.DOT_NAME); - assertEquals(CompiledWith.ecj() ? 5 : 3, annotations.size()); + assertEquals(3, annotations.size()); for (AnnotationInstance annotation : annotations) { assertFalse(annotation.value().asString().startsWith("XXX")); } annotations = index.getAnnotationsWithRepeatable(MyRepeatableAnnotation.DOT_NAME, index); - assertEquals(CompiledWith.ecj() ? 21 : 11, annotations.size()); + assertEquals(11, annotations.size()); for (AnnotationInstance annotation : annotations) { assertFalse(annotation.value().asString().startsWith("XXX")); } diff --git a/core/src/test/java/org/jboss/jandex/test/TypeAnnotationOnLocalClassTypeTest.java b/core/src/test/java/org/jboss/jandex/test/TypeAnnotationOnLocalClassTypeTest.java index 6c7b404f..51e2482e 100644 --- a/core/src/test/java/org/jboss/jandex/test/TypeAnnotationOnLocalClassTypeTest.java +++ b/core/src/test/java/org/jboss/jandex/test/TypeAnnotationOnLocalClassTypeTest.java @@ -128,7 +128,8 @@ private void test(Index index, Class clazz) { assertNotNull(classInfo); assertEquals(clazz.getName(), classInfo.name().toString()); - { + if (!CompiledWith.ecj()) { + // ecj does NOT put the type annotation on the extended type assertEquals( "org.jboss.jandex.test.@TypeAnn(\"local:extends\") TypeAnnotationOnLocalClassTypeTest$InnerClass$1LocalClass", classInfo.superClassType().toString()); diff --git a/pom.xml b/pom.xml index e8972ba3..7f5cbf3d 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,7 @@ 3.5.1 1.6.13 1.1.1 - 2.11.1 + 2.15.0 4.0.0