mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
method refs: mark method as registered in RefCountHolder
This commit is contained in:
+10
@@ -967,6 +967,16 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
|
||||
@Override
|
||||
public void visitMethodReferenceExpression(PsiMethodReferenceExpression expression) {
|
||||
myHolder.add(HighlightUtil.checkMethodReferencesFeature(expression));
|
||||
JavaResolveResult result;
|
||||
try {
|
||||
result = expression.advancedResolve(true);
|
||||
}
|
||||
catch (IndexNotReadyException e) {
|
||||
return;
|
||||
}
|
||||
if (myRefCountHolder != null) {
|
||||
myRefCountHolder.registerReference(expression, result);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
class C {
|
||||
interface Simplest {
|
||||
void m();
|
||||
}
|
||||
private static void simplest1() { }
|
||||
private static void <warning descr="Private method 'simplest()' is never used">simplest</warning>() { }
|
||||
|
||||
public static void main(String[] args) {
|
||||
Simplest o = C::simplest1;
|
||||
System.out.println(o);
|
||||
}
|
||||
}
|
||||
+1
@@ -160,5 +160,6 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
|
||||
public void testClassLiteral() throws Exception { doTest(false, false); }
|
||||
public void testExtensionMethods() throws Exception { doTest(false, false); }
|
||||
public void testMethodReferences() throws Exception { doTest(false, true, false); }
|
||||
public void testUsedMethodsByMethodReferences() throws Exception { doTest(true, true, false); }
|
||||
public void testLambdaExpressions() throws Exception { doTest(false, true, false); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user