From 9bcaaafed4646ae750bf8d6ca7e3b1c549dc41f1 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Wed, 20 Sep 2023 04:08:36 +0200 Subject: [PATCH] [fixes #3474] lombok.jar now contains zero paths that could clash with other modules, as that's already enough to trigger split package errors from jigsaw. --- buildScripts/compile.ant.xml | 2 +- doc/changelog.markdown | 1 + src/launch/lombok/launch/ShadowClassLoader.java | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/buildScripts/compile.ant.xml b/buildScripts/compile.ant.xml index 7fe766558d..9993333d0a 100644 --- a/buildScripts/compile.ant.xml +++ b/buildScripts/compile.ant.xml @@ -282,7 +282,7 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating - + diff --git a/doc/changelog.markdown b/doc/changelog.markdown index 5c7e5117ae..813e8e27b4 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -10,6 +10,7 @@ Lombok Changelog * BUGFIX: Calling extension methods such that automatic widening is applied (i.e. calling `void ext(long arg)` with an `int`) would fail at runtime. [Issue #3463](https://github.com/projectlombok/lombok/issues/3463). * BUGFIX: Extension methods can now be used in records. [Issue #3450](https://github.com/projectlombok/lombok/issues/3450). * BUGFIX: `@Getter(lazy=true)` with complicated initialization expressions would fail on javac. [Issue #3314](https://github.com/projectlombok/lombok/issues/3314). +* BUGFIX: Using the maven surefire plugin with a `module-info.java` based project would fail with a `SurefireBooterForkException`. [Issue #3474](https://github.com/projectlombok/lombok/issues/3474). ### v1.18.28 (May 24th, 2023) * PLATFORM: JDK20 support added. [Issue #3353](https://github.com/projectlombok/lombok/issues/3353). diff --git a/src/launch/lombok/launch/ShadowClassLoader.java b/src/launch/lombok/launch/ShadowClassLoader.java index 013f46e532..b418a7f843 100644 --- a/src/launch/lombok/launch/ShadowClassLoader.java +++ b/src/launch/lombok/launch/ShadowClassLoader.java @@ -430,9 +430,13 @@ private boolean isPartOfShadowSuffix(String url, String name, String suffix) { return false; } + private String toSclResourceName(String name) { + return "SCL." + sclSuffix + "/" + name.substring(0, name.length() - 6) + ".SCL." + sclSuffix; + } + @Override public Enumeration getResources(String name) throws IOException { String altName = null; - if (name.endsWith(".class")) altName = name.substring(0, name.length() - 6) + ".SCL." + sclSuffix; + if (name.endsWith(".class")) altName = toSclResourceName(name); // Vector? Yes, we need one: // * We can NOT make inner classes here (this class is loaded with special voodoo magic in eclipse, as a one off, it's not a full loader. @@ -475,7 +479,7 @@ private boolean isPartOfShadowSuffix(String url, String name, String suffix) { private URL getResource_(String name, boolean noSuper) { String altName = null; name = shader == null ? name : shader.reverseResourceName(name); - if (name.endsWith(".class")) altName = name.substring(0, name.length() - 6) + ".SCL." + sclSuffix; + if (name.endsWith(".class")) altName = toSclResourceName(name); for (File ce : override) { URL url = getResourceFromLocation(name, altName, ce);