langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java
changeset 3541 46fcb9a809a6
parent 3540 dceac8629a56
child 5520 86e4b9a9da40
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Thu Jul 30 10:30:10 2009 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Thu Jul 30 10:30:24 2009 +0100
@@ -524,10 +524,16 @@
         @Override
         public Void visitTypeVar(TypeVar t, Void ignored) {
             if (indexOf(t, WhereClauseKind.TYPEVAR) == -1) {
+                //access the bound type and skip error types
                 Type bound = t.bound;
                 while ((bound instanceof ErrorType))
                     bound = ((ErrorType)bound).getOriginalType();
-                List<Type> bounds  = types.getBounds(t);
+                //retrieve the bound list - if the type variable
+                //has not been attributed the bound is not set
+                List<Type> bounds = bound != null ?
+                    types.getBounds(t) :
+                    List.<Type>nil();
+
                 nameSimplifier.addUsage(t.tsym);
 
                 boolean boundErroneous = bounds.head == null ||