Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
ipojo-manipulator-1.8.6
-
None
Description
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.