Пример #1
0
 /**
  * Constructor that allows subclasses disabling exception suppression and stack traces. Those
  * features should only be disabled in very specific cases.
  */
 protected Throwable(
     String message, Throwable cause, boolean enableSuppression, boolean writetableStackTrace) {
   this.cause = cause;
   this.detailMessage = message;
   this.writetableStackTrace = writetableStackTrace;
   this.disableSuppression = !enableSuppression;
   if (writetableStackTrace) {
     fillInStackTrace();
   }
   initializeBackingError();
 }
Пример #2
0
 /**
  * Populates the stack trace information for the Throwable.
  *
  * @return this
  */
 @DoNotInline
 public Throwable fillInStackTrace() {
   if (writetableStackTrace) {
     // If this is the first run, let constructor initialize it.
     // (We need to initialize the backingJsObject from constructor as our own implementation of
     // fillInStackTrace is not guaranteed to be executed.)
     if (backingJsObject != UNITIALIZED) {
       initializeBackingError();
     }
   }
   return this;
 }
Пример #3
0
 public Throwable(Throwable cause) {
   this.detailMessage = (cause == null) ? null : cause.toString();
   this.cause = cause;
   fillInStackTrace();
   initializeBackingError();
 }
Пример #4
0
 public Throwable(String message, Throwable cause) {
   this.cause = cause;
   this.detailMessage = message;
   fillInStackTrace();
   initializeBackingError();
 }
Пример #5
0
 public Throwable() {
   fillInStackTrace();
   initializeBackingError();
 }