IDEA-151356 Simplifying known true/false conditions should remove unnecessary parentheses

This commit is contained in:
peter
2016-02-10 10:59:06 +01:00
parent 1b6d4b8701
commit 97c4d325e2
3 changed files with 32 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
// "Simplify boolean expression" "true"
package test;
public class TestSimplifyIf
{
void test() {
String str = "";
if (str.equals("hello") && !str.equals("foo")) {
// Nothing
}
}
}

View File

@@ -0,0 +1,12 @@
// "Simplify boolean expression" "true"
package test;
public class TestSimplifyIf
{
void test() {
String str = "";
if ((<caret>false || str.equals("hello")) && !str.equals("foo")) {
// Nothing
}
}
}