Solved

How to find out a method caller

Posted on 1997-08-29
2
203 Views
Last Modified: 2010-04-16
How to find out from which method was method called from ?
For example if method A calls method B, how can I find, that method B was called from A. And is it possible to find out on the level of bytecode?
0
Comment
Question by:Klemo
2 Comments
 
LVL 4

Accepted Solution

by:
russgold earned 50 total points
ID: 1226006
There is a solution, but it doesn't work when running under a JIT:  You can use Throwable.printStackTrace to print the current stack to a BufferedOutputStream and then parse the result to find the calling method's name.  The problem is that in a JIT, the Java stack information is not preserved.  
0
 

Author Comment

by:Klemo
ID: 1226007
I knew that already, I find it out whit playing with that stuff, but thanks anyway.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question