Skip to content

Commit 0493c15

Browse files
committed
fixed build breakage: There is no AssertionError constructor that takes a cause on JDK1.6.
1 parent 74c6dd0 commit 0493c15

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/owasp/html/AutoCloseableHtmlStreamRenderer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ static void closeIfAnyCloseable(Object closeable) throws IOException {
7676
try {
7777
METHOD_CLOSE.invoke(closeable, ZERO_OBJECTS);
7878
} catch (IllegalAccessException ex) {
79-
throw new AssertionError("close not public", ex);
79+
AssertionError ae = new AssertionError("close not public");
80+
ae.initCause(ex);
81+
throw ae;
8082
} catch (InvocationTargetException ex) {
8183
Throwable tgt = ex.getTargetException();
8284
if (tgt instanceof IOException) {

0 commit comments

Comments
 (0)