Q: How can I ... with BCEL?
Q: Is the BCEL thread-safe?
Q: Can I use BCEL in a commercial product?
Q: (Typically for users of Xalan (XSLTC)) I'm getting
ClassGenException: Branch target offset too large for short
A: The answer lies in internal limitations of the JVM, branch instruction like goto can not address offsets larger than a short integer, i.e. offsets >= 32767.
The solution is to split the branch into in intermediate hops, which the XSLTC obviously doesn't take care off. (In fact you could replace gotos with the goto_w instruction, but this wouldn't help in the other cases).
Q: Can I create or modify classes dynamically with BCEL?
Q: I get a verification error, what can I do?
java org.apache.bcel.verifier.Verifier <your class>