mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
ParameterNullityInference: strip parentheses & casts
GitOrigin-RevId: 9ef33b55c4fc088c214d279f198b48695a4a2fb2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fabef32ef5
commit
40e73aab84
@@ -162,12 +162,13 @@ private fun dereference(tree: LighterAST,
|
||||
canBeNulls: HashSet<String>,
|
||||
notNulls: HashSet<String>,
|
||||
queue: ArrayDeque<LighterASTNode>) {
|
||||
if (expression == null) return
|
||||
if (expression.tokenType == REFERENCE_EXPRESSION && JavaLightTreeUtil.findExpressionChild(tree, expression) == null) {
|
||||
JavaLightTreeUtil.getNameIdentifierText(tree, expression)?.takeIf(canBeNulls::remove)?.let(notNulls::add)
|
||||
val stripped = JavaLightTreeUtil.skipParenthesesDown(tree, expression)
|
||||
if (stripped == null) return
|
||||
if (stripped.tokenType == REFERENCE_EXPRESSION && JavaLightTreeUtil.findExpressionChild(tree, stripped) == null) {
|
||||
JavaLightTreeUtil.getNameIdentifierText(tree, stripped)?.takeIf(canBeNulls::remove)?.let(notNulls::add)
|
||||
}
|
||||
else {
|
||||
queue.addFirst(expression)
|
||||
queue.addFirst(stripped)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user