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 {
31
31
32
32
@ Override
33
33
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
+ }
45
41
}
46
42
}
47
43
},
@@ -54,6 +50,7 @@ private void close(AutoCloseable customClassLoader) {
54
50
* afterward.
55
51
*/
56
52
KEEP_OPEN {
53
+
57
54
@ Override
58
55
public void handle (ClassLoader customClassLoader ) {
59
56
// do nothing
You can’t perform that action at this time.
0 commit comments