mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
getTopLevelExpression: avoid going past method call
GitOrigin-RevId: 8bf2b1e2a66d14d0ee0a383e6f873abcbd70f593
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ebc21df014
commit
503821f46c
@@ -141,6 +141,15 @@ public final class JavaI18nUtil extends I18nUtil {
|
||||
}
|
||||
expression = parent;
|
||||
if (UastExpressionUtils.isAssignment(expression)) break;
|
||||
if (expression instanceof UCallExpression) {
|
||||
UastCallKind kind = ((UCallExpression)expression).getKind();
|
||||
if (kind == UastCallKind.METHOD_CALL) {
|
||||
if (expression.getUastParent() instanceof UQualifiedReferenceExpression) {
|
||||
expression = (UExpression)expression.getUastParent();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return expression;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,12 @@ class StringMethods {
|
||||
if ("foo".equals(foo)) {}
|
||||
if ("foo".equalsIgnoreCase(foo)) {}
|
||||
}
|
||||
|
||||
void testBooleanOp() {
|
||||
String foo = getFoo();
|
||||
if (!foo.equals("foo")) {}
|
||||
if (foo.startsWith("foo") && foo.endsWith("foo")) {}
|
||||
}
|
||||
|
||||
void testUnresolved() {
|
||||
String foo = <error descr="Cannot resolve method 'getUnresolved' in 'StringMethods'">getUnresolved</error>();
|
||||
|
||||
Reference in New Issue
Block a user