Skip to content

Commit

Permalink
Guard lookup in BoundSet::allSuperPairsWithCommonGenericTypeRecursive
Browse files Browse the repository at this point in the history
Contributes to
#3327
  • Loading branch information
fedejeanne committed Dec 6, 2024
1 parent 7a31ab7 commit 7f8c6f0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1279,8 +1279,9 @@ private List<Pair<TypeBinding>> allSuperPairsWithCommonGenericTypeRecursive(Type
}
if (TypeBinding.equalsEquals(s, t))
return result; // optimization #2: nothing interesting above equal types
TypeBinding tSuper = t.findSuperTypeOriginatingFrom(s);
if (tSuper != null && s.isParameterizedType() && tSuper.isParameterizedType()) { // optimization #1 again

TypeBinding tSuper = s.isParameterizedType() ? t.findSuperTypeOriginatingFrom(s) : null;
if (tSuper != null && tSuper.isParameterizedType()) { // optimization #1 again
result.add(new Pair<>(s, tSuper));
}
result.addAll(allSuperPairsWithCommonGenericTypeRecursive(s.superclass(), t, visited));
Expand Down

0 comments on commit 7f8c6f0

Please sign in to comment.