diff --git a/processor/src/test/java/org/mapstruct/ap/testutil/runner/ModifiableURLClassLoader.java b/processor/src/test/java/org/mapstruct/ap/testutil/runner/ModifiableURLClassLoader.java index 2dd5d5b8e7..1ee5418096 100644 --- a/processor/src/test/java/org/mapstruct/ap/testutil/runner/ModifiableURLClassLoader.java +++ b/processor/src/test/java/org/mapstruct/ap/testutil/runner/ModifiableURLClassLoader.java @@ -6,7 +6,6 @@ package org.mapstruct.ap.testutil.runner; import java.io.File; -import java.lang.reflect.InvocationTargetException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; @@ -28,7 +27,7 @@ final class ModifiableURLClassLoader extends URLClassLoader { ORG_MAPSTRUCT_AP_TEST ); static { - tryRegisterAsParallelCapable(); + ClassLoader.registerAsParallelCapable(); } private final ConcurrentMap addedURLs = new ConcurrentHashMap<>(); @@ -95,13 +94,4 @@ ModifiableURLClassLoader withPath(String path) { return this; } - private static void tryRegisterAsParallelCapable() { - try { - ClassLoader.class.getMethod( "registerAsParallelCapable" ).invoke( null ); - } - catch ( NoSuchMethodException | SecurityException | IllegalAccessException - | IllegalArgumentException | InvocationTargetException e ) { - return; // ignore - } - } }