mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
[uast] [unused declaration] false positive on implicit invoke call on properties (IDEA-295430)
GitOrigin-RevId: 3075f11d592ddbe6e076410ae4982a1f30c67eac
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6e098c4626
commit
ee5d687203
@@ -194,7 +194,12 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
return;
|
||||
}
|
||||
PsiElement psiResolved = null;
|
||||
if (node instanceof UResolvable resolvable) {
|
||||
if (node instanceof UCallExpression callExpression &&
|
||||
"invoke".equals(callExpression.getMethodName()) &&
|
||||
callExpression.getReceiver() instanceof UResolvable resolvable) {
|
||||
psiResolved = resolvable.resolve();
|
||||
}
|
||||
else if (node instanceof UResolvable resolvable) {
|
||||
psiResolved = resolvable.resolve();
|
||||
}
|
||||
else if (node instanceof UBinaryExpression binaryExpression) {
|
||||
@@ -203,9 +208,6 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
else if (node instanceof UUnaryExpression unaryExpression) {
|
||||
psiResolved = unaryExpression.resolveOperator();
|
||||
}
|
||||
if (psiResolved == null) {
|
||||
psiResolved = tryParenthesisOverloading(node);
|
||||
}
|
||||
|
||||
psiResolved = returnToPhysical(psiResolved);
|
||||
RefElement refResolved = refManager.getReference(psiResolved);
|
||||
@@ -398,16 +400,6 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
}
|
||||
}
|
||||
|
||||
private static PsiElement tryParenthesisOverloading(@NotNull UExpression node) {
|
||||
if (node instanceof UCallExpression callExpression && "invoke".equals(callExpression.getMethodName())) {
|
||||
UExpression receiver = callExpression.getReceiver();
|
||||
if (receiver instanceof UResolvable resolvable) {
|
||||
return resolvable.resolve();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void updateRefMethod(PsiElement psiResolved,
|
||||
RefMethodImpl refMethod,
|
||||
@NotNull UExpression uExpression,
|
||||
|
||||
Reference in New Issue
Block a user