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 267941

Summary: ClassCastException: com.sun.tools.javac.tree.JCTree$JCLambda cannot be cast to com.sun.source.tree.StatementTree
Product: debugger Reporter: Vladimir Voskresensky <vv159170>
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: RESOLVED FIXED    
Severity: normal Keywords: 82_HR_FIX
Priority: P1    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 226142
Attachments: stacktrace

Description Vladimir Voskresensky 2016-09-08 10:52:45 UTC
Build: NetBeans IDE Dev (Build 20160905-d011a8fc67ce)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.92-b14, Java(TM) SE Runtime Environment, 1.8.0_92-b14
OS: SunOS

User Comments:
vv159170: switched to debugger Variables view




Stacktrace: 
java.lang.ClassCastException: com.sun.tools.javac.tree.JCTree$JCLambda cannot be cast to com.sun.source.tree.StatementTree
   at org.netbeans.modules.debugger.jpda.projects.IntroduceClass.getStatements(IntroduceClass.java:254)
   at org.netbeans.modules.debugger.jpda.projects.IntroduceClass.computeIntroduceMethod(IntroduceClass.java:112)
   at org.netbeans.modules.debugger.jpda.projects.CodeSnippetCompiler.compileToClass(CodeSnippetCompiler.java:76)
   at org.netbeans.modules.debugger.jpda.projects.PreferredCCParser.interpretOrCompileCode(PreferredCCParser.java:527)
   at org.netbeans.modules.debugger.jpda.projects.EditorContextSupport.interpretOrCompileCode(EditorContextSupport.java:1452)
   at org.netbeans.modules.debugger.jpda.projectsui.EditorContextImpl.interpretOrCompileCode(EditorContextImpl.java:860)
Comment 1 Vladimir Voskresensky 2016-09-08 10:52:47 UTC
Created attachment 161967 [details]
stacktrace
Comment 2 Martin Entlicher 2016-09-13 12:01:22 UTC
Reproduced.
Comment 3 Martin Entlicher 2016-09-13 16:42:05 UTC
This, together with issue #267994, should be fixed into 8.2 so that we do not get exceptions during lambda evaluations.
Comment 4 Martin Entlicher 2016-09-13 16:45:29 UTC
Fixed by changeset:   300697:67f31e5c2c2a
http://hg.netbeans.org/core-main/rev/67f31e5c2c2a
Comment 5 Martin Entlicher 2016-09-13 16:46:04 UTC
Please verify so that we can back-port to 8.2. Thanks.
Comment 6 Quality Engineering 2016-09-15 02:05:15 UTC
Integrated into 'main-silver', will be available in build *201609150002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/67f31e5c2c2a
User: mentlicher@netbeans.org
Log: #267941, #267994: Make lambda evaluations more robust.
Comment 7 Vladimir Voskresensky 2016-09-16 12:38:33 UTC
I don't remember exact steps, but fast checks doesn't reproduce the problem.
Comment 8 Jiri Kovalsky 2016-09-16 15:28:10 UTC
Integration to release82 branch approved. Martine, please merge the fix. Thanks.
Comment 9 Martin Entlicher 2016-09-16 15:41:10 UTC
Thanks for the check Vladimir and for the approval, Jirko.
The backport is there:
http://hg.netbeans.org/releases/rev/8691116b10cf