A
ankur
Hi All,
How can I see the source code for Exception Class and RuntimeException
Class?
How can I see the source code for Exception Class and RuntimeException
Class?
ankur said:How can I see the source code for Exception Class and RuntimeException
Class?
Look in the src.zip that comes with SUN Java.
With the JDK (and not the JRE), to be precise.
ankur said:In Throwable.java I can see the signature for
public synchronized native Throwable fillInStackTrace();
where do I find its implementation ?
Ditto for this method:
private native StackTraceElement getStackTraceElement(int index);
It's native, so its source is in the source of the actual JVM.
This is the source of the bridge for JDK 7:
<http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/tip/src/share/native/ja...>
The method seems to come from here (line 402):
<http://hg.openjdk.java.net/jdk7/jdk7/hotspot/file/tip/src/share/vm/pr...>
At that point, I'd say it's best to basically open stuff up in gdb (C++
debugger) to try to follow what's going on, since I've perplexed myself,
and following code through several separate hg trees is becoming an
exercise in pain.
Roughly, ditto.
At this point, however, you're delving deep into the structure of the
JVM--as is the case for much of java.lang and its subpackages.
ankur said:In Throwable.java I can see the signature for
public synchronized native Throwable fillInStackTrace();
where do I find its implementation ?
Ditto for this method:
private native StackTraceElement getStackTraceElement(int index);
Native methods are in C code.
You can get the source for the C pieces of SUN Java as well.
But I think you should look for alternative approaches to
whatever you are trying to accomplish.
Native stacktrace code in the JVM is not something to mess
around with.
Arne
ankur said:Thanks for your answer.
Where can I get the source for the C pieces of SUN Java ?
ankur said:Where can I get the source for the C pieces of SUN Java ?
...
How can I see the source code for Exception Class and RuntimeException
Class?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.