diff options
author | chibash <chiba@javassist.org> | 2015-09-25 00:26:43 +0900 |
---|---|---|
committer | chibash <chiba@javassist.org> | 2015-09-25 00:26:43 +0900 |
commit | 5bbbcdf552934c72b71f15bf97a35d853d309236 (patch) | |
tree | 3b76109c0828e71cd94241d692147689e89f7857 | |
parent | e68077dc870ca45bff88762d191802e6764a9152 (diff) | |
download | javassist-5bbbcdf552934c72b71f15bf97a35d853d309236.tar.gz javassist-5bbbcdf552934c72b71f15bf97a35d853d309236.zip |
adds a test case for JIRA JASSIST-248
-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; } +} |