test for super default method call

master
Egor.Ushakov 8 years ago
parent 645b38d638
commit 790027c779
  1. 1
      test/org/jetbrains/java/decompiler/SingleClassesTest.java
  2. BIN
      testData/classes/pkg/TestInterfaceSuper$Impl.class
  3. BIN
      testData/classes/pkg/TestInterfaceSuper.class
  4. 30
      testData/results/TestInterfaceSuper.dec
  5. 11
      testData/src/pkg/TestInterfaceSuper.java

@ -118,6 +118,7 @@ public class SingleClassesTest {
//@Test public void testUnionType() { doTest("pkg/TestUnionType"); } //@Test public void testUnionType() { doTest("pkg/TestUnionType"); }
//@Test public void testInnerClassConstructor2() { doTest("pkg/TestInner2"); } //@Test public void testInnerClassConstructor2() { doTest("pkg/TestInner2"); }
//@Test public void testInUse() { doTest("pkg/TestInUse"); } //@Test public void testInUse() { doTest("pkg/TestInUse"); }
//@Test public void testInterfaceSuper() { doTest("pkg/TestInterfaceSuper"); }
private void doTest(String testFile, String... companionFiles) { private void doTest(String testFile, String... companionFiles) {
ConsoleDecompiler decompiler = fixture.getDecompiler(); ConsoleDecompiler decompiler = fixture.getDecompiler();

@ -0,0 +1,30 @@
package pkg;
public interface TestInterfaceSuper {
default void defaultMethod() {
}// 4
public static class Impl implements TestInterfaceSuper {
public void defaultMethod() {
TestInterfaceSuper.super.defaultMethod();// 8
}// 9
}
}
class 'pkg/TestInterfaceSuper' {
method 'defaultMethod ()V' {
0 4
}
}
class 'pkg/TestInterfaceSuper$Impl' {
method 'defaultMethod ()V' {
1 8
4 9
}
}
Lines mapping:
4 <-> 5
8 <-> 9
9 <-> 10

@ -0,0 +1,11 @@
package pkg;
public interface TestInterfaceSuper {
default void defaultMethod() {}
class Impl implements TestInterfaceSuper {
public void defaultMethod() {
TestInterfaceSuper.super.defaultMethod();
}
}
}
Loading…
Cancel
Save