< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.java

Print this page
@@ -232,10 +232,22 @@
              buf.append(className(t, false, locale));
          } else {
              buf.append(printAnnotations(t));
              buf.append(className(t, true, locale));
          }
+         try {
+             if (t.isReferenceProjection()) {
+                 buf.append('.');
+                 buf.append(t.tsym.name.table.names.ref);
+             } else if (t.isValueProjection()) {
+                 buf.append('.');
+                 buf.append(t.tsym.name.table.names.val);
+             }
+         } catch (CompletionFailure cf) {
+             // don't let missing types capsize the boat.
+         }
+ 
          if (t.getTypeArguments().nonEmpty()) {
              buf.append('<');
              buf.append(visitTypes(t.getTypeArguments(), locale));
              buf.append('>');
          }

@@ -316,15 +328,19 @@
              } else {
                  s = localize(locale, "compiler.misc.anonymous.class",
                          visit(norm.supertype_field, locale));
              }
              return s;
-         } else if (longform) {
-             return sym.getQualifiedName().toString();
+         }
+         String s;
+         if (longform) {
+              s =  sym.getQualifiedName().toString();
          } else {
-             return sym.name.toString();
+             s =  sym.name.toString();
          }
+ 
+         return s;
      }
  
      /**
       * Converts a set of method argument types into their corresponding
       * localized string representation.
< prev index next >