Пример #1
0
 @Override
 public String visitClassType(ClassType t, Locale locale) {
   StringBuilder buf = new StringBuilder();
   if (t.getEnclosingType().tag == CLASS && t.tsym.owner.kind == Kinds.TYP) {
     buf.append(visit(t.getEnclosingType(), locale));
     buf.append('.');
     buf.append(className(t, false, locale));
   } else {
     buf.append(className(t, true, locale));
   }
   if (t.getTypeArguments().nonEmpty()) {
     buf.append('<');
     buf.append(visitTypes(t.getTypeArguments(), locale));
     buf.append('>');
   }
   return buf.toString();
 }
 @Override
 public Void visitClassType(ClassType t, Void ignored) {
   if (t.isCompound()) {
     if (indexOf(t, WhereClauseKind.INTERSECTION) == -1) {
       Type supertype = types.supertype(t);
       List<Type> interfaces = types.interfaces(t);
       JCDiagnostic d =
           diags.fragment("where.intersection", t, interfaces.prepend(supertype));
       whereClauses.get(WhereClauseKind.INTERSECTION).put(t, d);
       visit(supertype);
       visit(interfaces);
     }
   }
   nameSimplifier.addUsage(t.tsym);
   visit(t.getTypeArguments());
   if (t.getEnclosingType() != Type.noType) visit(t.getEnclosingType());
   return null;
 }