src/share/classes/com/sun/tools/javadoc/ParameterizedTypeImpl.java

changeset 1374
c002fdee76fd
parent 1359
25e14ad23cef
child 2525
2eb010b6cb22
equal deleted inserted replaced
1373:4a1c57a1c410 1374:c002fdee76fd
29 29
30 import com.sun.tools.javac.code.Symbol.ClassSymbol; 30 import com.sun.tools.javac.code.Symbol.ClassSymbol;
31 import com.sun.tools.javac.code.Type; 31 import com.sun.tools.javac.code.Type;
32 import com.sun.tools.javac.code.Type.ClassType; 32 import com.sun.tools.javac.code.Type.ClassType;
33 33
34 import static com.sun.tools.javac.code.TypeTags.*; 34 import static com.sun.tools.javac.code.TypeTag.CLASS;
35 35
36 36
37 /** 37 /**
38 * Implementation of <code>ParameterizedType</code>, which 38 * Implementation of <code>ParameterizedType</code>, which
39 * represents an invocation of a generic class or interface. 39 * represents an invocation of a generic class or interface.
93 /** 93 /**
94 * Return the type that contains this type as a member. 94 * Return the type that contains this type as a member.
95 * Return null is this is a top-level type. 95 * Return null is this is a top-level type.
96 */ 96 */
97 public com.sun.javadoc.Type containingType() { 97 public com.sun.javadoc.Type containingType() {
98 if (type.getEnclosingType().tag == CLASS) { 98 if (type.getEnclosingType().hasTag(CLASS)) {
99 // This is the type of an inner class. 99 // This is the type of an inner class.
100 return TypeMaker.getType(env, type.getEnclosingType()); 100 return TypeMaker.getType(env, type.getEnclosingType());
101 } 101 }
102 ClassSymbol enclosing = type.tsym.owner.enclClass(); 102 ClassSymbol enclosing = type.tsym.owner.enclClass();
103 if (enclosing != null) { 103 if (enclosing != null) {
132 boolean full) { 132 boolean full) {
133 if (env.legacyDoclet) { 133 if (env.legacyDoclet) {
134 return TypeMaker.getTypeName(cl, full); 134 return TypeMaker.getTypeName(cl, full);
135 } 135 }
136 StringBuilder s = new StringBuilder(); 136 StringBuilder s = new StringBuilder();
137 if (cl.getEnclosingType().tag != CLASS) { // if not an inner class... 137 if (!(cl.getEnclosingType().hasTag(CLASS))) { // if not an inner class...
138 s.append(TypeMaker.getTypeName(cl, full)); 138 s.append(TypeMaker.getTypeName(cl, full));
139 } else { 139 } else {
140 ClassType encl = (ClassType)cl.getEnclosingType(); 140 ClassType encl = (ClassType)cl.getEnclosingType();
141 s.append(parameterizedTypeToString(env, encl, full)) 141 s.append(parameterizedTypeToString(env, encl, full))
142 .append('.') 142 .append('.')

mercurial