java.lang.Throwable.nativeFillInStackTrace()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(214)

本文整理了Java中java.lang.Throwable.nativeFillInStackTrace()方法的一些代码示例,展示了Throwable.nativeFillInStackTrace()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Throwable.nativeFillInStackTrace()方法的具体详情如下:
包路径:java.lang.Throwable
类名称:Throwable
方法名:nativeFillInStackTrace

Throwable.nativeFillInStackTrace介绍

暂无

代码示例

代码示例来源:origin: robovm/robovm

/**
 * 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;
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * 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;
}

代码示例来源:origin: MobiVM/robovm

/**
 * 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;
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * 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;
}

代码示例来源:origin: ibinti/bugvm

/**
 * 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;
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * 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;
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * 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;
}

相关文章