< prev index next >
jdk/src/java.base/share/classes/java/lang/Throwable.java
Print this page
@@ -783,15 +783,11 @@
* @see java.lang.Throwable#printStackTrace()
*/
public synchronized Throwable fillInStackTrace() {
if (stackTrace != null ||
backtrace != null /* Out of protocol state */ ) {
- if (backtrace == null && StackStreamFactory.useStackTrace(this)) {
- backtrace = StackStreamFactory.makeStackTrace(this);
- } else {
fillInStackTrace(0);
- }
stackTrace = UNASSIGNED_STACK;
}
return this;
}
@@ -828,19 +824,15 @@
private synchronized StackTraceElement[] getOurStackTrace() {
// Initialize stack trace field with information from
// backtrace if this is the first call to this method
if (stackTrace == UNASSIGNED_STACK ||
(stackTrace == null && backtrace != null) /* Out of protocol state */) {
- if (backtrace instanceof StackStreamFactory.StackTrace) {
- stackTrace = ((StackStreamFactory.StackTrace)backtrace).getStackTraceElements();
- } else {
stackTrace = new StackTraceElement[depth];
for (int i = 0; i < depth; i++) {
stackTrace[i] = new StackTraceElement();
}
getStackTraceElements(stackTrace);
- }
} else if (stackTrace == null) {
return UNASSIGNED_STACK;
}
return stackTrace;
}
< prev index next >