IDEA-127499 Decompiler doesn't support switch over enums
This commit is contained in:
Binary file not shown.
Binary file not shown.
BIN
testData/classes/pkg/TestSwitchOnStrings.class
Normal file
BIN
testData/classes/pkg/TestSwitchOnStrings.class
Normal file
Binary file not shown.
@@ -5,27 +5,32 @@ import java.util.concurrent.TimeUnit;
|
||||
public class TestSwitchOnEnum {
|
||||
int myInt;
|
||||
|
||||
public void testSOE(TimeUnit var1) {
|
||||
switch(null.$SwitchMap$java$util$concurrent$TimeUnit[var1.ordinal()]) {// 12
|
||||
case 1:
|
||||
return;// 14
|
||||
public int testSOE(TimeUnit t) {
|
||||
switch(t) {// 14
|
||||
case MICROSECONDS:
|
||||
return 2;// 16
|
||||
case SECONDS:
|
||||
return 1;// 18
|
||||
default:
|
||||
return 0;// 20
|
||||
}
|
||||
}// 16
|
||||
}
|
||||
}
|
||||
|
||||
class 'pkg/TestSwitchOnEnum' {
|
||||
method 'testSOE (Ljava/util/concurrent/TimeUnit;)V' {
|
||||
0 8
|
||||
4 8
|
||||
7 8
|
||||
method 'testSOE (Ljava/util/concurrent/TimeUnit;)I' {
|
||||
8 8
|
||||
1c 10
|
||||
1d 13
|
||||
24 10
|
||||
25 10
|
||||
26 12
|
||||
27 12
|
||||
28 14
|
||||
29 14
|
||||
}
|
||||
}
|
||||
|
||||
Lines mapping:
|
||||
12 <-> 9
|
||||
14 <-> 11
|
||||
16 <-> 14
|
||||
14 <-> 9
|
||||
16 <-> 11
|
||||
18 <-> 13
|
||||
20 <-> 15
|
||||
|
||||
13
testData/results/TestSwitchOnStrings.dec
Normal file
13
testData/results/TestSwitchOnStrings.dec
Normal file
@@ -0,0 +1,13 @@
|
||||
package pkg;
|
||||
|
||||
public class TestSwitchOnStrings {
|
||||
public int testSOE(String s) {
|
||||
switch (s) {
|
||||
case "xxx":
|
||||
return 2;
|
||||
case "yyy":
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,8 @@ public class TestSwitchOnEnum {
|
||||
public int testSOE(TimeUnit t) {
|
||||
// This creates anonymous SwitchMap inner class.
|
||||
switch (t) {
|
||||
case MICROSECONDS:
|
||||
return 2;
|
||||
case SECONDS:
|
||||
return 1;
|
||||
}
|
||||
|
||||
13
testData/src/pkg/TestSwitchOnStrings.java
Normal file
13
testData/src/pkg/TestSwitchOnStrings.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package pkg;
|
||||
|
||||
public class TestSwitchOnStrings {
|
||||
public int testSOE(String s) {
|
||||
switch (s) {
|
||||
case "xxx":
|
||||
return 2;
|
||||
case "yyy":
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user