Bug 573358 - [AutoRefactor #83/153] Pull out if from an if/else
Moves an inner if condition around the outer if condition:
- The inner if condition should be common to both if/else clauses of
the outer if statement,
- The if conditions should be passive.
Given:
if (b1) {
if (b2) {
System.out.println("foo");
}
} else {
if (b2) {
System.out.println("bar");
}
}
When:
Applying "Pull out a duplicate 'if' from an if/else" clean up...
Then:
if (b2) {
if (b1) {
System.out.println("foo");
} else {
System.out.println("bar");
}
}
Change-Id: If1d0e3a880ed27c112a62020b3dd7fc3dc73c557
Signed-off-by: Fabrice Tiercelin <fabrice.tiercelin@yahoo.fr>
Depends-On: I2908d6433760691b61d227804c7854044c4851c2
4 files changed