Do not process unknown tokens when simplifying the polyadic expression

Fixes IDEA-246008 "Constant condition" Inspection quick fix removes boolean value from string concatenation when between two values

GitOrigin-RevId: 635e6b5f0b0a102d9c1ddecbbf54315b9b52f2dd
This commit is contained in:
Tagir Valeev
2020-07-20 10:23:20 +00:00
committed by intellij-monorepo-bot
parent bd6468726d
commit 55ad5be04b
3 changed files with 27 additions and 4 deletions
@@ -0,0 +1,9 @@
// "Simplify 'b' to true" "true"
class A {
void foo(boolean b) {
if (b) {
String s = "foo" + true + "bar";
}
}
}
@@ -0,0 +1,9 @@
// "Simplify 'b' to true" "true"
class A {
void foo(boolean b) {
if (b) {
String s = "foo" + <caret>b + "bar";
}
}
}