mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
java null argument index: add heuristic to don't process leaves that must not be valid arguments
GitOrigin-RevId: 6e8c3eb1c86cba8a3e4d60b5f983a4e6d77bcec2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ce39522a4d
commit
d730fa522b
@@ -79,6 +79,26 @@ public class JavaNullMethodArgumentIndex extends ScalarIndexExtension<JavaNullMe
|
||||
};
|
||||
}
|
||||
|
||||
private static boolean containsStopSymbol(int startIndex, @NotNull CharSequence text, boolean leftDirection) {
|
||||
int i = startIndex;
|
||||
while (true) {
|
||||
|
||||
if (leftDirection) i--; else i++;
|
||||
|
||||
if (leftDirection) {
|
||||
if (i < 0) return false;
|
||||
} else {
|
||||
if (i >= text.length()) return false;
|
||||
}
|
||||
|
||||
char c = text.charAt(i);
|
||||
if (Lazy.STOP_SYMBOLS.contains(c)) return true;
|
||||
if (!Lazy.WHITE_SPACE_OR_EOL_SYMBOLS.contains(c) && !Character.isWhitespace(c)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Set<LighterASTNode> findCallsWithNulls(@NotNull LighterAST lighterAst,
|
||||
@NotNull CharSequence text) {
|
||||
|
||||
Reference in New Issue
Block a user