debugging - How to find out where the method was called in Java? -


i have more 100 class files. got error message in 1 method when return values. example:

public string name() {     return("john");  // error message appeared here } 

my problem couldn't find out has been called.

you may print calling stack way :

for (stacktraceelement ste : thread.currentthread().getstacktrace()) {     system.out.println(ste); } 

note ide have shortcuts find given method called.

for instance in eclipse, select method, ctrl+shift+g show possible callers of method.

you may use debugger , step-by-step check.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -