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 - ClassCastException: com.sun.tools.javac.tree.JCTree$JCCase cannot be cast to com.sun.source.tree.BlockTree
Summary: ClassCastException: com.sun.tools.javac.tree.JCTree$JCCase cannot be cast to ...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: Dev
Hardware: All All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-04 14:04 UTC by Jiri Prox
Modified: 2017-12-27 01:06 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 216059


Attachments
stacktrace (2.40 KB, text/plain)
2017-04-04 14:04 UTC, Jiri Prox
Details
stacktrace (5.10 KB, text/plain)
2017-06-19 19:28 UTC, alied
Details

Note You need to log in before you can comment on or make changes to this bug.
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.