mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-02 14:20:55 +07:00
ConvertSwitchToIfTest: test5 rewritten as getClass() is now pure
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
// "Replace 'switch' with 'if'" "true"
|
||||
class Test {
|
||||
void foo(Object e) {
|
||||
Class<?> i = e.getClass();
|
||||
abstract class Test {
|
||||
abstract Object getObject();
|
||||
|
||||
void foo() {
|
||||
Class<?> i = getObject().getClass();
|
||||
if (i.equals(RuntimeException.class)) {
|
||||
} else if (i.equals(IOException.class)) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user