1.1 --- a/src/share/classes/com/sun/tools/javac/code/Type.java Mon Aug 16 14:56:23 2010 +0100 1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Type.java Mon Aug 16 14:58:10 2010 +0100 1.3 @@ -347,11 +347,17 @@ 1.4 return false; 1.5 } 1.6 1.7 - /** Does this type contain an occurrence of some type in `elems'? 1.8 + /** Does this type contain an occurrence of some type in 'ts'? 1.9 */ 1.10 - public boolean containsSome(List<Type> ts) { 1.11 - for (List<Type> l = ts; l.nonEmpty(); l = l.tail) 1.12 - if (this.contains(ts.head)) return true; 1.13 + public boolean containsAny(List<Type> ts) { 1.14 + for (Type t : ts) 1.15 + if (this.contains(t)) return true; 1.16 + return false; 1.17 + } 1.18 + 1.19 + public static boolean containsAny(List<Type> ts1, List<Type> ts2) { 1.20 + for (Type t : ts1) 1.21 + if (t.containsAny(ts2)) return true; 1.22 return false; 1.23 } 1.24 1.25 @@ -431,6 +437,10 @@ 1.26 this.bound = bound; 1.27 } 1.28 1.29 + public boolean contains(Type t) { 1.30 + return kind != UNBOUND && type.contains(t); 1.31 + } 1.32 + 1.33 public boolean isSuperBound() { 1.34 return kind == SUPER || 1.35 kind == UNBOUND; 1.36 @@ -681,7 +691,9 @@ 1.37 return 1.38 elem == this 1.39 || (isParameterized() 1.40 - && (getEnclosingType().contains(elem) || contains(getTypeArguments(), elem))); 1.41 + && (getEnclosingType().contains(elem) || contains(getTypeArguments(), elem))) 1.42 + || (isCompound() 1.43 + && (supertype_field.contains(elem) || contains(interfaces_field, elem))); 1.44 } 1.45 1.46 public void complete() {