According to the JVM Instruction Set, ARRAYLENGTH pops a value from the stack and pushes a value to the stack. In BCEL, it only implements StackProducer, so it creates an incorrectly high stack height. The Constants class already has the correct value for it, but since the instruction does not implement StackConsumer it is never used. The easiest solution is to change src\java\src\java\org\apache\bcel\generic\ARRAYLENGTH.java to implement StackConsumer. This will fix the bug. I didn't attach a patch for this because the change is so tiny.
Thanks! Applied ...please cross check