RE: [BCEL] Re: How can I recover .class references separate from other references to classes using BCEL?

2017-09-10 Thread Showalter, Jim
This works: public void visitCode(final Code obj) { ConstantPoolGen cpg = new ConstantPoolGen(javaClass.getConstantPool()); InstructionList list = new InstructionList(obj.getCode()); Iterator iter = list.iterator(); while

[BCEL] Re: How can I recover .class references separate from other references to classes using BCEL?

2017-09-10 Thread Stephan Herrmann
quick guess: check if the previous instruction is ldc. HTH, Stephan On 10.09.2017 21:50, Showalter, Jim wrote: The use case is, suppose you want to recover the source from a .class file. In the original source, it said: public class SomeExperiment { public static void main(String[]

How can I recover .class references separate from other references to classes using BCEL?

2017-09-10 Thread Showalter, Jim
The use case is, suppose you want to recover the source from a .class file. In the original source, it said: public class SomeExperiment { public static void main(String[] args) { System.out.println(SomeOtherClass.class); <<< WANT TO RECOVER THE ".class" FROM HERE } } In the