Lines Matching defs:cause

54  * contain a <i>cause</i>: another throwable that caused this
57 * cause can, itself, have a cause, and so on, leading to a "chain" of
60 * <p>One reason that a throwable may have a cause is that the class that
68 * cause) allows the upper layer to communicate the details of the failure to
74 * <p>A second reason that a throwable may have a cause is that the method
76 * permit the method to throw the cause directly. For example, suppose
87 * <p>A cause can be associated with a throwable in two ways: via a
88 * constructor that takes the cause as an argument, or via the
91 * that take a cause and delegate (perhaps indirectly) to one of the
92 * {@code Throwable} constructors that takes a cause.
94 * Because the {@code initCause} method is public, it allows a cause to be
102 * Further, those subclasses that might likely have a cause associated with
104 * {@code Throwable} (the cause), and one that takes a
106 * cause).
164 * Throwable that are writable in response to user actions, cause,
191 * it indicates that the cause of this throwable has not yet been
197 private Throwable cause = this;
243 * The cause is not initialized, and may subsequently be initialized by a
255 * cause is not initialized, and may subsequently be initialized by
271 * cause. <p>Note that the detail message associated with
272 * {@code cause} is <i>not</i> automatically incorporated in
280 * @param cause the cause (which is saved for later retrieval by the
282 * permitted, and indicates that the cause is nonexistent or
286 public Throwable(String message, Throwable cause) {
289 this.cause = cause;
293 * Constructs a new throwable with the specified cause and a detail
294 * message of {@code (cause==null ? null : cause.toString())} (which
295 * typically contains the class and detail message of {@code cause}).
303 * @param cause the cause (which is saved for later retrieval by the
305 * permitted, and indicates that the cause is nonexistent or
309 public Throwable(Throwable cause) {
311 detailMessage = (cause==null ? null : cause.toString());
312 this.cause = cause;
317 * cause, {@linkplain #addSuppressed suppression} enabled or
345 * @param cause the cause. (A {@code null} value is permitted,
346 * and indicates that the cause is nonexistent or unknown.)
356 protected Throwable(String message, Throwable cause,
365 this.cause = cause;
395 * Returns the cause of this throwable or {@code null} if the
396 * cause is nonexistent or unknown. (The cause is the throwable that
399 * <p>This implementation returns the cause that was supplied via one of
403 * it to return a cause set by some other means. This is appropriate for
408 * cause of a throwable.
410 * @return the cause of this throwable or {@code null} if the
411 * cause is nonexistent or unknown.
415 return (cause==this ? null : cause);
419 * Initializes the <i>cause</i> of this throwable to the specified value.
420 * (The cause is the throwable that caused this throwable to get thrown.)
430 * without other support for setting the cause is:
441 * @param cause the cause (which is saved for later retrieval by the
443 * permitted, and indicates that the cause is nonexistent or
446 * @throws IllegalArgumentException if {@code cause} is this
447 * throwable. (A throwable cannot be its own cause.)
454 public synchronized Throwable initCause(Throwable cause) {
455 if (this.cause != this)
456 throw new IllegalStateException("Can't overwrite cause with " +
457 Objects.toString(cause, "a null"), this);
458 if (cause == this)
460 this.cause = cause;
514 * The backtrace for a throwable with an initialized, non-null cause
515 * should generally include the backtrace for the cause. The format
576 * HighLevelException(Throwable cause) { super(cause); }
580 * MidLevelException(Throwable cause) { super(cause); }
607 * <p>An exception can have both a cause and one or more suppressed
621 * Likewise, a suppressed exception can have a cause:
664 // Print cause, if any
706 // Print cause, if any
909 * cause} field can hold; both {@code null} and {@code this} are
1025 * cause is semantically known at the time of its creation, unlike