/** * Records the stack trace from the point where this method has been called * to this {@code Throwable}. This method is invoked by the {@code Throwable} constructors. * * <p>This method is public so that code (such as an RPC system) which catches * a {@code Throwable} and then re-throws it can replace the construction-time stack trace * with a stack trace from the location where the exception was re-thrown, by <i>calling</i> * {@code fillInStackTrace}. * * <p>This method is non-final so that non-Java language implementations can disable VM stack * traces for their language. Filling in the stack trace is relatively expensive. * <i>Overriding</i> this method in the root of a language's exception hierarchy allows the * language to avoid paying for something it doesn't need. * * @return this {@code Throwable} instance. */ public Throwable fillInStackTrace() { if (stackTrace == null) { return this; // writableStackTrace was false. } // Fill in the intermediate representation. stackState = nativeFillInStackTrace(); // Mark the full representation as in need of update. stackTrace = EmptyArray.STACK_TRACE_ELEMENT; return this; }
/** * Records the stack trace from the point where this method has been called * to this {@code Throwable}. This method is invoked by the {@code Throwable} constructors. * * <p>This method is public so that code (such as an RPC system) which catches * a {@code Throwable} and then re-throws it can replace the construction-time stack trace * with a stack trace from the location where the exception was re-thrown, by <i>calling</i> * {@code fillInStackTrace}. * * <p>This method is non-final so that non-Java language implementations can disable VM stack * traces for their language. Filling in the stack trace is relatively expensive. * <i>Overriding</i> this method in the root of a language's exception hierarchy allows the * language to avoid paying for something it doesn't need. * * @return this {@code Throwable} instance. */ public Throwable fillInStackTrace() { if (stackTrace == null) { return this; // writableStackTrace was false. } // Fill in the intermediate representation. stackState = nativeFillInStackTrace(); // Mark the full representation as in need of update. stackTrace = EmptyArray.STACK_TRACE_ELEMENT; return this; }
/** * Records the stack trace from the point where this method has been called * to this {@code Throwable}. This method is invoked by the {@code Throwable} constructors. * * <p>This method is public so that code (such as an RPC system) which catches * a {@code Throwable} and then re-throws it can replace the construction-time stack trace * with a stack trace from the location where the exception was re-thrown, by <i>calling</i> * {@code fillInStackTrace}. * * <p>This method is non-final so that non-Java language implementations can disable VM stack * traces for their language. Filling in the stack trace is relatively expensive. * <i>Overriding</i> this method in the root of a language's exception hierarchy allows the * language to avoid paying for something it doesn't need. * * @return this {@code Throwable} instance. */ public Throwable fillInStackTrace() { if (stackTrace == null) { return this; // writableStackTrace was false. } // Fill in the intermediate representation. stackState = nativeFillInStackTrace(); // Mark the full representation as in need of update. stackTrace = EmptyArray.STACK_TRACE_ELEMENT; return this; }
/** * Records the stack trace from the point where this method has been called * to this {@code Throwable}. This method is invoked by the {@code Throwable} constructors. * * <p>This method is public so that code (such as an RPC system) which catches * a {@code Throwable} and then re-throws it can replace the construction-time stack trace * with a stack trace from the location where the exception was re-thrown, by <i>calling</i> * {@code fillInStackTrace}. * * <p>This method is non-final so that non-Java language implementations can disable VM stack * traces for their language. Filling in the stack trace is relatively expensive. * <i>Overriding</i> this method in the root of a language's exception hierarchy allows the * language to avoid paying for something it doesn't need. * * @return this {@code Throwable} instance. */ public Throwable fillInStackTrace() { if (stackTrace == null) { return this; // writableStackTrace was false. } // Fill in the intermediate representation. stackState = nativeFillInStackTrace(); // Mark the full representation as in need of update. stackTrace = EmptyArray.STACK_TRACE_ELEMENT; return this; }
/** * Records the stack trace from the point where this method has been called * to this {@code Throwable}. This method is invoked by the {@code Throwable} constructors. * * <p>This method is public so that code (such as an RPC system) which catches * a {@code Throwable} and then re-throws it can replace the construction-time stack trace * with a stack trace from the location where the exception was re-thrown, by <i>calling</i> * {@code fillInStackTrace}. * * <p>This method is non-final so that non-Java language implementations can disable VM stack * traces for their language. Filling in the stack trace is relatively expensive. * <i>Overriding</i> this method in the root of a language's exception hierarchy allows the * language to avoid paying for something it doesn't need. * * @return this {@code Throwable} instance. */ public Throwable fillInStackTrace() { if (stackTrace == null) { return this; // writableStackTrace was false. } // Fill in the intermediate representation. stackState = nativeFillInStackTrace(); // Mark the full representation as in need of update. stackTrace = EmptyArray.STACK_TRACE_ELEMENT; return this; }
/** * Records the stack trace from the point where this method has been called * to this {@code Throwable}. This method is invoked by the {@code Throwable} constructors. * * <p>This method is public so that code (such as an RPC system) which catches * a {@code Throwable} and then re-throws it can replace the construction-time stack trace * with a stack trace from the location where the exception was re-thrown, by <i>calling</i> * {@code fillInStackTrace}. * * <p>This method is non-final so that non-Java language implementations can disable VM stack * traces for their language. Filling in the stack trace is relatively expensive. * <i>Overriding</i> this method in the root of a language's exception hierarchy allows the * language to avoid paying for something it doesn't need. * * @return this {@code Throwable} instance. */ public Throwable fillInStackTrace() { if (stackTrace == null) { return this; // writableStackTrace was false. } // Fill in the intermediate representation. stackState = nativeFillInStackTrace(); // Mark the full representation as in need of update. stackTrace = EmptyArray.STACK_TRACE_ELEMENT; return this; }
/** * Records the stack trace from the point where this method has been called * to this {@code Throwable}. This method is invoked by the {@code Throwable} constructors. * * <p>This method is public so that code (such as an RPC system) which catches * a {@code Throwable} and then re-throws it can replace the construction-time stack trace * with a stack trace from the location where the exception was re-thrown, by <i>calling</i> * {@code fillInStackTrace}. * * <p>This method is non-final so that non-Java language implementations can disable VM stack * traces for their language. Filling in the stack trace is relatively expensive. * <i>Overriding</i> this method in the root of a language's exception hierarchy allows the * language to avoid paying for something it doesn't need. * * @return this {@code Throwable} instance. */ public Throwable fillInStackTrace() { if (stackTrace == null) { return this; // writableStackTrace was false. } // Fill in the intermediate representation. stackState = nativeFillInStackTrace(); // Mark the full representation as in need of update. stackTrace = EmptyArray.STACK_TRACE_ELEMENT; return this; }