38 * @since 1.8 |
38 * @since 1.8 |
39 */ |
39 */ |
40 public class AnnotatedTypeImpl |
40 public class AnnotatedTypeImpl |
41 extends AbstractTypeImpl implements AnnotatedType { |
41 extends AbstractTypeImpl implements AnnotatedType { |
42 |
42 |
43 AnnotatedTypeImpl(DocEnv env, com.sun.tools.javac.code.Type.AnnotatedType type) { |
43 AnnotatedTypeImpl(DocEnv env, com.sun.tools.javac.code.Type type) { |
44 super(env, type); |
44 super(env, type); |
45 } |
45 } |
46 |
46 |
47 /** |
47 /** |
48 * Get the annotations of this program element. |
48 * Get the annotations of this program element. |
49 * Return an empty array if there are none. |
49 * Return an empty array if there are none. |
50 */ |
50 */ |
51 @Override |
51 @Override |
52 public AnnotationDesc[] annotations() { |
52 public AnnotationDesc[] annotations() { |
53 List<TypeCompound> tas = ((com.sun.tools.javac.code.Type.AnnotatedType)type).typeAnnotations; |
53 List<? extends TypeCompound> tas = type.getAnnotationMirrors(); |
54 if (tas == null || |
54 if (tas == null || |
55 tas.isEmpty()) { |
55 tas.isEmpty()) { |
56 return new AnnotationDesc[0]; |
56 return new AnnotationDesc[0]; |
57 } |
57 } |
58 AnnotationDesc res[] = new AnnotationDesc[tas.length()]; |
58 AnnotationDesc res[] = new AnnotationDesc[tas.length()]; |