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 244365 - ClassCastException: org.netbeans.modules.form.RADConnectionPropertyEditor$RADConnectionDesignValue cannot be cast to java.net.URL
Summary: ClassCastException: org.netbeans.modules.form.RADConnectionPropertyEditor$RAD...
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-08 00:46 UTC by toyo1
Modified: 2015-09-12 03:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 209588


Attachments
stacktrace (6.73 KB, text/plain)
2014-05-08 00:46 UTC, toyo1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description toyo1 2014-05-08 00:46:02 UTC
This bug was originally marked as duplicate of bug 168089, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 8.0 (Build 201403101706)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.55-b03, Java(TM) SE Runtime Environment, 1.7.0_55-b13
OS: Windows 7

User Comments:
toyo1: Pressed "reset to default" button on swing property page of JEditorPane control.




Stacktrace: 
java.lang.ClassCastException: org.netbeans.modules.form.RADConnectionPropertyEditor$RADConnectionDesignValue cannot be cast to java.net.URL
   at org.netbeans.beaninfo.editors.URLEditor.getAsText(URLEditor.java:83)
   at org.netbeans.modules.form.FormPropertyEditor.getAsText(FormPropertyEditor.java:247)
   at org.openide.explorer.propertysheet.RendererFactory$StringRenderer.reset(RendererFactory.java:963)
   at org.openide.explorer.propertysheet.RendererFactory$StringRenderer.connect(RendererFactory.java:926)
   at org.openide.explorer.propertysheet.RendererFactory.prepareString(RendererFactory.java:383)
   at org.openide.explorer.propertysheet.RendererFactory.getRenderer(RendererFactory.java:246)
Comment 1 toyo1 2014-05-08 00:46:05 UTC
Created attachment 147170 [details]
stacktrace
Comment 2 Tomas Pavek 2015-09-11 12:31:19 UTC
Another case of misbehaving JEditorPane that does not accept null as the 'page' property value although null is the default value of the property. See also bug 123303. The problem is slightly different here.

The steps to reproduce:
1) Set JEditorPane's page property to some custom code.
2) Then restore it to default value. An error dialog appears that it failed to write the property. After this the property is in somewhat inconsistent state - it is not changed (no code generated) but in property sheet and property editor still showing custom code.
3) Open the property editor again, switch to Default Editor, OK. A fail message appears again. The property editor dialog needs to be cancelled.

From this point the ClassCastException starts throwing and it is not possible to get rid of it other way than closing the whole form.
Comment 3 Tomas Pavek 2015-09-11 12:39:16 UTC
Seems it can work better if ignoring exception from applying default value.

http://hg.netbeans.org/jet-main/rev/3660cbbca2f2
Comment 4 Quality Engineering 2015-09-12 03:06:49 UTC
Integrated into 'main-silver', will be available in build *201509120002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3660cbbca2f2
User: Tomas Pavek <tpavek@netbeans.org>
Log: #244365: we want default property value reset to complete even if JEditorPane.setPage(null) fails