I tried to create another API with annotation and a processor that deals with not yet generated classes. But this time with an array - I am getting ClassCastException however.
To reproduce, just take the test in http://hg.openjdk.java.net/jdk8/tl/langtools/rev/e811fb09a1dc and change the annotations to use arrays of Class<?>:
@interface A {
Class<?>[] a();
}
@interface B {
Class<?>[] a();
}
@interface C {
Class<?>[] a();
}
A ClassCastException is thrown rather than javax.lang.model.type.MirroredTypesException
To reproduce, just take the test in http://hg.openjdk.java.net/jdk8/tl/langtools/rev/e811fb09a1dc and change the annotations to use arrays of Class<?>:
@interface A {
Class<?>[] a();
}
@interface B {
Class<?>[] a();
}
@interface C {
Class<?>[] a();
}
A ClassCastException is thrown rather than javax.lang.model.type.MirroredTypesException
- duplicates
-
JDK-8144102 Element#getAnnotation throws ClassCastException on unresolvable symbol
-
- Closed
-
- relates to
-
JDK-8019243 AnnotationTypeMismatchException instead of MirroredTypeException
-
- Closed
-
ClassCastException: com.sun.tools.javac.code.Attribute$UnresolvedClass cannot be cast to com.sun.tools.javac.code.Attribute$Class
I tried to create another API with annotation and a processor that deals with not yet generated classes. But this time with an array - I am getting ClassCastException however.
To reproduce, just take the test in http://hg.openjdk.java.net/jdk8/tl/langtools/rev/e811fb09a1dc and change the annotations to use arrays of Class<?>:
@interface A {
Class<?>[] a();
}
@interface B {
Class<?>[] a();
}
@interface C {
Class<?>[] a();
}
A ClassCastException is thrown rather than javax.lang.model.type.MirroredTypesException
To reproduce, just take the test in http://hg.openjdk.java.net/jdk8/tl/langtools/rev/e811fb09a1dc and change the annotations to use arrays of Class<?>:
@interface A {
Class<?>[] a();
}
@interface B {
Class<?>[] a();
}
@interface C {
Class<?>[] a();
}
A ClassCastException is thrown rather than javax.lang.model.type.MirroredTypesException
- duplicates
-
JDK-8144102 Element#getAnnotation throws ClassCastException on unresolvable symbol
-
- Closed
-
- relates to
-
JDK-8019243 AnnotationTypeMismatchException instead of MirroredTypeException
-
- Closed
-