Lombok: 1.16.18 does not work with Netbeans Dev + Java 9

Created on 7 Jul 2017  路  10Comments  路  Source: projectlombok/lombok

Relates to #985.

When using 1.16.16, Java 9+174 and a recent build of Netbeans (eg 201706210001) there are no issues. When upgrading to 1.16.18, Netbeans no longer recognises any lombok constructs (getters, constructors etc), leading to syntax errors.

The below error is likely the cause and of relevance:

lombok.javac.apt.LombokProcessor could not be initialized. Lombok will not run during this compilation: java.lang.IllegalArgumentException: org.netbeans.modules.java.source.parsing.ProxyFileManager extends java.lang.Object implements javax.tools.JavaFileManager at lombok.javac.apt.LombokFileObjects.getCompiler(LombokFileObjects.java:130) at lombok.javac.apt.InterceptingJavaFileManager.<init>(InterceptingJavaFileManager.java:40) at lombok.javac.apt.LombokProcessor.placePostCompileAndDontMakeForceRoundDummiesHook(LombokProcessor.java:164) at lombok.javac.apt.LombokProcessor.init(LombokProcessor.java:85) at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:87) at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:140) at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init(AnnotationProcessor.java:69) at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:684) at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:786) at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:881) at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2400(JavacProcessingEnvironment.java:110) at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1240) at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1319) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1332) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1220) at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:397) at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:32...

Most helpful comment

I can confirm this. Even when using Java 8 in Netbeans Dev, Netbeans gets confused due to this error when using lombok 1.16.18. Downgrading it to lombok 1.16.16 solves the issue.

All 10 comments

I can confirm this. Even when using Java 8 in Netbeans Dev, Netbeans gets confused due to this error when using lombok 1.16.18. Downgrading it to lombok 1.16.16 solves the issue.

I know that there is a linked issue, but I would like to state it either way: IntelliJ IDEA doesn't work when using lombok 0.16.18 also - it doesn't recognize lombok constructs.

We've created an edge release that probably fixes this. Can someone verify that this version fixes the problem?

@rspilker I tried the edge release in a gradle-based Java 9 project and it made Netbeans Dev 201709210002 get a stroke:

image

This created a brand new bug report in netbeans: http://statistics.netbeans.org/analytics/exception.do?id=864040

Tried with Netbeans Dev 201710260002 (i.e. today's version) and got the same crash (using Java 9).

At least, when I tried to compile it by command line using gradlew build (gradle 4.2.1), it compiled nicely. So, at least the issue with gradle seems to be fixed.

Ah, I think that this means there is progress. No longer the getCompiler that fails. And that was the think I fixed.

I've tried to locate the source file, to see what's going on, but http://hg.netbeans.org/main/file/tip/java.source/src/org/netbeans/modules/java/source/parsing does not contain the source for PatchModuleFileManager.class

Any suggestion how to view the source?

Any progress here about the PatchModuleFileManager?

Resolved in 1.16.20, but now < 9 has regression #1555 :(

Was this page helpful?
0 / 5 - 0 ratings