213
214 /**
215 * The JVM code sets the depth of the backtrace for later retrieval
216 */
217 private transient int depth;
218
219 // Setting this static field introduces an acceptable
220 // initialization dependency on a few java.util classes.
221 private static final List<Throwable> SUPPRESSED_SENTINEL = Collections.emptyList();
222
223 /**
224 * The list of suppressed exceptions, as returned by {@link
225 * #getSuppressed()}. The list is initialized to a zero-element
226 * unmodifiable sentinel list. When a serialized Throwable is
227 * read in, if the {@code suppressedExceptions} field points to a
228 * zero-element list, the field is reset to the sentinel value.
229 *
230 * @serial
231 * @since 1.7
232 */
233 private List<Throwable> suppressedExceptions = SUPPRESSED_SENTINEL;
234
235 /** Message for trying to suppress a null exception. */
236 private static final String NULL_CAUSE_MESSAGE = "Cannot suppress a null exception.";
237
238 /** Message for trying to suppress oneself. */
239 private static final String SELF_SUPPRESSION_MESSAGE = "Self-suppression not permitted";
240
241 /** Caption for labeling causative exception stack traces */
242 private static final String CAUSE_CAPTION = "Caused by: ";
243
244 /** Caption for labeling suppressed exception stack traces */
245 private static final String SUPPRESSED_CAPTION = "Suppressed: ";
246
247 /**
248 * Constructs a new throwable with {@code null} as its detail message.
249 * The cause is not initialized, and may subsequently be initialized by a
250 * call to {@link #initCause}.
251 *
252 * <p>The {@link #fillInStackTrace()} method is called to initialize
|
213
214 /**
215 * The JVM code sets the depth of the backtrace for later retrieval
216 */
217 private transient int depth;
218
219 // Setting this static field introduces an acceptable
220 // initialization dependency on a few java.util classes.
221 private static final List<Throwable> SUPPRESSED_SENTINEL = Collections.emptyList();
222
223 /**
224 * The list of suppressed exceptions, as returned by {@link
225 * #getSuppressed()}. The list is initialized to a zero-element
226 * unmodifiable sentinel list. When a serialized Throwable is
227 * read in, if the {@code suppressedExceptions} field points to a
228 * zero-element list, the field is reset to the sentinel value.
229 *
230 * @serial
231 * @since 1.7
232 */
233 @SuppressWarnings("serial") // Not statically typed as Serializable
234 private List<Throwable> suppressedExceptions = SUPPRESSED_SENTINEL;
235
236 /** Message for trying to suppress a null exception. */
237 private static final String NULL_CAUSE_MESSAGE = "Cannot suppress a null exception.";
238
239 /** Message for trying to suppress oneself. */
240 private static final String SELF_SUPPRESSION_MESSAGE = "Self-suppression not permitted";
241
242 /** Caption for labeling causative exception stack traces */
243 private static final String CAUSE_CAPTION = "Caused by: ";
244
245 /** Caption for labeling suppressed exception stack traces */
246 private static final String SUPPRESSED_CAPTION = "Suppressed: ";
247
248 /**
249 * Constructs a new throwable with {@code null} as its detail message.
250 * The cause is not initialized, and may subsequently be initialized by a
251 * call to {@link #initCause}.
252 *
253 * <p>The {@link #fillInStackTrace()} method is called to initialize
|