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.
Build: NetBeans IDE Dev (Build 20111206-9523c3784668) VM: Java HotSpot(TM) Client VM, 20.4-b02, Java(TM) SE Runtime Environment, 1.6.0_29-b11 OS: Linux User Comments: jglick: Trying to apply a hint: $v.setUseSubstringInQuickSearch($b) :: $v instanceof org.openide.explorer.view.TreeView => ;; Stacktrace: java.lang.ClassCastException: com.sun.tools.javac.tree.JCTree$JCBlock cannot be cast to com.sun.source.tree.ExpressionTree at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.rewriteChildren(ImmutableTreeTranslator.java:835) at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitExpressionStatement(ImmutableTreeTranslator.java:409) at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.visitExpressionStatement(ImmutableTreeTranslator.java:92) at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1178) at org.netbeans.modules.java.source.transform.ImmutableTreeTranslator.translate(ImmutableTreeTranslator.java:134) at org.netbeans.api.java.source.TreeUtilities$1.translate(TreeUtilities.java:960)
Created attachment 113940 [details] stacktrace
Created attachment 117180 [details] stacktrace Accepting hint to remove Templates.setDefinesMainProject(wiz, false); from source code.
The given usecase should work now (will basically remove the enclosing expression statement from its parent). Also added a warning when an expression is to be removed from the parent and it is non-void, as that may lead to unintended effects: http://hg.netbeans.org/main-silver/rev/b119d6984cb6
Integrated into 'main-golden', will be available in build *201204190400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b119d6984cb6 User: Jan Lahoda <jlahoda@netbeans.org> Log: #206116: ability to remove expression whose parent is an expression statement, adding a warning to the editor about related suspicious cases.
Integrated into 'main-golden', will be available in build *201204210400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/49d23b89eaaf User: Jesse Glick <jglick@netbeans.org> Log: Fix of #206116 means this should now work.