javac crash when combined with Lombok
See original GitHub issueRunning the Manifold and Lombok plugins together causes javac to crash/misbehave when there are compilation warnings/errors.
Both examples below are using these javac arguments:
javac -processorpath /path/to/lombok-1.18.10.jar:/path/to/manifold-util-2019.1.26.jar:/path/to/manifold-2019.1.26.jar "-Xplugin:Manifold no-bootstrap"
- javac crashes if the input contains syntax errors.
Given this class as input:
class Test {} }
…javac crashes with this exception in ManifoldJavaFileManager:
An exception has occurred in the compiler (11.0.2). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.NullPointerException
at manifold.internal.javac.ManifoldJavaFileManager.list(ManifoldJavaFileManager.java:203)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:734)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.scanModulePaths(ClassFinder.java:597)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:553)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:299)
at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:642)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.completeOwners(ClassFinder.java:313)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:289)
at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:642)
at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1326)
at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.members(Symbol.java:1264)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.findAccessMethod(ClassReader.java:2135)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompound(ClassReader.java:2126)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompoundList(ClassReader.java:2115)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader$AnnotationCompleter.run(ClassReader.java:2334)
at jdk.compiler/com.sun.tools.javac.comp.Annotate.flush(Annotate.java:191)
at jdk.compiler/com.sun.tools.javac.comp.Annotate.unblockAnnotations(Annotate.java:144)
at jdk.compiler/com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:157)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterDone(JavaCompiler.java:1741)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.initModules(JavaCompiler.java:1047)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:939)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:311)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
- Compilation warnings are not reported correctly, and
-Werror
has no effect.
When compiling this class using -Xlint:all -Werror
:
class Test {int x = 1/0;}
…it should print the following output:
Test.java:1: warning: [divzero] division by zero
class Test {int x = 1/0;}
^
error: warnings found and -Werror specified
1 error
1 warning
…as well as setting a nonzero exit code, and terminating without producing a .class file.
However, the last 3 lines are absent, the resulting exit code is zero, and the .class is successfully created.
Relevant versions:
- Windows 10
- OpenJDK 11.0.2+9
- Manifold 2019.1.26
- Lombok 1.18.10
Both plugins work fine on their own, or when used together with ErrorProne, so the problem appears to be specific to this combination.
Issue Analytics
- State:
- Created 4 years ago
- Comments:20 (15 by maintainers)
Top Results From Across the Web
Can't compile project when I'm using Lombok under IntelliJ IDEA
Click the + symbol to add a new project library (or press Alt + Insert ). Select Java. Set the path to: $HOME/dev/java/project/libs/lombok....
Read more >lombok 1.14.0 Can't get the root cause of error with @Builder
Sorry, I mixed up the versions badly! Now I see that 683 has been fixed after 1.14.0 (where it actually came in). I'd...
Read more >Lombok Changelog
Issue #3053. BUGFIX: Combining @NonNullByDefault and lombok.addNullAnnotations would generate two @Nullable annotations and thus generate a compiler error.
Read more >Don't use Lombok - Medium
However, I didn't understand the need to transform Java into a fancy language using a ... in fact, introduced a small bug hard...
Read more >Project Lombok - Getter, Setter and Constructor Example
Adding the Lombok Plugin in IDE (Eclipse) · Execute command in terminal: java -jar lombok.jar · This command will open window as shown...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found the core issue. Should have a fix incorporated in the next release within a week.
Yes. I’m hopeful to have this fixed soon. I’ll keep you posted.