add convert switch to if for invalid switch types (IDEA-81580)

This commit is contained in:
anna
2012-02-23 11:50:19 +01:00
parent 519ccb6024
commit 9c91d9374f
13 changed files with 565 additions and 295 deletions
@@ -0,0 +1,8 @@
// "Replace 'switch' with 'if'" "true"
class Test {
void foo(float f) {
if (f == 0) {
System.out.println(f);
}
}
}
@@ -0,0 +1,9 @@
// "Replace 'switch' with 'if'" "true"
class Test {
void foo(float f) {
switch (f<caret>) {
case 0:
System.out.println(f);
}
}
}
@@ -0,0 +1,7 @@
// "Replace 'switch' with 'if'" "false"
class Test {
void foo(float f) {
switch (f<caret>) {
}
}
}
@@ -0,0 +1,8 @@
// "Replace 'switch' with 'if'" "false"
class Test {
void foo(float f) {
switch (f<caret>) {
case
}
}
}