[jboss-jira] [JBoss JIRA] (JASSIST-246) CannotCompileException thrown when invoking default method
Shigeru Chiba (JIRA)
issues at jboss.org
Sun May 24 13:41:19 EDT 2015
[ https://issues.jboss.org/browse/JASSIST-246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shigeru Chiba resolved JASSIST-246.
-----------------------------------
Fix Version/s: 3.20.0-GA
Resolution: Done
> CannotCompileException thrown when invoking default method
> ----------------------------------------------------------
>
> 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
> Fix For: 3.20.0-GA
>
>
> 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 occurs on 3.19.0-GA
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
More information about the jboss-jira
mailing list