• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to find the file which calls a method

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a code snippet(part of our product) which is throwing StackOverflowError(only at the customer's instance).
Based on the stack trace, i figured out that onTextChanged method of CCTImageNodeUI.java is called N number of times due to which this exception is caused.
To further analyze this issue, i need to check who is calling onTextChanged method.
I executed a grep command within our product to check the file which is calling this method, but could not find anything.
The comment says that, this method is called whenever the text of the owner object is changed, however i could not understand how to find the owner object.



Please let me know if there is anyway to find out who is calling onTextChanged method.

Thanks in advance,
Asha
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not a beginning question, so I shall move it.

There are methods about getStackTrace: go through the API index for G and try ctrl-F "stacktrace" (or "stack"). Find the getStackTrace methods or similar and get the stack trace printed; you can tell the method names from that printout.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

asha ganapathy wrote:Based on the stack trace, i figured out that onTextChanged method of CCTImageNodeUI.java is called N number of times due to which this exception is caused.
To further analyze this issue, i need to check who is calling onTextChanged method.

Please let me know if there is anyway to find out who is calling onTextChanged method.



The caller is in the same stack trace -- it is the next line after the line that shows the onTextChanged() method. The methods in the stack are listed in callee to caller order.

Henry
 
asha ganapathy
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The stack trace is as follows

Exception occurred during event dispatching:

java.lang.StackOverflowError

at tomsawyer.editor.TSENode.setTag(Unknown Source)

at tomsawyer.editor.TSEAnnotatedUI.onTextChanged(Unknown Source)

at asha.builder.graph.CCTImageNodeUI.onTextChanged(CCTImageNodeUI.java:293)

at tomsawyer.editor.TSENode.setTag(Unknown Source)

at tomsawyer.editor.TSEAnnotatedUI.onTextChanged(Unknown Source)

at asha.builder.graph.CCTImageNodeUI.onTextChanged(CCTImageNodeUI.java:293)
.
.
.

Now the problem is to find the caller of the method onTextChanged.
Please suggest.

Thanks,
Asha
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Keep reading down the stack trace until you find it. (It's going to be a very large stack trace so you should find it very near the bottom.)
reply
    Bookmark Topic Watch Topic
  • New Topic