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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -