From b2903f36cbd28584c31585b793e2943a265cfaaa Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Mon, 27 May 2024 15:50:27 +0200 Subject: [PATCH 1/3] use Java 22 in CI --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0eac36f..6cb2a9be 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 From 57cb66584e65c6fba4428673cac93a5eb017e138 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Mon, 27 May 2024 14:51:45 +0200 Subject: [PATCH 2/3] use latest Maven and exclude ECJ with Java 11 (requires 17 now) --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cb2a9be..820261ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,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: @@ -57,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 From a30a02be062809647ddb08f4c4a03d180e2d5079 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 10:48:13 +0000 Subject: [PATCH 3/3] Bump org.codehaus.plexus:plexus-compiler-eclipse from 2.11.1 to 2.15.0 Bumps org.codehaus.plexus:plexus-compiler-eclipse from 2.11.1 to 2.15.0. --- updated-dependencies: - dependency-name: org.codehaus.plexus:plexus-compiler-eclipse dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .../jboss/jandex/test/AnnotationAccessTest.java | 4 ++-- .../org/jboss/jandex/test/BasicTestCase.java | 16 +++------------- .../org/jboss/jandex/test/StackedIndexTest.java | 6 +++--- .../test/TypeAnnotationOnLocalClassTypeTest.java | 3 ++- pom.xml | 2 +- 5 files changed, 11 insertions(+), 20 deletions(-) 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