src/share/classes/com/sun/tools/javac/code/Type.java

changeset 789
878c8f760ded
parent 640
995bcdb9a41d
child 795
7b99f98b3035
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Type.java	Fri Dec 10 07:38:28 2010 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Type.java	Sun Dec 12 10:05:40 2010 -0800
     1.3 @@ -245,7 +245,7 @@
     1.4      public String argtypes(boolean varargs) {
     1.5          List<Type> args = getParameterTypes();
     1.6          if (!varargs) return args.toString();
     1.7 -        StringBuffer buf = new StringBuffer();
     1.8 +        StringBuilder buf = new StringBuilder();
     1.9          while (args.tail.nonEmpty()) {
    1.10              buf.append(args.head);
    1.11              args = args.tail;
    1.12 @@ -935,7 +935,7 @@
    1.13  
    1.14      public static class TypeVar extends Type implements TypeVariable {
    1.15  
    1.16 -        /** The bound of this type variable; set from outside.
    1.17 +        /** The upper bound of this type variable; set from outside.
    1.18           *  Must be nonempty once it is set.
    1.19           *  For a bound, `bound' is the bound type itself.
    1.20           *  Multiple bounds are expressed as a single class type which has the
    1.21 @@ -946,6 +946,12 @@
    1.22           *  points to the first class or interface bound.
    1.23           */
    1.24          public Type bound = null;
    1.25 +
    1.26 +        /** The lower bound of this type variable.
    1.27 +         *  TypeVars don't normally have a lower bound, so it is normally set
    1.28 +         *  to syms.botType.
    1.29 +         *  Subtypes, such as CapturedType, may provide a different value.
    1.30 +         */
    1.31          public Type lower;
    1.32  
    1.33          public TypeVar(Name name, Symbol owner, Type lower) {
    1.34 @@ -965,10 +971,12 @@
    1.35              return v.visitTypeVar(this, s);
    1.36          }
    1.37  
    1.38 +        @Override
    1.39          public Type getUpperBound() { return bound; }
    1.40  
    1.41          int rank_field = -1;
    1.42  
    1.43 +        @Override
    1.44          public Type getLowerBound() {
    1.45              return lower;
    1.46          }
    1.47 @@ -992,7 +1000,6 @@
    1.48       */
    1.49      public static class CapturedType extends TypeVar {
    1.50  
    1.51 -        public Type lower;
    1.52          public WildcardType wildcard;
    1.53  
    1.54          public CapturedType(Name name,
    1.55 @@ -1012,10 +1019,6 @@
    1.56              return v.visitCapturedType(this, s);
    1.57          }
    1.58  
    1.59 -        public Type getLowerBound() {
    1.60 -            return lower;
    1.61 -        }
    1.62 -
    1.63          @Override
    1.64          public boolean isCaptured() {
    1.65              return true;

mercurial