Bug 227429 - ClassCastException: com.sun.tools.javac.tree.JCTree$JCExpressionStatement cannot be cast to com.sun.source.tree.ExpressionTree
ClassCastException: com.sun.tools.javac.tree.JCTree$JCExpressionStatement can...
Product: java
Classification: Unclassified
Component: Hints
All All
: P3 (vote)
: 7.3.1
Assigned To: Jan Lahoda
EXCEPTIONS_REPORT 73patch2-verified
Depends on:
  Show dependency treegraph
Reported: 2013-03-13 17:00 UTC by theshadow27
Modified: 2013-05-09 14:10 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT

stacktrace (2.71 KB, text/plain)
2013-03-13 17:00 UTC, theshadow27

Note You need to log in before you can comment on or make changes to this bug.
Description theshadow27 2013-03-13 17:00:56 UTC
Build: NetBeans IDE 7.3 (Build 201302132200)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.7-b01, Java(TM) SE Runtime Environment, 1.7.0_15-b03
OS: Mac OS X

User Comments:
theshadow27: Clicked correct with the tooltip for the StringEqualsIgnoreCase.hint below

------- START SNIP ---------

<!description="String.equalsIgnoreCase is inefficient">
$f.equalsIgnoreCase($g) :: $f instanceof java.lang.String && $g instanceof java.lang.String
=> StringUtil.equalsIgnoreCase($f, $g);

------ END SNIP --------

I should file a general RFE on the inspector system in general, but that is a seperate topic all together.

Product Version: NetBeans IDE 7.3 (Build 201302132200)
Java: 1.7.0_15; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_15-b03
System: Mac OS X version 10.8.2 running on x86_64; US-ASCII; en_US (nb)
User directory: /Users/theshadow/Library/Application Support/NetBeans/7.3
Cache directory: /Users/theshadow/Library/Caches/NetBeans/7.3

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.transform.ImmutableTreeTranslator.rewriteChildren(ImmutableTreeTranslator.java:987)
   at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitAssignment(ImmutableTreeTranslator.java:441)
   at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitAssignment(ImmutableTreeTranslator.java:94)
   at com.sun.tools.javac.tree.JCTree$JCAssign.accept(JCTree.java:1476)
   at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.translate(ImmutableTreeTranslator.java:136)
   at org.netbeans.api.java.source.TreeUtilities$1.translate(TreeUtilities.java:963)
Comment 1 theshadow27 2013-03-13 17:00:58 UTC
Created attachment 132576 [details]
Comment 2 Jan Lahoda 2013-04-03 17:40:57 UTC
Conversion from expression to expression statement works the same as conversion from the expression into the embedded expression from the statement after this change:
Comment 3 Jiri Prox 2013-04-15 14:41:57 UTC
Comment 4 Jan Lahoda 2013-05-03 07:32:07 UTC
Comment 5 Quality Engineering 2013-05-05 00:26:23 UTC
Integrated into 'releases', will be available in build *201305042200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/63a232d7d373
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #227429: tolerate rewrite of expression to expression statement.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo