File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1267,11 +1267,14 @@ protected List<Pair<TypeBinding>> allSuperPairsWithCommonGenericType(TypeBinding
12671267 if (s == null || s .id == TypeIds .T_JavaLangObject || t == null || t .id == TypeIds .T_JavaLangObject )
12681268 return Collections .emptyList ();
12691269 List <Pair <TypeBinding >> result = new ArrayList <>();
1270- if (TypeBinding .equalsEquals (s .original (), t .original ())) {
1270+ if (s .isParameterizedType () && t .isParameterizedType () // optimization #1: clients of this method only want to compare type arguments
1271+ && TypeBinding .equalsEquals (s .original (), t .original ())) {
12711272 result .add (new Pair <>(s , t ));
12721273 }
1274+ if (TypeBinding .equalsEquals (s , t ))
1275+ return result ; // optimization #2: nothing interesting above equal types
12731276 TypeBinding tSuper = t .findSuperTypeOriginatingFrom (s );
1274- if (tSuper != null ) {
1277+ if (tSuper != null && s . isParameterizedType () && tSuper . isParameterizedType ()) { // optimization #1 again
12751278 result .add (new Pair <>(s , tSuper ));
12761279 }
12771280 result .addAll (allSuperPairsWithCommonGenericType (s .superclass (), t ));
You can’t perform that action at this time.
0 commit comments