< prev index next >

jdk/src/java.base/share/classes/java/lang/Throwable.java

Print this page

        

*** 22,32 **** * or visit www.oracle.com if you need additional information or have any * questions. */ package java.lang; - import jdk.internal.misc.VM; import java.io.*; import java.util.*; /** --- 22,31 ----
*** 824,838 **** 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 */) { ! 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; } --- 823,833 ---- 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 */) { ! stackTrace = StackTraceElement.of(this, depth); } else if (stackTrace == null) { return UNASSIGNED_STACK; } return stackTrace; }
*** 880,896 **** this.stackTrace = defensiveCopy; } } /** - * Gets the stack trace elements. - * @param elements - * @throws IndexOutOfBoundsException if {@code elements.length != depth } - */ - private native void getStackTraceElements(StackTraceElement[] elements); - - /** * Reads a {@code Throwable} from a stream, enforcing * well-formedness constraints on fields. Null entries and * self-pointers are not allowed in the list of {@code * suppressedExceptions}. Null entries are not allowed for stack * trace elements. A null stack trace in the serial form results --- 875,884 ----
< prev index next >