Skip to content

Commit

Permalink
Try fixing the last JDK21-failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Oct 18, 2023
1 parent 7d0829b commit d86119b
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,19 @@ public void testCauseOfThrowableIgnoral() throws Exception
ObjectMapper mapper = jsonMapperBuilder()
.disable(MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS)
.build();
// 17-Oct-2023, tatu: JDK 21 has hard fail, try to work around:
boolean setSucceeded = false;
try {
System.setSecurityManager(new CauseBlockingSecurityManager());
setSucceeded = true;
_testCauseOfThrowableIgnoral(mapper);
} catch (UnsupportedOperationException e) {
// JDK 21+ fail?
verifyException(e, "Security Manager is deprecated");
} finally {
System.setSecurityManager(origSecMan);
if (setSucceeded) {
System.setSecurityManager(origSecMan);
}
}
}

Expand Down

0 comments on commit d86119b

Please sign in to comment.