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 223829 - ClassCastException: com.sun.tools.javac.tree.JCTree$JCExpressionStatement cannot be cast to com.sun.source.tree.ExpressionTree
Summary: ClassCastException: com.sun.tools.javac.tree.JCTree$JCExpressionStatement can...
Status: RESOLVED DUPLICATE of bug 206141
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-14 09:05 UTC by facilityderek
Modified: 2012-12-27 20:56 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 165377


Attachments
stacktrace (2.74 KB, text/plain)
2012-12-14 09:05 UTC, facilityderek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description facilityderek 2012-12-14 09:05:52 UTC
This issue was reported manually by pavaneshwar.
It already has 5 duplicates 


Build: NetBeans IDE Dev (Build 201101230001)
VM: Java HotSpot(TM) Client VM, 19.0-b09, Java(TM) SE Runtime Environment, 1.6.0_23-b05
OS: Windows XP

User Comments:
grimlock81: Alt+Enter Hint: Replace with a character literal
The String to be replaced was "\\"

facilityderek: Applying fix for  hint:

	Length one string "\\" in String.indexOf

Lolo_101: I think this happened when a hint appeared to suggest to replace a 1-char String by a char in "String.indexOf".
I wanted to automatically replace the String by a char, but had to manually do it. Then i noticed this exception.

pavaneshwar: Clicked on the hint provided by the IDE.




Stacktrace: 
java.lang.ClassCastException: com.sun.tools.javac.tree.JCTree$JCExpressionStatement cannot be cast to com.sun.source.tree.ExpressionTree
   at org.netbeans.modules.java.source.builder.TreeFactory.MethodInvocation(TreeFactory.java:404)
   at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.rewriteChildren(ImmutableTreeTranslator.java:888)
   at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitMethodInvocation(ImmutableTreeTranslator.java:418)
   at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitMethodInvocation(ImmutableTreeTranslator.java:89)
   at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1341)
   at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.translate(ImmutableTreeTranslator.java:125)
Comment 1 facilityderek 2012-12-14 09:05:55 UTC
Created attachment 129365 [details]
stacktrace
Comment 2 Jan Lahoda 2012-12-27 20:56:28 UTC
Already fixed as bug #206141 in NetBeans 7.1.1 and newer - please upgrade to a newer version of NetBeans. Thank you.

*** This bug has been marked as a duplicate of bug 206141 ***