This is an automated email from the ASF dual-hosted git repository. sseifert pushed a commit to branch feature/SLING-12364-annotation-supported-source in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-api.git
commit 6181eabd070f1bdcf6e1da1253c3b832a6b5099b Author: Stefan Seifert <stefanseif...@users.noreply.github.com> AuthorDate: Fri Jun 28 18:24:39 2024 +0200 SLING-12364 Define that any java source version is supported --- .../sling/models/annotations/apt/ValidatingAnnotationProcessor.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/apache/sling/models/annotations/apt/ValidatingAnnotationProcessor.java b/src/main/java/org/apache/sling/models/annotations/apt/ValidatingAnnotationProcessor.java index 3d25ab6..87284c8 100644 --- a/src/main/java/org/apache/sling/models/annotations/apt/ValidatingAnnotationProcessor.java +++ b/src/main/java/org/apache/sling/models/annotations/apt/ValidatingAnnotationProcessor.java @@ -21,6 +21,7 @@ package org.apache.sling.models.annotations.apt; import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; +import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.Modifier; @@ -72,6 +73,11 @@ public class ValidatingAnnotationProcessor extends AbstractProcessor { return true; } + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + private String getSymbolName(Element annotatedElement) { String name = annotatedElement.getEnclosingElement().getSimpleName().toString() + "#" + annotatedElement.getSimpleName().toString();