I have a method and want to examine variables inside it without debugging - is it possible in Java?
I do not want to write tons of code like:
Syste
Well, you can write a method with a varargs parameter and just write:
dump(variable1, variable2, variable3, variable4, ...);
It's not ideal, but it will be enough in some circumstances. There's no way to automatically grab all the local variables from a method and dump them though.
You might consider some sort of bytecode manipulation (e.g. with BCEL) which could do it... but it would be pretty ugly.