You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Francois Valdy (JIRA)" <ji...@apache.org> on 2012/06/27 10:13:44 UTC

[jira] [Created] (FELIX-3574) IPojo bytecode manipulation looses method argument names

Francois Valdy created FELIX-3574:
-------------------------------------

             Summary: IPojo bytecode manipulation looses method argument names
                 Key: FELIX-3574
                 URL: https://issues.apache.org/jira/browse/FELIX-3574
             Project: Felix
          Issue Type: Bug
          Components: iPOJO
    Affects Versions: ipojo-manipulator-1.8.6
            Reporter: Francois Valdy


When IPojo creates its wrapper methods (instead of the ones it renames with '__' prefix), it doesn't keep the local variable table information, hence loosing parameter names.
Reflection isn't impacted (as you can't access them through reflection anyway), but many tools are:
- decompilers will display proper names for prefixed (private) methods, but not on the non-prefixed ones
- IDEs won't display the names if you don't have javadoc|source attachment
- some tools that are reading bytecode won't work (http://paranamer.codehaus.org/ in my case)

Fix is pretty easy, I'll attach a patch later on:
We need to store the local variables definition on the methods (only those which correspond to a parameter, we discard those that apply to method code variables) in the MethodDescriptor.
Then when generating the wrapping code, we put them back, with a "start label" = 0, and "end label" = "end of wrapping code", as it seems to be the convention.

I tested the changes on 1.6.4 and they work fine, but I'll provide a patch for the trunk.

Thx

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FELIX-3574) IPojo bytecode manipulation looses method argument names

Posted by "Francois Valdy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13402079#comment-13402079 ] 

Francois Valdy commented on FELIX-3574:
---------------------------------------

Nope, it wasn't a typo, I'm still using 1.6.4 :(
                
> IPojo bytecode manipulation looses method argument names
> --------------------------------------------------------
>
>                 Key: FELIX-3574
>                 URL: https://issues.apache.org/jira/browse/FELIX-3574
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: ipojo-manipulator-1.8.6
>            Reporter: Francois Valdy
>         Attachments: FELIX-3574-patch.diff
>
>
> When IPojo creates its wrapper methods (instead of the ones it renames with '__' prefix), it doesn't keep the local variable table information, hence loosing parameter names.
> Reflection isn't impacted (as you can't access them through reflection anyway), but many tools are:
> - decompilers will display proper names for prefixed (private) methods, but not on the non-prefixed ones
> - IDEs won't display the names if you don't have javadoc|source attachment
> - some tools that are reading bytecode won't work (http://paranamer.codehaus.org/ in my case)
> Fix is pretty easy, I'll attach a patch later on:
> We need to store the local variables definition on the methods (only those which correspond to a parameter, we discard those that apply to method code variables) in the MethodDescriptor.
> Then when generating the wrapping code, we put them back, with a "start label" = 0, and "end label" = "end of wrapping code", as it seems to be the convention.
> I tested the changes on 1.6.4 and they work fine, but I'll provide a patch for the trunk.
> Thx

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (FELIX-3574) IPojo bytecode manipulation looses method argument names

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier resolved FELIX-3574.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: ipojo-manipulator-1.8.6
         Assignee: Clement Escoffier

Applied a slightly modified version of the patch.

Please check.
                
> IPojo bytecode manipulation looses method argument names
> --------------------------------------------------------
>
>                 Key: FELIX-3574
>                 URL: https://issues.apache.org/jira/browse/FELIX-3574
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: ipojo-manipulator-1.8.6
>            Reporter: Francois Valdy
>            Assignee: Clement Escoffier
>             Fix For: ipojo-manipulator-1.8.6
>
>         Attachments: FELIX-3574-patch.diff
>
>
> When IPojo creates its wrapper methods (instead of the ones it renames with '__' prefix), it doesn't keep the local variable table information, hence loosing parameter names.
> Reflection isn't impacted (as you can't access them through reflection anyway), but many tools are:
> - decompilers will display proper names for prefixed (private) methods, but not on the non-prefixed ones
> - IDEs won't display the names if you don't have javadoc|source attachment
> - some tools that are reading bytecode won't work (http://paranamer.codehaus.org/ in my case)
> Fix is pretty easy, I'll attach a patch later on:
> We need to store the local variables definition on the methods (only those which correspond to a parameter, we discard those that apply to method code variables) in the MethodDescriptor.
> Then when generating the wrapping code, we put them back, with a "start label" = 0, and "end label" = "end of wrapping code", as it seems to be the convention.
> I tested the changes on 1.6.4 and they work fine, but I'll provide a patch for the trunk.
> Thx

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (FELIX-3574) IPojo bytecode manipulation looses method argument names

Posted by "Francois Valdy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Valdy updated FELIX-3574:
----------------------------------

    Attachment: FELIX-3574-patch.diff

Patch to trunk attached.
                
> IPojo bytecode manipulation looses method argument names
> --------------------------------------------------------
>
>                 Key: FELIX-3574
>                 URL: https://issues.apache.org/jira/browse/FELIX-3574
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: ipojo-manipulator-1.8.6
>            Reporter: Francois Valdy
>         Attachments: FELIX-3574-patch.diff
>
>
> When IPojo creates its wrapper methods (instead of the ones it renames with '__' prefix), it doesn't keep the local variable table information, hence loosing parameter names.
> Reflection isn't impacted (as you can't access them through reflection anyway), but many tools are:
> - decompilers will display proper names for prefixed (private) methods, but not on the non-prefixed ones
> - IDEs won't display the names if you don't have javadoc|source attachment
> - some tools that are reading bytecode won't work (http://paranamer.codehaus.org/ in my case)
> Fix is pretty easy, I'll attach a patch later on:
> We need to store the local variables definition on the methods (only those which correspond to a parameter, we discard those that apply to method code variables) in the MethodDescriptor.
> Then when generating the wrapping code, we put them back, with a "start label" = 0, and "end label" = "end of wrapping code", as it seems to be the convention.
> I tested the changes on 1.6.4 and they work fine, but I'll provide a patch for the trunk.
> Thx

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FELIX-3574) IPojo bytecode manipulation looses method argument names

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13402076#comment-13402076 ] 

Clement Escoffier commented on FELIX-3574:
------------------------------------------

Hi,

When you say `I tested the changes on 1.6.4 and they work fine, but I'll provide a patch for the trunk.` you mean 1.8.4, right ?
                
> IPojo bytecode manipulation looses method argument names
> --------------------------------------------------------
>
>                 Key: FELIX-3574
>                 URL: https://issues.apache.org/jira/browse/FELIX-3574
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: ipojo-manipulator-1.8.6
>            Reporter: Francois Valdy
>
> When IPojo creates its wrapper methods (instead of the ones it renames with '__' prefix), it doesn't keep the local variable table information, hence loosing parameter names.
> Reflection isn't impacted (as you can't access them through reflection anyway), but many tools are:
> - decompilers will display proper names for prefixed (private) methods, but not on the non-prefixed ones
> - IDEs won't display the names if you don't have javadoc|source attachment
> - some tools that are reading bytecode won't work (http://paranamer.codehaus.org/ in my case)
> Fix is pretty easy, I'll attach a patch later on:
> We need to store the local variables definition on the methods (only those which correspond to a parameter, we discard those that apply to method code variables) in the MethodDescriptor.
> Then when generating the wrapping code, we put them back, with a "start label" = 0, and "end label" = "end of wrapping code", as it seems to be the convention.
> I tested the changes on 1.6.4 and they work fine, but I'll provide a patch for the trunk.
> Thx

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FELIX-3574) IPojo bytecode manipulation looses method argument names

Posted by "Francois Valdy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13402924#comment-13402924 ] 

Francois Valdy commented on FELIX-3574:
---------------------------------------

That was quick, thx.
Again I can't yet test on the trunk, but I reviewed the commit.

Btw, I'm not sure what was the purpose of asm.tree exclusion (that I removed) in the pom.xml.
It could've been kept by introducing a new class to store the local variable information (if it had any purpose).
                
> IPojo bytecode manipulation looses method argument names
> --------------------------------------------------------
>
>                 Key: FELIX-3574
>                 URL: https://issues.apache.org/jira/browse/FELIX-3574
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: ipojo-manipulator-1.8.6
>            Reporter: Francois Valdy
>            Assignee: Clement Escoffier
>             Fix For: ipojo-manipulator-1.8.6
>
>         Attachments: FELIX-3574-patch.diff
>
>
> When IPojo creates its wrapper methods (instead of the ones it renames with '__' prefix), it doesn't keep the local variable table information, hence loosing parameter names.
> Reflection isn't impacted (as you can't access them through reflection anyway), but many tools are:
> - decompilers will display proper names for prefixed (private) methods, but not on the non-prefixed ones
> - IDEs won't display the names if you don't have javadoc|source attachment
> - some tools that are reading bytecode won't work (http://paranamer.codehaus.org/ in my case)
> Fix is pretty easy, I'll attach a patch later on:
> We need to store the local variables definition on the methods (only those which correspond to a parameter, we discard those that apply to method code variables) in the MethodDescriptor.
> Then when generating the wrapping code, we put them back, with a "start label" = 0, and "end label" = "end of wrapping code", as it seems to be the convention.
> I tested the changes on 1.6.4 and they work fine, but I'll provide a patch for the trunk.
> Thx

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira