diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/test/javassist/JvstTest5.java | 10 | ||||
-rw-r--r-- | src/test/test5/JIRA248.java | 12 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/test/javassist/JvstTest5.java b/src/test/javassist/JvstTest5.java index 6afb41a2..249f4fad 100644 --- a/src/test/javassist/JvstTest5.java +++ b/src/test/javassist/JvstTest5.java @@ -125,4 +125,14 @@ public class JvstTest5 extends JvstTestRoot { Object obj = make(cc.getName()); assertEquals(1, invoke(obj, "run")); } + + public void testJIRA248() throws Exception { + CtClass cc = sloader.get("test5.JIRA248"); + String methodBody = "public int run() { return foo() + super.foo(); }"; + CtMethod ctMethod = CtMethod.make(methodBody, cc); + cc.addMethod(ctMethod); + cc.writeFile(); + Object obj = make(cc.getName()); + assertEquals(71, invoke(obj, "run")); + } } diff --git a/src/test/test5/JIRA248.java b/src/test/test5/JIRA248.java new file mode 100644 index 00000000..0a0abcbe --- /dev/null +++ b/src/test/test5/JIRA248.java @@ -0,0 +1,12 @@ +package test5; + +interface JIRA248Intf { + default int foo() { return 1; } +} + +class JIRA248Sup implements JIRA248Intf { +} + +public class JIRA248 extends JIRA248Sup { + public int foo() { return 70; } +} |