The example "Peephole optimizer" (at http://jakarta.apache.org/bcel/manual.html) has the following code: InstructionHandle[] match = (InstructionHandle[])e.next(); This is wrong. The variable "e" should be written as "i". In other words, it should be changed to: InstructionHandle[] match = (InstructionHandle[])i.next();
Please ignore my previous comment. This class have some other mistakes also. Please fix all the bugs and try to compile it.
I know this was literally years ago ...but do you remember what you meant with "This class have some other mistakes also"
I meant if we change InstructionHandle[] match = (InstructionHandle[])e.next(); to InstructionHandle[] match = (InstructionHandle[])i.next(); we still have another error "Duplicate Parameter e" at the line } catch(TargetLostException e) { So we should change that variable name to something else (e.g. "it") for (Iterator it = f.search(pat); it.hasNext();) { InstructionHandle[] match = (InstructionHandle[]) it.next();
This should be fixed. http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/site/xdoc/manual.xml?sortdir=down&view=log