java: more decompiler tests

This commit is contained in:
Roman Shevchenko
2014-06-25 13:50:13 +02:00
parent 54692d6f44
commit e8704ce693
5 changed files with 38 additions and 0 deletions
@@ -55,6 +55,7 @@ public class IdeaDecompilerTest extends LightCodeInsightFixtureTestCase {
public void testExtendsList() { doTestDecompiler(); }
public void testParameters() { doTestDecompiler(); }
public void testConstants() { doTestDecompiler(); }
public void testAnonymous() { doTestDecompiler(); }
private void doTestDecompiler() {
String name = PluginPathManager.getPluginHomePath("java-decompiler") + "/testData/" + getName().substring(4);
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,13 @@
public class Anonymous {
private int count = 0;
public Object produce() {
final int id = count++;
return new Object() {
@Override
public String toString() {
return "anonymous_" + id;
}
};
}
}
@@ -0,0 +1,24 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
public class Anonymous {
private int count = 0;
public Anonymous() {
}
public Object produce() {
++this.count;
final int var1 = this.count;
return new Object() {
public String toString() {
return "anonymous_" + var1;
}
};
}
}