Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Commit 67a993c

Browse files
authored
Merge pull request #2172 from dodgex/2082_do_not_copy_kotlin_metadata
Ensure that `kotlin.Metadata` is not copied to generated class
2 parents ace17b0 + 9147ae2 commit 67a993c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/helper

‎AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/helper/APTCodeModelHelper.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878

7979
public class APTCodeModelHelper {
8080

81+
private static final List<String> IGNORED_ANNOTATIONS = Collections.singletonList("kotlin.Metadata");
82+
8183
private AndroidAnnotationsEnvironment environment;
8284

8385
public APTCodeModelHelper(AndroidAnnotationsEnvironment environment) {
@@ -318,7 +320,7 @@ public void copyNonAAAnnotations(IJAnnotatable annotatable, List<? extends Annot
318320
for (AnnotationMirror annotationMirror : annotationMirrors) {
319321
if (annotationMirror.getAnnotationType().asElement().getAnnotation(Inherited.class) == null) {
320322
AbstractJClass annotationClass = typeMirrorToJClass(annotationMirror.getAnnotationType());
321-
if (!environment.isAndroidAnnotation(annotationClass.fullName())) {
323+
if (!environment.isAndroidAnnotation(annotationClass.fullName()) && !IGNORED_ANNOTATIONS.contains(annotationClass.fullName())) {
322324
copyAnnotation(annotatable, annotationMirror);
323325
}
324326
}

0 commit comments

Comments
 (0)