File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
junit-platform-console/src/main/java/org/junit/platform/console/tasks Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -31,17 +31,13 @@ public enum CustomClassLoaderCloseStrategy {
3131
3232 @ Override
3333 public void handle (ClassLoader customClassLoader ) {
34- if (customClassLoader instanceof AutoCloseable closeable ) {
35- close (closeable );
36- }
37- }
38-
39- private void close (AutoCloseable customClassLoader ) {
40- try {
41- customClassLoader .close ();
42- }
43- catch (Exception e ) {
44- throw new JUnitException ("Failed to close custom class loader" , e );
34+ if (customClassLoader instanceof @ SuppressWarnings ("resource" ) AutoCloseable closeable ) {
35+ try {
36+ closeable .close ();
37+ }
38+ catch (Exception ex ) {
39+ throw new JUnitException ("Failed to close custom class loader" , ex );
40+ }
4541 }
4642 }
4743 },
@@ -54,6 +50,7 @@ private void close(AutoCloseable customClassLoader) {
5450 * afterward.
5551 */
5652 KEEP_OPEN {
53+
5754 @ Override
5855 public void handle (ClassLoader customClassLoader ) {
5956 // do nothing
You can’t perform that action at this time.
0 commit comments