You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Clement Escoffier (JIRA)" <ji...@apache.org> on 2013/02/04 13:36:17 UTC

[jira] [Closed] (FELIX-3573) IPojo bytecode manipulation generates a duplicate local variable

     [ https://issues.apache.org/jira/browse/FELIX-3573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier closed FELIX-3573.
------------------------------------

    
> IPojo bytecode manipulation generates a duplicate local variable
> ----------------------------------------------------------------
>
>                 Key: FELIX-3573
>                 URL: https://issues.apache.org/jira/browse/FELIX-3573
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: ipojo-manipulator-1.8.6
>            Reporter: Francois Valdy
>            Assignee: Clement Escoffier
>            Priority: Minor
>             Fix For: ipojo-manipulator-1.8.6
>
>
> In the following code:
> http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/ConstructorCodeAdapter.java?revision=1327153&view=markup
> The method visitLocalVariable should have a "else" statement like below:
> if (index == 0) {
>   mv.visitLocalVariable(name, desc, signature, start, end, index);
>   mv.visitLocalVariable("_manager", "Lorg/apache/felix/ipojo/InstanceManager;", null, start, end, 1);
> } else {
>   mv.visitLocalVariable(name, desc, signature, start, end, index + 1);
> }
> Otherwise, when index == 0 ("this" parameter), we'll generate 2 variables at index 1 (manager & this a second time), as shown in javap -verbose -c -private output below:
>   LocalVariableTable:
>    Start  Length  Slot  Name   Signature
>    0      26      0    this       Lfoo/Bar;
>    0      26      1    _manager       Lorg/apache/felix/ipojo/InstanceManager;
>    0      26      1    this       Lfoo/Bar;
> It works fine as the last one is probably ignored by everyone, but it'd be cleaner.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira