You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "tmulle (via GitHub)" <gi...@apache.org> on 2023/03/06 22:28:42 UTC

[GitHub] [netbeans] tmulle opened a new issue, #5618: NB17: 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

tmulle opened a new issue, #5618:
URL: https://github.com/apache/netbeans/issues/5618

   ### Apache NetBeans version
   
   Apache NetBeans 17
   
   ### What happened
   
   When opening our large multi-module maven project, as Netbeans is scanning the project files I see this error in the Notifications Window.
   
   ```
   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 @43c0d4a3)
   	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:1693)
   	at com.sun.tools.javac.comp.Attr.visitSwitch(Attr.java:1605)
   	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:1464)
   	at org.netbeans.lib.nbjavac.services.NBAttr.visitBlock(NBAttr.java:90)
   	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:1254)
   	at org.netbeans.lib.nbjavac.services.NBAttr.visitMethodDef(NBAttr.java:84)
   	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:5604)
   	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5495)
   	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5319)
   	at org.netbeans.lib.nbjavac.services.NBAttr.attribClass(NBAttr.java:72)
   	at com.sun.tools.javac.comp.Attr.visitClassDef(Attr.java:995)
   	at org.netbeans.lib.nbjavac.services.NBAttr.visitClassDef(NBAttr.java:78)
   	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:5604)
   	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5495)
   	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5319)
   	at org.netbeans.lib.nbjavac.services.NBAttr.attribClass(NBAttr.java:72)
   	at com.sun.tools.javac.comp.Attr.attrib(Attr.java:5258)
   	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:284)
   	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$AbstractRootsWork.lambda$scanSource$3(RepositoryUpdater.java:5735)
   	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.lambda$runInContext$4(RepositoryUpdater.java:2119)
   	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:288)
   	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$AbstractRootsWork.scanSource(RepositoryUpdater.java:5770)
   	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$AbstractRootsWork.scanSources(RepositoryUpdater.java:5443)
   	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.getDone(RepositoryUpdater.java:5075)
   	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:288)
   	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:287)
   	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
   
   ```
   
   ### How to reproduce
   
   Unfortunately, I can send any reproducers since it only happens in our large company codebase.
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   MacOS Ventura
   
   ### JDK
   
   JDK17
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   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] bartebor commented on issue #5618: NB17: com.sun.tools.javac.tree.JCTree$JCLiteral cannot be cast to class com.sun.tools.javac.tree.JCTree$JCCaseLabel

Posted by "bartebor (via GitHub)" <gi...@apache.org>.
bartebor commented on issue #5618:
URL: https://github.com/apache/netbeans/issues/5618#issuecomment-1457868508

   @tmulle Do you use Lombok? Does it something in common with #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


[GitHub] [netbeans] tmulle commented on issue #5618: NB17: com.sun.tools.javac.tree.JCTree$JCLiteral cannot be cast to class com.sun.tools.javac.tree.JCTree$JCCaseLabel

Posted by "tmulle (via GitHub)" <gi...@apache.org>.
tmulle commented on issue #5618:
URL: https://github.com/apache/netbeans/issues/5618#issuecomment-1458094692

   @bartebor Yes, and I do use the Singular annotation as well. I upgraded to the latest Lombok 1.18.26 and it seems to stop the error when opening the project. 


-- 
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 #5618: NB17: com.sun.tools.javac.tree.JCTree$JCLiteral cannot be cast to class com.sun.tools.javac.tree.JCTree$JCCaseLabel

Posted by "bartebor (via GitHub)" <gi...@apache.org>.
bartebor commented on issue #5618:
URL: https://github.com/apache/netbeans/issues/5618#issuecomment-1459587344

   @tmulle You are right, I see similar errors in my code. Seem harmless, but still. I'm wondering, if it should be reported to the lombok team as it is very similar to this issue and lombok upgrade helped here.


-- 
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] tmulle commented on issue #5618: NB17: com.sun.tools.javac.tree.JCTree$JCLiteral cannot be cast to class com.sun.tools.javac.tree.JCTree$JCCaseLabel

Posted by "tmulle (via GitHub)" <gi...@apache.org>.
tmulle commented on issue #5618:
URL: https://github.com/apache/netbeans/issues/5618#issuecomment-1458112184

   @bartebor Do you have any other Lombok annotations? I just ran into a new bug #5621 when I try to open the file with the `Singular` annotation and others from Lombok. 


-- 
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