mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8006283: Change to Class.cast() in javax.lang.model implementation for repeating annotations
Reviewed-by: jjg
This commit is contained in:
parent
b11bbbe239
commit
e942cdde81
1 changed files with 4 additions and 3 deletions
|
@ -266,9 +266,10 @@ public class JavacElements implements Elements {
|
||||||
|
|
||||||
private static Class<? extends Annotation> initRepeatable() {
|
private static Class<? extends Annotation> initRepeatable() {
|
||||||
try {
|
try {
|
||||||
@SuppressWarnings("unchecked") // java.lang.annotation.Repeatable extends Annotation by being an annotation type
|
// Repeatable will not be available when bootstrapping on
|
||||||
Class<? extends Annotation> c = (Class)Class.forName("java.lang.annotation.Repeatable");
|
// JDK 7 so use a reflective lookup instead of a class
|
||||||
return c;
|
// literal for Repeatable.class.
|
||||||
|
return Class.forName("java.lang.annotation.Repeatable").asSubclass(Annotation.class);
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
return null;
|
return null;
|
||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue