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 270296

Summary: ClassCastException: com.sun.tools.javac.tree.JCTree$JCCase cannot be cast to com.sun.source.tree.BlockTree
Product: java Reporter: Jiri Prox <jiriprox>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal CC: alied, dtrebbien
Priority: P3    
Version: Dev   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 216059
Attachments: stacktrace
stacktrace

Description Jiri Prox 2017-04-04 14:04:28 UTC
Build: NetBeans IDE Dev (Build 201703270002)
VM: Java HotSpot(TM) 64-Bit Server VM, 9-ea+162, Java(TM) SE Runtime Environment, 9-ea+162
OS: Windows 7

User Comments:
GUEST: Select code : DateTimeFormat.shortDateTime() (from JodaTime library) -> refactor -> introduce Field

jiriprox: Performing introduce field o

GUEST: I do not saw any interruption on screen. I do not know how to provide more information at this time.




Stacktrace: 
java.lang.ClassCastException: com.sun.tools.javac.tree.JCTree$JCCase cannot be cast to com.sun.source.tree.BlockTree
   at org.netbeans.modules.java.hints.introduce.IntroduceFieldFix$Worker.initializeFromMethod(IntroduceFieldFix.java:224)
   at org.netbeans.modules.java.hints.introduce.IntroduceFieldFix$Worker.run(IntroduceFieldFix.java:372)
   at org.netbeans.modules.java.hints.introduce.IntroduceFieldFix$Worker.run(IntroduceFieldFix.java:190)
   at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:694)
   at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:684)
   at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:523)
Comment 1 Jiri Prox 2017-04-04 14:04:30 UTC
Created attachment 164023 [details]
stacktrace
Comment 2 alied 2017-06-19 19:28:26 UTC
Created attachment 164574 [details]
stacktrace

meddling with some Lambda Wizardry. Lots of unspeakable things were done :-)
Comment 3 dtrebbien 2017-12-03 00:22:10 UTC
I have reproduced the exception and opened a Pull Request to fix the issue: https://github.com/apache/incubator-netbeans/pull/315
Comment 4 dtrebbien 2017-12-27 01:06:36 UTC
Closing as PR 315 has been merged.