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 180125 - ClassCastException when View Data is pressed
Summary: ClassCastException when View Data is pressed
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 6.x
Hardware: All All
: P1 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
: 180887 181512 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-02-01 18:36 UTC by David Konecny
Modified: 2010-03-10 09:48 UTC (History)
19 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 164799


Attachments
stacktrace (5.37 KB, text/plain)
2010-02-01 18:36 UTC, David Konecny
Details
stacktrace (3.25 KB, text/plain)
2010-02-22 12:55 UTC, neilg
Details
stacktrace (3.19 KB, text/plain)
2010-02-25 08:23 UTC, Egor Ushakov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Konecny 2010-02-01 18:36:32 UTC
Build: NetBeans IDE Dev (Build 100129-908102f49680)
VM: Java HotSpot(TM) Client VM, 14.3-b01, Java(TM) SE Runtime Environment, 1.6.0_17-b04
OS: Linux

User Comments:
dkonecny: I was not connected to internet and clicked on Show Data in exception reported but instead of data exception was thrown.




Stacktrace: 
java.lang.ClassCastException: java.lang.String cannot be cast to org.openide.explorer.view.VisualizerNode
   at org.openide.explorer.view.NodeRenderer.findVisualizerNode(NodeRenderer.java:232)
   at org.openide.explorer.view.NodeRenderer.getListCellRendererComponent(NodeRenderer.java:152)
   at javax.swing.plaf.basic.BasicComboBoxUI.getBaseline(BasicComboBoxUI.java:960)
   at javax.swing.JComponent.getBaseline(JComponent.java:2520)
   at javax.swing.GroupLayout$ComponentSpring.getBaseline(GroupLayout.java:3000)
   at javax.swing.GroupLayout$BaselineGroup.calculateBaselineAndResizeBehavior(GroupLayout.java:2657)
Comment 1 David Konecny 2010-02-01 18:36:36 UTC
Created attachment 93742 [details]
stacktrace
Comment 2 Jaroslav Tulach 2010-02-18 05:19:38 UTC
*** Bug 180887 has been marked as a duplicate of this bug. ***
Comment 3 Exceptions Reporter 2010-02-18 08:41:10 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=164799
Comment 4 neilg 2010-02-22 12:55:51 UTC
Created attachment 94396 [details]
stacktrace
Comment 5 Exceptions Reporter 2010-02-22 12:56:14 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=164799
Comment 6 Jaroslav Tulach 2010-02-25 06:23:29 UTC
All the cases seem to come from exception reporter dialogs, Jindra can you find the cause?
Comment 7 Egor Ushakov 2010-02-25 08:23:31 UTC
Created attachment 94516 [details]
stacktrace

clicked on view data in report problem dialog
Comment 8 Jindrich Sedek 2010-03-01 09:28:46 UTC
It seems there is a bug in NodeRenderer. The first report is comming form build 100128. The only related change in uihandler module was the change from org.jdesktop.layout to JAVA 6 API . It seems findVisualizerNode is not able to handle String as a value parametter, but BasicComboBoxUI calls getListCellRendererComponent with a String " ".

This is the BasicComboBoxUI invocation of getListCellRendererComponent method on NodeRenderer
if (value == null) {
   value = " ";
} else if (value instanceof String && "".equals(value)) {
   value = " ";
}
Component component = renderer.getListCellRendererComponent(listBox, value, -1,
                               false, false);


The problem needs to be fixed NodeRenderer. I'm not sure what it needs as a 'Value' parameter, but it should definitely accept Strings.
Comment 9 Jesse Glick 2010-03-04 17:28:22 UTC
I think this is another manifestation of bug #180088. A workaround is to accept " " as a value and just return e.g. VisualizerNode.EMPTY. A better fix, if possible, is to set a prototypeDisplayValue for the list so that " " does not get passed to begin with.
Comment 10 Exceptions Reporter 2010-03-06 16:45:49 UTC
This bug already has 50 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=164799
Comment 11 Jaroslav Tulach 2010-03-08 02:35:17 UTC
core-main#48002215a268
Comment 12 Jaroslav Tulach 2010-03-10 09:48:37 UTC
*** Bug 181512 has been marked as a duplicate of this bug. ***