Duplicate in methodNode.localVariables
In asm 3.1 when read with ClassNode, it seems that the following class causes a
duplicate of the localVariableNode "s" in the list methodNode.localVariables
(i.e. 2 instances of LocalVariableNode in the list with same name and same index).
The class :
public class Test {
public void test() {
final String s;
if (Math.abs(0) < 1) {
s = "t";
} else {
s = "f";
}
}
}
ClassNode is used like this :
final ClassNode classNode = new ClassNode();
final ClassReader classReader = new ClassReader(...);
classReader.accept(classNode, ClassReader.EXPAND_FRAMES);
I can filter local variables based on indexes, but it was a surprise to have
duplicates.
PS: I'm trying to detect dead local variables in a static analysis program :
http://dcd.dev.java.net