mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:20:53 +07:00
Fixes IDEA-219791 Inlining a method returning a ternary expression depending on boolean parameter could automatically simplify the expression Also disable silent semantics change in boolean expression simplifications GitOrigin-RevId: 765fcecedd7f57530feb9a725b7d6cc7bfd7347a
31 lines
590 B
Java
31 lines
590 B
Java
import java.util.*;
|
|
|
|
class Test1 {
|
|
private void foo() {
|
|
compute(true);
|
|
}
|
|
|
|
private void bar() {
|
|
compute(false);
|
|
}
|
|
|
|
private void comp<caret>ute(boolean mode) {
|
|
for(int i=0; i<10; i++) {
|
|
if (i % 2 == mode) {
|
|
System.out.println("foo");
|
|
}
|
|
if (mode) {
|
|
System.out.println("bar");
|
|
} else {
|
|
System.out.println("baz");
|
|
}
|
|
}
|
|
System.out.println(mode);
|
|
Set<String> set = new HashSet<>();
|
|
if (set.add(foo) && mode) {
|
|
System.out.println("hello");
|
|
} else {
|
|
System.out.println("goodbye");
|
|
}
|
|
}
|
|
} |