mbien opened a new issue, #4758: URL: https://github.com/apache/netbeans/issues/4758
### Body migrated issue from [NETBEANS-6025](https://issues.apache.org/jira/browse/NETBEANS-6025). Still reproducible in NB 15. The first rule works. The second rule never captures anything, the third causes a class cast exception. ```java $stream.mapToObj($lambda) :: $stream instanceof java.util.stream.IntStream => $stream.boxed() ;; $stream.mapToObj($x -> $x) :: $stream instanceof java.util.stream.IntStream => $stream.boxed() ;; $stream.mapToObj(($x) -> $x) :: $stream instanceof java.util.stream.IntStream => $stream.boxed() ;; ``` ```java // test snippet: IntStream.of(1,2,3).mapToObj(x -> x); ``` <details> <summary>exception of third rule:</summary> ``` java.lang.ClassCastException: class org.netbeans.modules.java.hints.spiimpl.JackpotTrees$VariableDeclWildcard cannot be cast to class com.sun.tools.javac.tree.JCTree$JCIdent (org.netbeans.modules.java.hints.spiimpl.JackpotTrees$VariableDeclWildcard is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @24b6d0a8; com.sun.tools.javac.tree.JCTree$JCIdent is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @68b9c85e) at com.sun.tools.javac.tree.TreeCopier.visitIdentifier(TreeCopier.java:244) at com.sun.tools.javac.tree.TreeCopier.visitIdentifier(TreeCopier.java:44) at org.netbeans.modules.java.hints.spiimpl.JackpotTrees$VariableDeclWildcard.accept(JackpotTrees.java:80) at com.sun.tools.javac.tree.TreeCopier.copy(TreeCopier.java:60) at com.sun.tools.javac.tree.TreeCopier.copy(TreeCopier.java:72) at com.sun.tools.javac.tree.TreeCopier.visitBlock(TreeCopier.java:135) at com.sun.tools.javac.tree.TreeCopier.visitBlock(TreeCopier.java:44) at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1094) at com.sun.tools.javac.tree.TreeCopier.copy(TreeCopier.java:60) at com.sun.tools.javac.tree.TreeCopier.copy(TreeCopier.java:53) at com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:479) at com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:467) at com.sun.tools.javac.comp.DeferredAttr.attribSpeculativeLambda(DeferredAttr.java:442) at com.sun.tools.javac.comp.ArgumentAttr.lambda$visitLambda$4(ArgumentAttr.java:301) at com.sun.tools.javac.comp.ArgumentAttr.processArg(ArgumentAttr.java:242) at com.sun.tools.javac.comp.ArgumentAttr.visitLambda(ArgumentAttr.java:299) at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1976) at com.sun.tools.javac.comp.ArgumentAttr.attribArg(ArgumentAttr.java:197) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:685) at com.sun.tools.javac.comp.Attr.attribArgs(Attr.java:788) at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:2584) at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1799) at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:687) at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:733) at org.netbeans.modules.java.hints.spiimpl.Utilities.attributeTree(Utilities.java:648) at org.netbeans.modules.java.hints.spiimpl.Utilities.parseAndAttribute(Utilities.java:427) at org.netbeans.modules.java.hints.spiimpl.Utilities.parseAndAttribute(Utilities.java:341) at org.netbeans.modules.java.hints.spiimpl.Utilities.parseAndAttribute(Utilities.java:321) at org.netbeans.modules.java.hints.spiimpl.Utilities.parseAndAttribute(Utilities.java:317) at org.netbeans.modules.java.hints.spiimpl.pm.PatternCompiler.compile(PatternCompiler.java:44) at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.doComputeHints(HintsInvoker.java:534) at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHintsImpl(HintsInvoker.java:282) at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:227) at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:192) at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:165) at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:127) at org.netbeans.modules.java.hints.spiimpl.hints.HintsTask.run(HintsTask.java:113) at org.netbeans.modules.java.hints.spiimpl.hints.HintsTask.run(HintsTask.java:63) [catch] at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:273) 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: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:515) 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) ``` </details> ### Committer - [X] I acknowledge that I am a maintainer/committer in the Apache NetBeans 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
