[jboss-jira] [JBoss JIRA] (JASSIST-246) CannotCompileException thrown when invoking

Robson Enke (JIRA) issues at jboss.org
Thu May 7 16:31:45 EDT 2015


Robson Enke created JASSIST-246:
-----------------------------------

             Summary: CannotCompileException thrown when invoking 
                 Key: JASSIST-246
                 URL: https://issues.jboss.org/browse/JASSIST-246
             Project: Javassist
          Issue Type: Bug
    Affects Versions: 3.19.0-GA
            Reporter: Robson Enke
            Assignee: Shigeru Chiba
            Priority: Critical


Given the example below:

{code:title=Test.java|borderStyle=solid}
public interface Test {
	default void defaultMethod() {
	}
	void test();
}
{code}

{code:borderStyle=solid}
ClassPool pool = ClassPool.getDefault();
CtClass ctClass = pool.makeClass("TestImp");
ctClass.addInterface(pool.get(Test.class.getName()));
String methodBody = "public void test() { defaultMethod(); }";
CtMethod ctMethod = CtMethod.make(methodBody, ctClass);
ctClass.addMethod(ctMethod);
{code}

A CannotCompileException will be thrown when creating the method, with the following message:
{{compile error: defaultMethod() not found in TestImp}}

This is similar to JASSIST-238 but still occuring on 3.19.0-GA



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jboss-jira mailing list