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 208635 - ClassCastException: com.sun.tools.javac.tree.JCTree$JCIdent cannot be cast to com.sun.source.tree.StatementTree
Summary: ClassCastException: com.sun.tools.javac.tree.JCTree$JCIdent cannot be cast to...
Status: RESOLVED INCOMPLETE
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-20 10:19 UTC by tmky2k
Modified: 2012-04-03 11:00 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 178543


Attachments
stacktrace (9.11 KB, text/plain)
2012-02-20 10:19 UTC, tmky2k
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tmky2k 2012-02-20 10:19:28 UTC
Build: NetBeans IDE 7.1 (Build 201112071828)
VM: Java HotSpot(TM) Client VM, 22.1-b02, Java(TM) SE Runtime Environment, 1.7.0_03-b05
OS: Windows XP

User Comments:
pvdissel: Tried to refactor a variable in a method to a class field

eaili: Tried to move 
Service service = Lookup.getDefault().lookup(Service.class);
into field assigned by constructor using Introduce field.

GUEST: Refactoring - introduce field




Stacktrace: 
java.lang.ClassCastException: com.sun.tools.javac.tree.JCTree$JCIdent cannot be cast to com.sun.source.tree.StatementTree
   at org.netbeans.modules.java.source.builder.TreeFactory.Block(TreeFactory.java:170)
   at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.rewriteChildren(ImmutableTreeTranslator.java:627)
   at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitBlock(ImmutableTreeTranslator.java:367)
   at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitBlock(ImmutableTreeTranslator.java:92)
   at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:795)
   at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.translate(ImmutableTreeTranslator.java:134)
Comment 1 tmky2k 2012-02-20 10:19:32 UTC
Created attachment 115941 [details]
stacktrace
Comment 2 Dusan Balek 2012-04-03 09:04:10 UTC
Hard to fix without a reproducible test case. Are you able to reproduce the
issue? If so, could you please create a simple test case and attach it to the
issue? Thanks.
Comment 3 tmky2k 2012-04-03 11:00:45 UTC
I didn't encountered this error after I log this bug.
So, I can't reproduce this at this moment.