UnrollLoopAction: fixes according to review IDEA-CR-24513

1. Check that loop parameter is not written
2. Support List.of, Collections.singleton, Collections.singletonList
3. Support if w/o braces
4. Support break not in last position
This commit is contained in:
Tagir Valeev
2017-09-18 16:37:40 +07:00
parent 8928ef54a4
commit 7345e8b0ef
19 changed files with 264 additions and 30 deletions
@@ -0,0 +1,19 @@
// "Unroll loop" "true"
class Test {
void test() {
if (!(Math.random() > 0.5)) {
System.out.println((Object) "one");
if (!(Math.random() > 0.5)) {
System.out.println((Object) 1);
if (!(Math.random() > 0.5)) {
System.out.println((Object) 1.0);
if (!(Math.random() > 0.5)) {
System.out.println((Object) 1.0f);
}
}
}
}
}
void foo(boolean b) {}
}