[jboss-jira] [JBoss JIRA] Created: (JASSIST-102) Bug report for CtNewMethod.copy

Shigeru Chiba (JIRA) jira-events at lists.jboss.org
Mon Dec 28 01:31:38 EST 2009


Bug report for CtNewMethod.copy
-------------------------------

                 Key: JASSIST-102
                 URL: https://jira.jboss.org/jira/browse/JASSIST-102
             Project: Javassist
          Issue Type: Bug
    Affects Versions: 3.11.0.GA
            Reporter: Shigeru Chiba
            Assignee: Shigeru Chiba
            Priority: Minor


** the following message was directly sent to chiba on December 26, 2009.

Dear Shigeru,
when copying a method from class A to class B, the class name of A is
replaced by B all over the descriptor of the method. This is not
documented, and is not required in all cases; I understand that the
opcodes for "this" return B instead of A, and this may justify using a
different return type (but doesn't justify using different argument
types). I use this method to build manually my proxies and to
replicate the original signature, while later replacing the method's
body.

I suggest documenting this behaviour, and adding an overload with a
boolean parameter to request or suppress this renaming.

Here's the stack trace (built manually) that shows where this happens
(I first noticed this behaviour experimentally):

MethodInfo.read(MethodInfo src, String methodname, Map classnames) (line 478)
MethodInfo(ConstPool cp, String methodname, MethodInfo src,
           Map classnameMap) (line 104)
void CtBehaviour.copy(CtBehavior src, boolean isCons, ClassMap map) (line 66)
CtMethod(CtMethod src, CtClass declaring, ClassMap map) (line 113)
CtMethod CtNewMethod.copy(CtMethod src, CtClass declaring,
                               ClassMap map) (line 159)

Kind regards
-- 
Paolo Giarrusso


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

        



More information about the jboss-jira mailing list