projects
/
idea
/
community.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d46ab6c
)
method refs: ensure non-resolved method refs are not marked as exact (EA-59172 -...
author
Anna Kozlova
<anna.kozlova@jetbrains.com>
Wed, 25 Feb 2015 19:20:13 +0000
(20:20 +0100)
committer
Anna Kozlova
<anna.kozlova@jetbrains.com>
Wed, 25 Feb 2015 19:34:39 +0000
(20:34 +0100)
java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiMethodReferenceExpressionImpl.java
patch
|
blob
|
history
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/EnsureNotResolvedMethodRefsAreNotMarkedAsExact.java
[new file with mode: 0644]
patch
|
blob
java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java
patch
|
blob
|
history
diff --git
a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiMethodReferenceExpressionImpl.java
b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiMethodReferenceExpressionImpl.java
index e640caf1f80269babb03fa9d12eccadb10b1d7fc..60b3b5f9bcee8d253efbbfeb7ceea2a282ecad26 100644
(file)
--- a/
java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiMethodReferenceExpressionImpl.java
+++ b/
java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiMethodReferenceExpressionImpl.java
@@
-151,6
+151,10
@@
public class PsiMethodReferenceExpressionImpl extends PsiReferenceExpressionBase
result.add(signature.getMethod());
}
}
+
+ if (result.isEmpty()) {
+ return null;
+ }
methods = result.toArray(new PsiMethod[result.size()]);
}
else if (isConstructor()) {
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/EnsureNotResolvedMethodRefsAreNotMarkedAsExact.java
b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/EnsureNotResolvedMethodRefsAreNotMarkedAsExact.java
new file mode 100644
(file)
index 0000000..
e6d5ecf
--- /dev/null
+++ b/
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/EnsureNotResolvedMethodRefsAreNotMarkedAsExact.java
@@ -0,0
+1,10
@@
+import java.util.function.Function;
+
+class Test<A> {
+ class P {
+ {
+ g(P::<error descr="Cannot resolve method 'aa'">aa</error>);
+ }
+ }
+ <R> void g(Function<R, String> r){}
+}
\ No newline at end of file
diff --git
a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java
b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java
index dad206251e3e56a9c9a567a55a41f1c734a4ad50..c4338babb5a50351d67b77d423671a9fad233e5f 100644
(file)
--- a/
java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java
+++ b/
java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java
@@
-386,6
+386,10
@@
public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
doTest();
}
+ public void testEnsureNotResolvedMethodRefsAreNotMarkedAsExact() throws Exception {
+ doTest();
+ }
+
private void doTest() {
doTest(false);
}