[jboss-jira] [JBoss JIRA] Resolved: (JASSIST-39) failure to compile an instance method which invokes a static method in a different class and both methods have the same return type, name and argument types

Shigeru Chiba (JIRA) jira-events at lists.jboss.org
Thu Jul 8 13:19:46 EDT 2010


     [ https://jira.jboss.org/browse/JASSIST-39?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shigeru Chiba resolved JASSIST-39.
----------------------------------

    Fix Version/s: 3.13.0.GA
       Resolution: Cannot Reproduce Bug


> failure to compile an instance method which invokes a static method in a different class and both methods have the same return type, name and argument types
> ------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JASSIST-39
>                 URL: https://jira.jboss.org/browse/JASSIST-39
>             Project: Javassist
>          Issue Type: Bug
>            Reporter: twieger
>            Assignee: Shigeru Chiba
>             Fix For: 3.13.0.GA
>
>
> The testcase below demonstrates the problem. 
> The first invocation of CtNewMethod#make works, the second one fails.
> It looks like the problem is related with MemberResolver#lookupMethod.
> The check to enable the creation of a recursively called method is not precise enough. It actually succeeds, although the current method is an instance method, and the method which shall be invoked is a static method.
> ==========================================
> package experimental;
> import javassist.CannotCompileException;
> import javassist.ClassPool;
> import javassist.CtClass;
> import javassist.CtNewMethod;
> import org.testng.annotations.Test;
> public class TestJavaAssist {
>     @Test
>     public void testJavaAssist() throws CannotCompileException {
>         ClassPool   classPool   = new ClassPool();
>         classPool.appendSystemPath();
>         
>         CtClass     ctClass     = classPool.makeClass("Test");
>         CtNewMethod.make("public String foox(){return experimental.TestJavaAssist.foo();}", ctClass);
>         CtNewMethod.make("public String foo(){return experimental.TestJavaAssist.foo();}", ctClass);
>     }
>     public static final String foo() {        
>         return "foo";
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list