26
26
import java .util .Set ;
27
27
28
28
/**
29
- * Exception that is a composite of 1 or more other exceptions.
30
- * A CompositeException does not modify the structure of any exception it wraps, but at print-time
31
- * iterates through the list of contained Throwables to print them all.
29
+ * An Exception that is a composite of one or more other Exceptions. A {@code CompositeException} does not
30
+ * modify the structure of any exception it wraps, but at print-time it iterates through the list of
31
+ * Throwables contained in the composit in order to print them all.
32
32
*
33
- * Its invariant is to contains an immutable, ordered (by insertion order), unique list of non-composite exceptions.
34
- * This list may be queried by {@code #getExceptions()}
33
+ * Its invariant is to contain an immutable, ordered (by insertion order), unique list of non-composite
34
+ * exceptions. You can retrieve individual exceptions in this list with {@link #getExceptions()}.
35
35
*
36
- * The ` printStackTrace()` implementation does custom handling of the StackTrace instead of using `getCause()` so it
37
- * can avoid circular references.
36
+ * The {@link # printStackTrace()} implementation handles the StackTrace in a customized way instead of using
37
+ * {@code getCause()} so that it can avoid circular references.
38
38
*
39
- * If ` getCause()` is invoked , it will lazily create the causal chain but stop if it finds any Throwable in the chain
40
- * that it has already seen.
39
+ * If you invoke {@link # getCause()} , it will lazily create the causal chain but will stop if it finds any
40
+ * Throwable in the chain that it has already seen.
41
41
*/
42
42
public final class CompositeException extends RuntimeException {
43
43
@@ -124,13 +124,14 @@ public synchronized Throwable getCause() {
124
124
}
125
125
126
126
/**
127
- * All of the following printStackTrace functionality is derived from JDK Throwable printStackTrace.
128
- * In particular, the PrintStreamOrWriter abstraction is copied wholesale.
127
+ * All of the following {@code printStackTrace} functionality is derived from JDK {@link Throwable}
128
+ * {@code printStackTrace}. In particular, the {@code PrintStreamOrWriter} abstraction is copied wholesale.
129
129
*
130
- * Changes from the official JDK implementation:
131
- * * No infinite loop detection
132
- * * Smaller critical section holding printStream lock
133
- * * Explicit knowledge about exceptions List that this loops through
130
+ * Changes from the official JDK implementation:<ul>
131
+ * <li>no infinite loop detection</li>
132
+ * <li>smaller critical section holding {@link PrintStream} lock</li>
133
+ * <li>explicit knowledge about the exceptions {@link List} that this loops through</li>
134
+ * </ul>
134
135
*/
135
136
@ Override
136
137
public void printStackTrace () {
@@ -148,8 +149,8 @@ public void printStackTrace(PrintWriter s) {
148
149
}
149
150
150
151
/**
151
- * Special handling for printing out a CompositeException
152
- * Loop through all inner exceptions and print them out
152
+ * Special handling for printing out a {@code CompositeException}.
153
+ * Loops through all inner exceptions and prints them out.
153
154
*
154
155
* @param s
155
156
* stream to print to
0 commit comments