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
Post a Comment