diff --git a/java/java-psi-api/src/com/intellij/psi/util/TypeConversionUtil.java b/java/java-psi-api/src/com/intellij/psi/util/TypeConversionUtil.java index c6003b7ccfc9..926b88b4b4d6 100644 --- a/java/java-psi-api/src/com/intellij/psi/util/TypeConversionUtil.java +++ b/java/java-psi-api/src/com/intellij/psi/util/TypeConversionUtil.java @@ -993,16 +993,8 @@ public class TypeConversionUtil { } } - private static boolean containsWildcards(@NotNull PsiType leftBound) { - final WildcardDetector wildcardDetector = new WildcardDetector(); - if (leftBound instanceof PsiIntersectionType) { - for (PsiType conjunctType :((PsiIntersectionType)leftBound).getConjuncts()) { - if (!conjunctType.accept(wildcardDetector)) return false; - } - return true; - } - - return leftBound.accept(wildcardDetector); + public static boolean containsWildcards(@NotNull PsiType leftBound) { + return leftBound.accept(new WildcardDetector()); } @Nullable @@ -1846,9 +1838,17 @@ public class TypeConversionUtil { return arrayType.getComponentType().accept(this); } + @Nullable + @Override + public Boolean visitIntersectionType(PsiIntersectionType intersectionType) { + for (PsiType psiType : intersectionType.getConjuncts()) { + if (psiType.accept(this)) return true; + } + return false; + } + @Override public Boolean visitType(PsiType type) { - //todo intersection types return false; } }