You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/12/20 14:42:21 UTC
[GitHub] [netbeans] thmarx opened a new issue, #5125: Netbeans ClassCastException when using Lombog Singular annotation
thmarx opened a new issue, #5125:
URL: https://github.com/apache/netbeans/issues/5125
### Apache NetBeans version
Apache NetBeans 16
### What happened
I get this ClassCastException whenever I open a class file containing the lombok @Singular annotation.
`java.lang.IllegalStateException: java.lang.ClassCastException: class com.sun.tools.javac.tree.JCTree$JCLiteral cannot be cast to class com.sun.tools.javac.tree.JCTree$JCCaseLabel (com.sun.tools.javac.tree.JCTree$JCLiteral and com.sun.tools.javac.tree.JCTree$JCCaseLabel are in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @8b72759)
at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:383)
at org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:770)
at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:540)
at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:141)
at org.netbeans.modules.parsing.impl.TaskProcessor.callGetResult(TaskProcessor.java:608)
at org.netbeans.modules.parsing.impl.SourceCache.getResult(SourceCache.java:241)
at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:775)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:279)
at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702)
at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:663)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)`
### How to reproduce
Use Lomboks Singular annotation.
### Did this work correctly in an earlier version?
Apache NetBeans 15
### Operating System
Windows
### JDK
17 & 19
### Apache NetBeans packaging
Apache NetBeans binary zip
### Anything else
i don't know if it's related. However, the autocomplete doesn't work anymore either. In a Maven project, I can access a class first in a test once I have saved the class.
In the NetBeans log comes a similar exception as above:
`
java.lang.ClassCastException: class com.sun.tools.javac.tree.JCTree$JCLiteral cannot be cast to class com.sun.tools.javac.tree.JCTree$JCCaseLabel (com.sun.tools.javac.tree.JCTree$JCLiteral and com.sun.tools.javac.tree.JCTree$JCCaseLabel are in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @1cd38d20)
at java.base/java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
at java.base/java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1856)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:280)
at java.base/java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1856)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:632)
at com.sun.tools.javac.comp.Attr.handleSwitch(Attr.java:1692)
at com.sun.tools.javac.comp.Attr.visitSwitch(Attr.java:1604)
at com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1287)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:687)
at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:761)
at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:780)
at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1463)
at org.netbeans.lib.nbjavac.services.NBAttr.visitBlock(NBAttr.java:78)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1082)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:687)
at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:761)
at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1253)
at org.netbeans.lib.nbjavac.services.NBAttr.visitMethodDef(NBAttr.java:72)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:912)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:687)
at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:761)
at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:5601)
at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5492)
at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5316)
at com.sun.tools.javac.comp.Attr.visitClassDef(Attr.java:995)
at org.netbeans.lib.nbjavac.services.NBAttr.visitClassDef(NBAttr.java:66)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:810)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:687)
at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:761)
at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:5601)
at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5492)
at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5316)
at com.sun.tools.javac.comp.Attr.attrib(Attr.java:5255)
at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1317)
at com.sun.tools.javac.api.JavacTaskImpl$1.process(JavacTaskImpl.java:409)
at com.sun.tools.javac.api.JavacTaskImpl$Filter.run(JavacTaskImpl.java:519)
at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:412)
[catch] at org.netbeans.modules.java.source.indexing.VanillaCompileWorker.compile(VanillaCompileWorker.java:275)
at org.netbeans.modules.java.source.indexing.JavaCustomIndexer.index(JavaCustomIndexer.java:360)
at org.netbeans.modules.parsing.spi.indexing.Indexable$MyAccessor$2.run(Indexable.java:138)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.runIndexer(RepositoryUpdater.java:274)
at org.netbeans.modules.parsing.spi.indexing.Indexable$MyAccessor.index(Indexable.java:136)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.doIndex(RepositoryUpdater.java:2749)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.lambda$index$0(RepositoryUpdater.java:2626)
at org.netbeans.modules.parsing.impl.indexing.errors.TaskCache.refreshTransaction(TaskCache.java:540)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.index(RepositoryUpdater.java:2625)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.lambda$scanFiles$2(RepositoryUpdater.java:3332)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.lambda$runInContext$4(RepositoryUpdater.java:2119)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:279)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.runInContext(RepositoryUpdater.java:2117)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.runInContext(RepositoryUpdater.java:2098)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.access$1400(RepositoryUpdater.java:135)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.scanFiles(RepositoryUpdater.java:3290)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$FileListWork.getDone(RepositoryUpdater.java:3832)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.doTheWork(RepositoryUpdater.java:3452)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task._run(RepositoryUpdater.java:6197)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.access$3400(RepositoryUpdater.java:5855)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$2.lambda$call$0(RepositoryUpdater.java:6116)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:279)
at org.netbeans.modules.parsing.impl.RunWhenScanFinishedSupport.performScan(RunWhenScanFinishedSupport.java:83)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$2.call(RepositoryUpdater.java:6116)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$2.call(RepositoryUpdater.java:6112)
at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.run(RepositoryUpdater.java:6112)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
WARNING [org.netbeans.modules.java.source.indexing.JavaIndex]: VanillaCompileWorker caused an exception
`
### Are you willing to submit a pull request?
No
### Code of Conduct
Yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] thmarx commented on issue #5125: Netbeans ClassCastException when using Lombok Singular annotation
Posted by "thmarx (via GitHub)" <gi...@apache.org>.
thmarx commented on issue #5125:
URL: https://github.com/apache/netbeans/issues/5125#issuecomment-1457907722
@bartebor great news, I will give it a try.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] bartebor commented on issue #5125: Netbeans ClassCastException when using Lombok Singular annotation
Posted by "bartebor (via GitHub)" <gi...@apache.org>.
bartebor commented on issue #5125:
URL: https://github.com/apache/netbeans/issues/5125#issuecomment-1457903112
@thmarx I have just tried the newest lombok 1.18.26 and it fixed the issue, at least in NetBeans-17 with Java 17.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] thmarx commented on issue #5125: Netbeans ClassCastException when using Lombok Singular annotation
Posted by "thmarx (via GitHub)" <gi...@apache.org>.
thmarx commented on issue #5125:
URL: https://github.com/apache/netbeans/issues/5125#issuecomment-1459937747
Works!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] thmarx commented on issue #5125: Netbeans ClassCastException when using Lombok Singular annotation
Posted by GitBox <gi...@apache.org>.
thmarx commented on issue #5125:
URL: https://github.com/apache/netbeans/issues/5125#issuecomment-1359501783
Here's a minimal example to reproduce.
[TestBuilder.zip](https://github.com/apache/netbeans/files/10269465/TestBuilder.zip)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] thmarx closed issue #5125: Netbeans ClassCastException when using Lombok Singular annotation
Posted by "thmarx (via GitHub)" <gi...@apache.org>.
thmarx closed issue #5125: Netbeans ClassCastException when using Lombok Singular annotation
URL: https://github.com/apache/netbeans/issues/5125
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists