You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a multi-release jar file with no module-info.class in the base version and no Automatic-Module-Name, but with a module-info.class in the version for the currently running JDK version, is present on the module path, delombok fails to correctly resolve the module name according to the included module-info.class and falls back to the jars name. If the jar is not named the same as the module this will lead to to errors during delomboking.
To Reproduce
Find or create such a multi-release jar (for example org.jetbrains:annotations:24.0.1)
Compile with javac -d out -p lib/annotations.jar:lib/lombok.jar src/org/example/Main.java src/module-info.java. This will be successful.
Now try delomboking the source files with java -jar lib/lombok.jar delombok --module-path lib/annotations.jar -d delombok src. This will produce the following error:
/path/to/src/module-info.java:2: error: module not found: org.jetbrains.annotations
requires static org.jetbrains.annotations;
Expected behavior
Delombok should choose the correct version of the multi-release jar according to the current jdk version and correctly resolve the module name according the the module-info. Step 4 should not produce any errors. Step 6 should however.
Additional context com.sun.tools.javac.main.Main::compile uses the following code to set up the multi-release version
// init multi-release jar handlingif (fileManager.isSupportedOption(Option.MULTIRELEASE.primaryName) == 1) {
Targettarget = Target.instance(context);
List<String> list = List.of(target.multiReleaseValue());
fileManager.handleOption(Option.MULTIRELEASE.primaryName, list.iterator());
}
defaulting to the currently running version of the jdk (overridable with the hidden option --multi-release <version>). lombok.delombok.Delombok is missing similar code resulting in a fallback to the jar file name in com.sun.tools.javac.file.Locations.ModulePathLocationHandler.ModulePathIterator::inferModuleName.
The text was updated successfully, but these errors were encountered:
Describe the bug
When a multi-release jar file with no module-info.class in the base version and no Automatic-Module-Name, but with a module-info.class in the version for the currently running JDK version, is present on the module path, delombok fails to correctly resolve the module name according to the included module-info.class and falls back to the jars name. If the jar is not named the same as the module this will lead to to errors during delomboking.
To Reproduce
org.jetbrains:annotations:24.0.1
)with
Main.java
and
module-info.java
javac -d out -p lib/annotations.jar:lib/lombok.jar src/org/example/Main.java src/module-info.java
. This will be successful.java -jar lib/lombok.jar delombok --module-path lib/annotations.jar -d delombok src
. This will produce the following error:module-info.java
toExpected behavior
Delombok should choose the correct version of the multi-release jar according to the current jdk version and correctly resolve the module name according the the module-info. Step 4 should not produce any errors. Step 6 should however.
Version info:
$ java -jar lib/lombok.jar --version v1.18.24 "Envious Ferret"
Additional context
com.sun.tools.javac.main.Main::compile
uses the following code to set up the multi-release versiondefaulting to the currently running version of the jdk (overridable with the hidden option
--multi-release <version>
).lombok.delombok.Delombok
is missing similar code resulting in a fallback to the jar file name incom.sun.tools.javac.file.Locations.ModulePathLocationHandler.ModulePathIterator::inferModuleName
.The text was updated successfully, but these errors were encountered: