From 931a8a034c1b11a7ed2dd26ec7ad375053e40255 Mon Sep 17 00:00:00 2001 From: hduelme Date: Mon, 11 May 2026 11:47:33 +0200 Subject: [PATCH] registerAsParallelCapable for ModifiableURLClassLoader directly --- .../ap/testutil/runner/ModifiableURLClassLoader.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) 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 - } - } }