changeset 2813:23f0f3c9c44a

8023833: Replace direct use of AnnotatedType in javadoc code Reviewed-by: darcy
author jjg
date Thu, 29 Aug 2013 19:19:23 -0700
parents 96b6865eda94
children 240f424cc0d5
files src/share/classes/com/sun/tools/javadoc/AnnotatedTypeImpl.java src/share/classes/com/sun/tools/javadoc/TypeMaker.java src/share/classes/com/sun/tools/javadoc/TypeVariableImpl.java
diffstat 3 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javadoc/AnnotatedTypeImpl.java	Thu Aug 29 12:11:36 2013 -0700
+++ b/src/share/classes/com/sun/tools/javadoc/AnnotatedTypeImpl.java	Thu Aug 29 19:19:23 2013 -0700
@@ -40,7 +40,7 @@
 public class AnnotatedTypeImpl
         extends AbstractTypeImpl implements AnnotatedType {
 
-    AnnotatedTypeImpl(DocEnv env, com.sun.tools.javac.code.Type.AnnotatedType type) {
+    AnnotatedTypeImpl(DocEnv env, com.sun.tools.javac.code.Type type) {
         super(env, type);
     }
 
@@ -50,7 +50,7 @@
      */
     @Override
     public AnnotationDesc[] annotations() {
-        List<TypeCompound> tas = ((com.sun.tools.javac.code.Type.AnnotatedType)type).typeAnnotations;
+        List<? extends TypeCompound> tas = type.getAnnotationMirrors();
         if (tas == null ||
                 tas.isEmpty()) {
             return new AnnotationDesc[0];
@@ -65,7 +65,7 @@
 
     @Override
     public com.sun.javadoc.Type underlyingType() {
-        return TypeMaker.getType(env, ((com.sun.tools.javac.code.Type.AnnotatedType)type).underlyingType, true, false);
+        return TypeMaker.getType(env, type.unannotatedType(), true, false);
     }
 
     @Override
--- a/src/share/classes/com/sun/tools/javadoc/TypeMaker.java	Thu Aug 29 12:11:36 2013 -0700
+++ b/src/share/classes/com/sun/tools/javadoc/TypeMaker.java	Thu Aug 29 19:19:23 2013 -0700
@@ -63,10 +63,8 @@
             t = env.types.erasure(t);
         }
 
-        if (considerAnnotations &&
-                t.isAnnotated()) {
-            Type.AnnotatedType at = (Type.AnnotatedType) t;
-            return new AnnotatedTypeImpl(env, at);
+        if (considerAnnotations && t.isAnnotated()) {
+            return new AnnotatedTypeImpl(env, t);
         }
 
         switch (t.getTag()) {
@@ -143,8 +141,7 @@
     static String getTypeString(DocEnv env, Type t, boolean full) {
         // TODO: should annotations be included here?
         if (t.isAnnotated()) {
-            Type.AnnotatedType at = (Type.AnnotatedType)t;
-            t = at.underlyingType;
+            t = t.unannotatedType();
         }
         switch (t.getTag()) {
         case ARRAY:
--- a/src/share/classes/com/sun/tools/javadoc/TypeVariableImpl.java	Thu Aug 29 12:11:36 2013 -0700
+++ b/src/share/classes/com/sun/tools/javadoc/TypeVariableImpl.java	Thu Aug 29 19:19:23 2013 -0700
@@ -140,7 +140,7 @@
         if (!type.isAnnotated()) {
             return new AnnotationDesc[0];
         }
-        List<TypeCompound> tas = ((com.sun.tools.javac.code.Type.AnnotatedType) type).typeAnnotations;
+        List<? extends TypeCompound> tas = type.getAnnotationMirrors();
         AnnotationDesc res[] = new AnnotationDesc[tas.length()];
         int i = 0;
         for (Attribute.Compound a : tas) {