Skip to content

Commit

Permalink
[fixes #3474] lombok.jar now contains zero paths that could clash wit…
Browse files Browse the repository at this point in the history
…h other modules, as that's already enough to trigger split package errors from jigsaw.
  • Loading branch information
rzwitserloot committed Sep 20, 2023
1 parent 9ef9b58 commit 9bcaaaf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion buildScripts/compile.ant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating</echo>
<patternset refid="packing.shadowed" />
</multirootfileset>
<firstmatchmapper>
<globmapper from="*.class" to="*.SCL.lombok" />
<globmapper from="*.class" to="SCL.lombok/*.SCL.lombok" />
<identitymapper />
</firstmatchmapper>
</mappedresources>
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
8 changes: 6 additions & 2 deletions src/launch/lombok/launch/ShadowClassLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<URL> 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.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9bcaaaf

Please sign in to comment.