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
Exception occured when Rignt Click to Fix Imports in a class that implements org.springframework.security.core.userdetails.UserDetails and annotated with Lombok @Builder
When removing Lombok @DaTa@builder, Rignt Click / Fix Imports works with no exception.
java.lang.NoSuchFieldError: Class com.sun.tools.javac.parser.Tokens$Comment$CommentStyle does not have member field 'com.sun.tools.javac.parser.Tokens$Comment$CommentStyle JAVADOC'
at lombok.javac.Javac$JavadocOps_8$1.getStyle(Javac.java:364)
at com.sun.tools.javac.parser.DocCommentParser.getTextKind(DocCommentParser.java:171)
at com.sun.tools.javac.parser.DocCommentParser.<init>(DocCommentParser.java:164)
at com.sun.tools.javac.parser.DocCommentParser.<init>(DocCommentParser.java:139)
at com.sun.tools.javac.api.JavacTrees.getDocCommentTree(JavacTrees.java:1130)
at com.sun.tools.javac.parser.LazyDocCommentTable.getCommentTree(LazyDocCommentTable.java:101)
at com.sun.tools.javac.api.JavacTrees.getDocCommentTree(JavacTrees.java:760)
at org.netbeans.modules.java.editor.base.javadoc.JavadocImports.computeTokensOfReferencedElements(JavadocImports.java:181)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.handleJavadoc(FindLocalUsagesQuery.java:93)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.visitMethod(FindLocalUsagesQuery.java:114)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.visitMethod(FindLocalUsagesQuery.java:55)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:989)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)
at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.scan(FindLocalUsagesQuery.java:200)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.scan(FindLocalUsagesQuery.java:55)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:95)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:110)
at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:78)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:118)
at com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:202)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.visitClass(FindLocalUsagesQuery.java:141)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.visitClass(FindLocalUsagesQuery.java:55)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:896)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)
at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.scan(FindLocalUsagesQuery.java:200)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.scan(FindLocalUsagesQuery.java:55)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:95)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:110)
at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:78)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:118)
at com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:202)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.visitClass(FindLocalUsagesQuery.java:141)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.visitClass(FindLocalUsagesQuery.java:55)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:896)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)
at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.scan(FindLocalUsagesQuery.java:200)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.scan(FindLocalUsagesQuery.java:55)
at com.sun.source.util.TreeScanner.scan(TreeScanner.java:110)
at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:78)
at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:118)
at com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:151)
at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:625)
at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)
at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.scan(FindLocalUsagesQuery.java:200)
at org.netbeans.modules.java.editor.base.semantic.FindLocalUsagesQuery.findUsages(FindLocalUsagesQuery.java:77)
at org.netbeans.modules.java.editor.base.semantic.MarkOccurrencesHighlighterBase.processImpl(MarkOccurrencesHighlighterBase.java:338)
at org.netbeans.modules.java.editor.semantic.MarkOccurrencesHighlighter.process(MarkOccurrencesHighlighter.java:93)
at org.netbeans.modules.java.editor.base.semantic.MarkOccurrencesHighlighterBase.run(MarkOccurrencesHighlighterBase.java:99)
at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:561)
at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:786)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:288)
at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702)
[catch] at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:663)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)
Language / Project Type / NetBeans Component
Spring Boot Maven Project
How to reproduce
Create class that implements org.springframework.security.core.userdetails.UserDetails
Probably a duplicate of #7664 and many others. NetBeans 23 uses javac from JDK 23, so you'll need a version of Lombok that supports that. See projectlombok/lombok#3722
Probably a duplicate of #7664 and many others. NetBeans 23 uses javac from JDK 23, so you'll need a version of Lombok that supports that. See projectlombok/lombok#3722
@mtbadi39 you need to update lombok. We have legacy projects, that use lombok, and for these we defined the lombok version as a property and I have an override for that in my local settings so that I can force usage of a compatible lombok version.
Apache NetBeans version
Apache NetBeans 23
What happened
Exception occured when Rignt Click to Fix Imports in a class that implements
org.springframework.security.core.userdetails.UserDetails
and annotated withLombok @Builder
When removing Lombok @DaTa @builder, Rignt Click / Fix Imports works with no exception.
Language / Project Type / NetBeans Component
Spring Boot Maven Project
How to reproduce
Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows 10
JDK
21.0.4; OpenJDK 64-Bit Server VM 21.0.4+7-LTS
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
My Code
Are you willing to submit a pull request?
No
The text was updated successfully, but these errors were encountered: