From ef7d7adccd31a1982957b2f17aa2ce4bf4daa9c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 11:09:17 +0000 Subject: [PATCH 1/4] Bump build-helper-maven-plugin from 1.9.1 to 3.3.0 Bumps [build-helper-maven-plugin](https://github.com/mojohaus/build-helper-maven-plugin) from 1.9.1 to 3.3.0. - [Release notes](https://github.com/mojohaus/build-helper-maven-plugin/releases) - [Commits](https://github.com/mojohaus/build-helper-maven-plugin/compare/build-helper-maven-plugin-1.9.1...build-helper-maven-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:build-helper-maven-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- example/example-annotationprocessor/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/example-annotationprocessor/pom.xml b/example/example-annotationprocessor/pom.xml index 5fe986e8..1c1a9e56 100644 --- a/example/example-annotationprocessor/pom.xml +++ b/example/example-annotationprocessor/pom.xml @@ -114,7 +114,7 @@ org.codehaus.mojo build-helper-maven-plugin - 1.9.1 + 3.3.0 add-resource From 08d31b04dc8dad1fcf2b977493f8f6a82b6a8411 Mon Sep 17 00:00:00 2001 From: Tobias Stamann Date: Sun, 5 Nov 2023 14:35:25 +0100 Subject: [PATCH 2/4] Update for next development version --- annotationwrapper/api/pom.xml | 2 +- annotationwrapper/integrationtest/pom.xml | 2 +- annotationwrapper/pom.xml | 2 +- annotationwrapper/processor/pom.xml | 2 +- common/pom.xml | 2 +- compilermessages/api/pom.xml | 2 +- compilermessages/integrationtest/pom.xml | 2 +- compilermessages/pom.xml | 2 +- compilermessages/processor/pom.xml | 2 +- cute/pom.xml | 2 +- example/example-annotationprocessor/pom.xml | 2 +- example/example-annotations/pom.xml | 2 +- example/example-usecase/pom.xml | 2 +- example/pom.xml | 2 +- extensions/java9/pom.xml | 2 +- extensions/pom.xml | 2 +- pom.xml | 2 +- templating/pom.xml | 2 +- tools/pom.xml | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/annotationwrapper/api/pom.xml b/annotationwrapper/api/pom.xml index 42324ff0..890d154d 100644 --- a/annotationwrapper/api/pom.xml +++ b/annotationwrapper/api/pom.xml @@ -8,7 +8,7 @@ io.toolisticon.aptk aptk-annotationwrapper-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-annotationwrapper-api diff --git a/annotationwrapper/integrationtest/pom.xml b/annotationwrapper/integrationtest/pom.xml index 7da61d76..3a1cd0b0 100644 --- a/annotationwrapper/integrationtest/pom.xml +++ b/annotationwrapper/integrationtest/pom.xml @@ -9,7 +9,7 @@ io.toolisticon.aptk aptk-annotationwrapper-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-annotationwrapper-integrationTest diff --git a/annotationwrapper/pom.xml b/annotationwrapper/pom.xml index 1bbbb726..10a5c87f 100644 --- a/annotationwrapper/pom.xml +++ b/annotationwrapper/pom.xml @@ -11,7 +11,7 @@ io.toolisticon.aptk aptk-parent - 0.22.7 + 0.22.8-SNAPSHOT diff --git a/annotationwrapper/processor/pom.xml b/annotationwrapper/processor/pom.xml index 42e9d17d..20772ae6 100644 --- a/annotationwrapper/processor/pom.xml +++ b/annotationwrapper/processor/pom.xml @@ -9,7 +9,7 @@ io.toolisticon.aptk aptk-annotationwrapper-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-annotationwrapper-processor diff --git a/common/pom.xml b/common/pom.xml index 8cbfa30d..08207179 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -7,7 +7,7 @@ io.toolisticon.aptk aptk-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-common diff --git a/compilermessages/api/pom.xml b/compilermessages/api/pom.xml index 57a9bcfa..e309fb39 100644 --- a/compilermessages/api/pom.xml +++ b/compilermessages/api/pom.xml @@ -8,7 +8,7 @@ io.toolisticon.aptk aptk-compilermessages-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-compilermessages-api diff --git a/compilermessages/integrationtest/pom.xml b/compilermessages/integrationtest/pom.xml index 712ffb5b..37544cad 100644 --- a/compilermessages/integrationtest/pom.xml +++ b/compilermessages/integrationtest/pom.xml @@ -9,7 +9,7 @@ io.toolisticon.aptk aptk-compilermessages-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-compilermessages-integrationTest diff --git a/compilermessages/pom.xml b/compilermessages/pom.xml index 8623add9..69216339 100644 --- a/compilermessages/pom.xml +++ b/compilermessages/pom.xml @@ -11,7 +11,7 @@ io.toolisticon.aptk aptk-parent - 0.22.7 + 0.22.8-SNAPSHOT diff --git a/compilermessages/processor/pom.xml b/compilermessages/processor/pom.xml index 31a532aa..f838e642 100644 --- a/compilermessages/processor/pom.xml +++ b/compilermessages/processor/pom.xml @@ -9,7 +9,7 @@ io.toolisticon.aptk aptk-compilermessages-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-compilermessages-processor diff --git a/cute/pom.xml b/cute/pom.xml index 27b62c4d..752b780a 100644 --- a/cute/pom.xml +++ b/cute/pom.xml @@ -8,7 +8,7 @@ io.toolisticon.aptk aptk-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-cute diff --git a/example/example-annotationprocessor/pom.xml b/example/example-annotationprocessor/pom.xml index a06d2f87..0d98695d 100644 --- a/example/example-annotationprocessor/pom.xml +++ b/example/example-annotationprocessor/pom.xml @@ -8,7 +8,7 @@ io.toolisticon.aptk aptk-example-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-example-annotationprocessor diff --git a/example/example-annotations/pom.xml b/example/example-annotations/pom.xml index 0d0e957e..3082947e 100644 --- a/example/example-annotations/pom.xml +++ b/example/example-annotations/pom.xml @@ -7,7 +7,7 @@ io.toolisticon.aptk aptk-example-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-example-annotations diff --git a/example/example-usecase/pom.xml b/example/example-usecase/pom.xml index 6a202070..a6c9fb64 100644 --- a/example/example-usecase/pom.xml +++ b/example/example-usecase/pom.xml @@ -7,7 +7,7 @@ io.toolisticon.aptk aptk-example-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-example-usecase diff --git a/example/pom.xml b/example/pom.xml index bcc8ac95..6e53dc26 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -7,7 +7,7 @@ io.toolisticon.aptk aptk-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-example-parent diff --git a/extensions/java9/pom.xml b/extensions/java9/pom.xml index 7dce7bd0..959f6bcf 100644 --- a/extensions/java9/pom.xml +++ b/extensions/java9/pom.xml @@ -8,7 +8,7 @@ io.toolisticon.aptk extension-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-tools-java9 diff --git a/extensions/pom.xml b/extensions/pom.xml index 3f920cbe..a8dc6693 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -7,7 +7,7 @@ io.toolisticon.aptk aptk-parent - 0.22.7 + 0.22.8-SNAPSHOT extension-parent diff --git a/pom.xml b/pom.xml index e99a24f6..34e6f3b9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.toolisticon.aptk aptk-parent - 0.22.7 + 0.22.8-SNAPSHOT pom aptk-parent diff --git a/templating/pom.xml b/templating/pom.xml index 676d27c4..42fde7c2 100644 --- a/templating/pom.xml +++ b/templating/pom.xml @@ -7,7 +7,7 @@ io.toolisticon.aptk aptk-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-templating diff --git a/tools/pom.xml b/tools/pom.xml index ec8c28a2..3acba159 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -8,7 +8,7 @@ io.toolisticon.aptk aptk-parent - 0.22.7 + 0.22.8-SNAPSHOT aptk-tools From df2afa4c7d6d21f59391566f0ce23359eef64dd4 Mon Sep 17 00:00:00 2001 From: Tobias Stamann Date: Sat, 11 Nov 2023 06:43:23 +0100 Subject: [PATCH 3/4] Fixed Bug, addedmethod for getting annotation attribute type --- .../wrapper/AnnotationMirrorWrapper.java | 20 +++++++++++++++++++ .../tools/wrapper/TypeElementWrapper.java | 1 + .../wrapper/AnnotationMirrorWrapperTest.java | 10 ++++++++++ 3 files changed, 31 insertions(+) diff --git a/tools/src/main/java/io/toolisticon/aptk/tools/wrapper/AnnotationMirrorWrapper.java b/tools/src/main/java/io/toolisticon/aptk/tools/wrapper/AnnotationMirrorWrapper.java index 051ce835..0d3117eb 100644 --- a/tools/src/main/java/io/toolisticon/aptk/tools/wrapper/AnnotationMirrorWrapper.java +++ b/tools/src/main/java/io/toolisticon/aptk/tools/wrapper/AnnotationMirrorWrapper.java @@ -68,6 +68,26 @@ public TypeElementWrapper getAnnotationTypeAsWrappedTypeElement() { return getAnnotationTypeAsWrappedTypeMirror().getTypeElement().get(); } + + /** + * Gets the wrapped type mirror of the 'value' annotation attribute. + * @return an optional containing the wrapped type mirror of the annotation attribute or an empty Optional if the attribute doesn't exist. + */ + public Optional getAttributeTypeMirror() { + return getAttributeTypeMirror("value"); + } + + /** + * Gets the wrapped type mirror of an annotation attribute. + * @param attributeName the name of the attribute + * @return an optional containing the wrapped type mirror of the annotation attribute or an empty Optional if the attribute doesn't exist. + */ + public Optional getAttributeTypeMirror(String attributeName) { + Optional annotationAttribute = this.getAnnotationTypeAsWrappedTypeElement().getMethod(attributeName); + return !annotationAttribute.isPresent() ? Optional.empty() : Optional.of(annotationAttribute.get().getReturnType()); + } + + /** * Returns the "value" attribute * diff --git a/tools/src/main/java/io/toolisticon/aptk/tools/wrapper/TypeElementWrapper.java b/tools/src/main/java/io/toolisticon/aptk/tools/wrapper/TypeElementWrapper.java index 19359781..eebb591a 100644 --- a/tools/src/main/java/io/toolisticon/aptk/tools/wrapper/TypeElementWrapper.java +++ b/tools/src/main/java/io/toolisticon/aptk/tools/wrapper/TypeElementWrapper.java @@ -126,6 +126,7 @@ public List getTypeParameters() { public Optional getMethod(String name, Class... parameterTypes) { List filterResult = FluentElementFilter.createFluentElementFilter(this.element.getEnclosedElements()) .applyFilter(AptkCoreMatchers.IS_METHOD) + .applyFilter(AptkCoreMatchers.BY_NAME).filterByOneOf(name) .applyFilter(AptkCoreMatchers.BY_PARAMETER_TYPE).filterByOneOf(parameterTypes) .getResult(); return Optional.ofNullable(filterResult.size() > 0 ? ExecutableElementWrapper.wrap(filterResult.get(0)) : null); diff --git a/tools/src/test/java/io/toolisticon/aptk/tools/wrapper/AnnotationMirrorWrapperTest.java b/tools/src/test/java/io/toolisticon/aptk/tools/wrapper/AnnotationMirrorWrapperTest.java index 356ed734..e121ef51 100644 --- a/tools/src/test/java/io/toolisticon/aptk/tools/wrapper/AnnotationMirrorWrapperTest.java +++ b/tools/src/test/java/io/toolisticon/aptk/tools/wrapper/AnnotationMirrorWrapperTest.java @@ -47,6 +47,16 @@ public void test_wrap_null() { AnnotationMirrorWrapper.wrap((AnnotationMirror) null); } + + @Test + public void test_getAttributesTypeMirror() { + CompileTestBuilder.unitTest().defineTestWithPassedInElement(MyTestClass.class, (processingEnvironment, element) -> { + AnnotationMirrorWrapper unit = ElementWrapper.wrap(element).getAnnotationMirror(MyTestAnnotation.class).get(); + + MatcherAssert.assertThat(unit.getAttributeTypeMirror().get().getSimpleName(), Matchers.is("String")); + }).executeTest(); + } + @Test public void test_getAttribute() { From b41fa7fe8565dccc252763a84422f6571333b538 Mon Sep 17 00:00:00 2001 From: Tobias Stamann Date: Sat, 11 Nov 2023 06:50:44 +0100 Subject: [PATCH 4/4] Update versions for release --- annotationwrapper/api/pom.xml | 2 +- annotationwrapper/integrationtest/pom.xml | 2 +- annotationwrapper/pom.xml | 2 +- annotationwrapper/processor/pom.xml | 2 +- common/pom.xml | 2 +- compilermessages/api/pom.xml | 2 +- compilermessages/integrationtest/pom.xml | 2 +- compilermessages/pom.xml | 2 +- compilermessages/processor/pom.xml | 2 +- cute/pom.xml | 2 +- example/example-annotationprocessor/pom.xml | 2 +- example/example-annotations/pom.xml | 2 +- example/example-usecase/pom.xml | 2 +- example/pom.xml | 2 +- extensions/java9/pom.xml | 2 +- extensions/pom.xml | 2 +- pom.xml | 2 +- templating/pom.xml | 2 +- tools/pom.xml | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/annotationwrapper/api/pom.xml b/annotationwrapper/api/pom.xml index 890d154d..d571f683 100644 --- a/annotationwrapper/api/pom.xml +++ b/annotationwrapper/api/pom.xml @@ -8,7 +8,7 @@ io.toolisticon.aptk aptk-annotationwrapper-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-annotationwrapper-api diff --git a/annotationwrapper/integrationtest/pom.xml b/annotationwrapper/integrationtest/pom.xml index 3a1cd0b0..762f96dd 100644 --- a/annotationwrapper/integrationtest/pom.xml +++ b/annotationwrapper/integrationtest/pom.xml @@ -9,7 +9,7 @@ io.toolisticon.aptk aptk-annotationwrapper-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-annotationwrapper-integrationTest diff --git a/annotationwrapper/pom.xml b/annotationwrapper/pom.xml index 10a5c87f..e9d6da1b 100644 --- a/annotationwrapper/pom.xml +++ b/annotationwrapper/pom.xml @@ -11,7 +11,7 @@ io.toolisticon.aptk aptk-parent - 0.22.8-SNAPSHOT + 0.22.8 diff --git a/annotationwrapper/processor/pom.xml b/annotationwrapper/processor/pom.xml index 20772ae6..7dfe203e 100644 --- a/annotationwrapper/processor/pom.xml +++ b/annotationwrapper/processor/pom.xml @@ -9,7 +9,7 @@ io.toolisticon.aptk aptk-annotationwrapper-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-annotationwrapper-processor diff --git a/common/pom.xml b/common/pom.xml index 08207179..813696df 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -7,7 +7,7 @@ io.toolisticon.aptk aptk-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-common diff --git a/compilermessages/api/pom.xml b/compilermessages/api/pom.xml index e309fb39..6dd9d372 100644 --- a/compilermessages/api/pom.xml +++ b/compilermessages/api/pom.xml @@ -8,7 +8,7 @@ io.toolisticon.aptk aptk-compilermessages-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-compilermessages-api diff --git a/compilermessages/integrationtest/pom.xml b/compilermessages/integrationtest/pom.xml index 37544cad..3d8a1ad7 100644 --- a/compilermessages/integrationtest/pom.xml +++ b/compilermessages/integrationtest/pom.xml @@ -9,7 +9,7 @@ io.toolisticon.aptk aptk-compilermessages-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-compilermessages-integrationTest diff --git a/compilermessages/pom.xml b/compilermessages/pom.xml index 69216339..ff231db6 100644 --- a/compilermessages/pom.xml +++ b/compilermessages/pom.xml @@ -11,7 +11,7 @@ io.toolisticon.aptk aptk-parent - 0.22.8-SNAPSHOT + 0.22.8 diff --git a/compilermessages/processor/pom.xml b/compilermessages/processor/pom.xml index f838e642..3b2d9c56 100644 --- a/compilermessages/processor/pom.xml +++ b/compilermessages/processor/pom.xml @@ -9,7 +9,7 @@ io.toolisticon.aptk aptk-compilermessages-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-compilermessages-processor diff --git a/cute/pom.xml b/cute/pom.xml index 752b780a..7d4099c5 100644 --- a/cute/pom.xml +++ b/cute/pom.xml @@ -8,7 +8,7 @@ io.toolisticon.aptk aptk-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-cute diff --git a/example/example-annotationprocessor/pom.xml b/example/example-annotationprocessor/pom.xml index bb8afd30..016d11a1 100644 --- a/example/example-annotationprocessor/pom.xml +++ b/example/example-annotationprocessor/pom.xml @@ -8,7 +8,7 @@ io.toolisticon.aptk aptk-example-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-example-annotationprocessor diff --git a/example/example-annotations/pom.xml b/example/example-annotations/pom.xml index 3082947e..9a80dbd3 100644 --- a/example/example-annotations/pom.xml +++ b/example/example-annotations/pom.xml @@ -7,7 +7,7 @@ io.toolisticon.aptk aptk-example-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-example-annotations diff --git a/example/example-usecase/pom.xml b/example/example-usecase/pom.xml index a6c9fb64..bdb0b192 100644 --- a/example/example-usecase/pom.xml +++ b/example/example-usecase/pom.xml @@ -7,7 +7,7 @@ io.toolisticon.aptk aptk-example-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-example-usecase diff --git a/example/pom.xml b/example/pom.xml index 6e53dc26..0cca5441 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -7,7 +7,7 @@ io.toolisticon.aptk aptk-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-example-parent diff --git a/extensions/java9/pom.xml b/extensions/java9/pom.xml index 959f6bcf..8b9d69c2 100644 --- a/extensions/java9/pom.xml +++ b/extensions/java9/pom.xml @@ -8,7 +8,7 @@ io.toolisticon.aptk extension-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-tools-java9 diff --git a/extensions/pom.xml b/extensions/pom.xml index a8dc6693..8aaf356f 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -7,7 +7,7 @@ io.toolisticon.aptk aptk-parent - 0.22.8-SNAPSHOT + 0.22.8 extension-parent diff --git a/pom.xml b/pom.xml index 34e6f3b9..d1e185f6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.toolisticon.aptk aptk-parent - 0.22.8-SNAPSHOT + 0.22.8 pom aptk-parent diff --git a/templating/pom.xml b/templating/pom.xml index 42fde7c2..801bc828 100644 --- a/templating/pom.xml +++ b/templating/pom.xml @@ -7,7 +7,7 @@ io.toolisticon.aptk aptk-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-templating diff --git a/tools/pom.xml b/tools/pom.xml index 3acba159..7036d309 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -8,7 +8,7 @@ io.toolisticon.aptk aptk-parent - 0.22.8-SNAPSHOT + 0.22.8 aptk-tools