This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271366

Summary: ClassCastException: com.sun.tools.javac.tree.JCTree$JCLambda cannot be cast to com.sun.tools.javac.tree.JCTree$JCMethodInvocation
Product: java Reporter: alied <alied>
Component: CompilerAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal CC: alied, JTD, kaenganxt, mig_soft
Priority: P2    
Version: Dev   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 222969
Attachments: stacktrace
stacktrace
stacktrace
stacktrace

Description alied 2017-08-24 17:38:21 UTC
Build: NetBeans IDE Dev (Build 201708240001)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.141-b15, Java(TM) SE Runtime Environment, 1.8.0_141-b15
OS: Linux

User Comments:
JTD: Pasted the following line of code into a source file:

            retVal = WarningDialog.showConfirmDialog(stage, "Are you sure you want to accept this signature?", WarningDialog.SigConfirm);

lhochet: pasting some code

alied: invoked code completion with a stream.




Stacktrace: 
java.lang.ClassCastException: com.sun.tools.javac.tree.JCTree$JCLambda cannot be cast to com.sun.tools.javac.tree.JCTree$JCMethodInvocation
   at com.sun.tools.javac.comp.ArgumentAttr$ResolvedMethodType.dup(ArgumentAttr.java:588)
   at com.sun.tools.javac.comp.ArgumentAttr.processArg(ArgumentAttr.java:236)
   at com.sun.tools.javac.comp.ArgumentAttr.visitLambda(ArgumentAttr.java:289)
   at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1807)
   at com.sun.tools.javac.comp.ArgumentAttr.attribArg(ArgumentAttr.java:193)
   at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:656)
Comment 1 alied 2017-08-24 17:38:24 UTC
Created attachment 165004 [details]
stacktrace
Comment 2 alied 2017-08-24 17:53:05 UTC
Created attachment 165005 [details]
stacktrace

the error occurred just after I wrote
aCollection.stream()
I selected stream() from the code completion.
Comment 3 Dusan Balek 2017-08-25 12:49:54 UTC
Hard to fix without a reproducible test case. If the issue is reproducible, could you please create a simple test case and attach it to the issue? Thanks.
Comment 4 alied 2017-08-26 03:05:35 UTC
I'm not sure about the pattern. As soon as I'm able to reproduce it reliably I'll attach a sample case.
Comment 5 Exceptions Reporter 2017-09-27 15:38:37 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=222969
Comment 6 Exceptions Reporter 2017-09-27 15:41:39 UTC
Created attachment 165191 [details]
stacktrace

Editing String constant
Comment 7 Exceptions Reporter 2017-09-29 17:29:38 UTC
Created attachment 165209 [details]
stacktrace

Don't know.
Comment 8 Exceptions Reporter 2017-12-31 07:27:39 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=222969