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

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

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -