mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-31 19:50:55 +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
36 lines
791 B
Plaintext
36 lines
791 B
Plaintext
import java.util.*;
|
|
|
|
class Test1 {
|
|
private void foo() {
|
|
for(int i=0; i<10; i++) {
|
|
if (i % 2) {
|
|
System.out.println("foo");
|
|
}
|
|
System.out.println("bar");
|
|
}
|
|
System.out.println(true);
|
|
Set<String> set = new HashSet<>();
|
|
if (set.add(foo)) {
|
|
System.out.println("hello");
|
|
} else {
|
|
System.out.println("goodbye");
|
|
}
|
|
}
|
|
|
|
private void bar() {
|
|
for(int i=0; i<10; i++) {
|
|
if (!(i % 2)) {
|
|
System.out.println("foo");
|
|
}
|
|
System.out.println("baz");
|
|
}
|
|
System.out.println(false);
|
|
Set<String> set = new HashSet<>();
|
|
if (set.add(foo) && false) {
|
|
System.out.println("hello");
|
|
} else {
|
|
System.out.println("goodbye");
|
|
}
|
|
}
|
|
|
|
} |