From efae59551e3a95cf128fbac60b6fcfee4d2cf2ce Mon Sep 17 00:00:00 2001 From: chibash Date: Mon, 25 May 2015 02:37:05 +0900 Subject: fixed a bug reported as JASSIST-246 --- src/test/javassist/JvstTest5.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/test/javassist/JvstTest5.java') diff --git a/src/test/javassist/JvstTest5.java b/src/test/javassist/JvstTest5.java index 124f585d..097dcd4d 100644 --- a/src/test/javassist/JvstTest5.java +++ b/src/test/javassist/JvstTest5.java @@ -53,4 +53,18 @@ public class JvstTest5 extends JvstTestRoot { Object obj = make(cc.getName()); assertEquals(10, invoke(obj, "run")); } + + public void testJIRA246() throws Exception { + CtClass ctClass = sloader.makeClass("test5.JIRA246Test"); + ctClass.addInterface(sloader.get(test5.JIRA246.Test.class.getName())); + String methodBody = "public void test() { defaultMethod(); }"; + CtMethod ctMethod = CtMethod.make(methodBody, ctClass); + ctClass.addMethod(ctMethod); + } + + public void testJIRA246b() throws Exception { + CtClass ctClass = sloader.get(test5.JIRA246.A.class.getName()); + String src = "public void id() { get(); }"; + CtMethod make = CtNewMethod.make(src, ctClass); + } } -- cgit v1.2.3