Search code examples
javanetbeansbcel

View class bytecode at runtime


I have patching class dynamycly by BCEL, and them I dynamycly reload class. I`m not sure what I really reloading class.

How can I check it?

How can I view class bytecode without save it as file?

Thanks.


Solution

  • I'm not sure what I am really reloading the class. How can I check it?

    Well, you could print a message to System.out in static initializer in your class. If the message is printed you will know that your class has been reloaded, and the (new) class has been initialized.

    How can I view class bytecode without save it as file?

    See Pretty printing a method in ASM Bytecode

    Whether netbeans special instruments for it?

    I don't know what you are asking here ...