From 24cd3f09fd9b73c2381dee95c03e5e27937d813e Mon Sep 17 00:00:00 2001 From: anna Date: Sun, 24 Nov 2013 12:25:55 +0100 Subject: [PATCH] wildcards inside: fix for intersection types [^roma] (cherry picked from commit 6e88ca6de6e921f45f069a34d1e48f5566d362a1) --- .../intellij/psi/util/TypeConversionUtil.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) 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; } }