194 * @serial
195 * @since 1.4
196 */
197 private Throwable cause = this;
198
199 /**
200 * The stack trace, as returned by {@link #getStackTrace()}.
201 *
202 * The field is initialized to a zero-length array. A {@code
203 * null} value of this field indicates subsequent calls to {@link
204 * #setStackTrace(StackTraceElement[])} and {@link
205 * #fillInStackTrace()} will be no-ops.
206 *
207 * @serial
208 * @since 1.4
209 */
210 private StackTraceElement[] stackTrace = UNASSIGNED_STACK;
211
212 // Setting this static field introduces an acceptable
213 // initialization dependency on a few java.util classes.
214 private static final List<Throwable> SUPPRESSED_SENTINEL =
215 Collections.unmodifiableList(new ArrayList<Throwable>(0));
216
217 /**
218 * The list of suppressed exceptions, as returned by {@link
219 * #getSuppressed()}. The list is initialized to a zero-element
220 * unmodifiable sentinel list. When a serialized Throwable is
221 * read in, if the {@code suppressedExceptions} field points to a
222 * zero-element list, the field is reset to the sentinel value.
223 *
224 * @serial
225 * @since 1.7
226 */
227 private List<Throwable> suppressedExceptions = SUPPRESSED_SENTINEL;
228
229 /** Message for trying to suppress a null exception. */
230 private static final String NULL_CAUSE_MESSAGE = "Cannot suppress a null exception.";
231
232 /** Message for trying to suppress oneself. */
233 private static final String SELF_SUPPRESSION_MESSAGE = "Self-suppression not permitted";
234
235 /** Caption for labeling causative exception stack traces */
|
194 * @serial
195 * @since 1.4
196 */
197 private Throwable cause = this;
198
199 /**
200 * The stack trace, as returned by {@link #getStackTrace()}.
201 *
202 * The field is initialized to a zero-length array. A {@code
203 * null} value of this field indicates subsequent calls to {@link
204 * #setStackTrace(StackTraceElement[])} and {@link
205 * #fillInStackTrace()} will be no-ops.
206 *
207 * @serial
208 * @since 1.4
209 */
210 private StackTraceElement[] stackTrace = UNASSIGNED_STACK;
211
212 // Setting this static field introduces an acceptable
213 // initialization dependency on a few java.util classes.
214 private static final List<Throwable> SUPPRESSED_SENTINEL =Collections.emptyList();
215
216 /**
217 * The list of suppressed exceptions, as returned by {@link
218 * #getSuppressed()}. The list is initialized to a zero-element
219 * unmodifiable sentinel list. When a serialized Throwable is
220 * read in, if the {@code suppressedExceptions} field points to a
221 * zero-element list, the field is reset to the sentinel value.
222 *
223 * @serial
224 * @since 1.7
225 */
226 private List<Throwable> suppressedExceptions = SUPPRESSED_SENTINEL;
227
228 /** Message for trying to suppress a null exception. */
229 private static final String NULL_CAUSE_MESSAGE = "Cannot suppress a null exception.";
230
231 /** Message for trying to suppress oneself. */
232 private static final String SELF_SUPPRESSION_MESSAGE = "Self-suppression not permitted";
233
234 /** Caption for labeling causative exception stack traces */
|