diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiResolveHelperImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiResolveHelperImpl.java index 1162f18a00e2..d24bfd9ff654 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiResolveHelperImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiResolveHelperImpl.java @@ -863,7 +863,7 @@ public class PsiResolveHelperImpl implements PsiResolveHelper { PsiType patternType, final ConstraintType constraintType, final int depth) { - if (arg instanceof PsiCapturedWildcardType) arg = ((PsiCapturedWildcardType)arg).getWildcard(); //reopen + if (arg instanceof PsiCapturedWildcardType && (depth < 2 || constraintType != ConstraintType.EQUALS)) arg = ((PsiCapturedWildcardType)arg).getWildcard(); //reopen if (patternType.equals(param)) { return processArgType(arg, constraintType, depth < 2); diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57311.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57311.java index 2be9a4f1e4ff..9ed409cfc19f 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57311.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57311.java @@ -4,7 +4,7 @@ class A { } void bar(A x){ - baz(x.foo()); + baz(x.foo()); } void baz(A> x){} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57439.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57439.java new file mode 100644 index 000000000000..544d6c16a605 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57439.java @@ -0,0 +1,43 @@ +class A {} + +class B extends A> { + void bar(B b, B eb, B sb, B s) { + foo(b); + foo(eb); + foo(sb); + foo(s); + + foo1(b); + foo1(eb); + foo1(sb); + foo1(s); + + foo2(b); + foo2(eb); + foo2(sb); + foo2(s); + + foo3(b); + foo3(eb); + foo3(sb); + foo3(s); + + foo4(b); + foo4(eb); + foo4(sb); + foo4(s); + + foo5(b); + foo5(eb); + foo5(sb); + foo5(s); + } + + + void foo(A> x) {} + void foo1(A> x) {} + void foo2(A> x) {} + void foo3(A> x) {} + void foo4(A> x) {} + void foo5(A> x) {} +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java index 3abcc3c5536d..37ba2afb34a1 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java @@ -307,6 +307,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase { public void testIDEA109556() { doTest5(false); } public void testIDEA107440() { doTest5(false); } public void testIDEA57289() { doTest5(false); } + public void testIDEA57439() { doTest5(false); } public void testJavaUtilCollections_NoVerify() throws Exception { PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));