DO NOT REPLY [Bug 18696] New: - Justice claims an error when a class is modified by bcel in specific circumstances
| Newsgroups | gmane.comp.jakarta.bcel.devel |
|---|---|
| Message-ID | <[email protected]> |
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18696>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18696
Justice claims an error when a class is modified by bcel in specific circumstances
Summary: Justice claims an error when a class is modified by bcel
in specific circumstances
Product: BCEL
Version: 5.0RC1
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Main
AssignedTo: [email protected]
ReportedBy: [email protected]
When modifying a class having the following kind of method :
public int test(int i) {
try {
int z = i + 1;
return z;
}
catch (Exception ex) {
System.out.println(ex);
}
return 0;
}
Justice fires an error because the end scope of the variable z and the start
scope of ex is the same. As they are generated with the same slot , we fall in
verification error. The end scope of the z method is wrong. It seems that this
is due to the method
public LocalVariable getLocalVariable(ConstantPoolGen cp) { ... }
in org/apache/bcel/generic/LocalVariableGen.java , look at :
if(length > 0)
length += end.getInstruction().getLength();
just before executing this, the length is correct. but as we executed it the
variable scope became wrong
Is it a too much restrictive control from JustIce ot is this a real problem in
bcel ?