Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/unwrapIfStatement/beforeDoWhileWithSideEffects.java
Tagir Valeev 0b3fd46151 Simplify boolean expression improvements
1. Add "may change semantics" when side-effect cannot be extracted
2. Use condition reporting (instead of constant value reporting) for non-short-circuiting & and | (fixes IDEA-216245)
3. Use SimplifyBooleanExpressionFix for boolean constant value instead of replace fix.

GitOrigin-RevId: f3e63a75bd92a7305e36fce58bf9e34bdbb03c51
2019-07-02 06:52:16 +03:00

16 lines
367 B
Java

// "Unwrap 'do-while' statement (may change semantics)" "true"
import org.jetbrains.annotations.Contract;
class X {
@Contract("_ -> true")
boolean test(Object obj) {
return true;
}
void doSmth(Object obj) {
do {
System.out.println("aaahh");
}
while(obj <caret>!= null && test(obj) && obj == null);
}
}