提交 a5013ea3 编写于 作者: D darcy

8006283: Change to Class.cast() in javax.lang.model implementation for repeating annotations

Reviewed-by: jjg
上级 4db4db5e
......@@ -266,9 +266,10 @@ public class JavacElements implements Elements {
private static Class<? extends Annotation> initRepeatable() {
try {
@SuppressWarnings("unchecked") // java.lang.annotation.Repeatable extends Annotation by being an annotation type
Class<? extends Annotation> c = (Class)Class.forName("java.lang.annotation.Repeatable");
return c;
// Repeatable will not be available when bootstrapping on
// JDK 7 so use a reflective lookup instead of a class
// literal for Repeatable.class.
return Class.forName("java.lang.annotation.Repeatable").asSubclass(Annotation.class);
} catch (ClassNotFoundException e) {
return null;
} catch (SecurityException e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册