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

changeset 1598
7ac9242d2ca6
parent 1587
f1f605f85850
child 1600
3fef0cae83b3
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Feb 21 15:23:48 2013 +0000
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Feb 21 15:25:03 2013 +0000
     1.3 @@ -580,7 +580,17 @@
     1.4              for (Type t : formalInterface.getTypeArguments()) {
     1.5                  if (actualTypeargs.head.hasTag(WILDCARD)) {
     1.6                      WildcardType wt = (WildcardType)actualTypeargs.head;
     1.7 -                    typeargs.append(wt.type);
     1.8 +                    Type bound;
     1.9 +                    switch (wt.kind) {
    1.10 +                        case UNBOUND:
    1.11 +                            //use declared bound if it doesn't depend on formal type-args
    1.12 +                            bound = wt.bound.bound.containsAny(formalInterface.getTypeArguments()) ?
    1.13 +                                    syms.objectType : wt.bound.bound;
    1.14 +                            break;
    1.15 +                        default:
    1.16 +                            bound = wt.type;
    1.17 +                    }
    1.18 +                    typeargs.append(bound);
    1.19                  } else {
    1.20                      typeargs.append(actualTypeargs.head);
    1.21                  }

mercurial