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 229729

Summary: FormNode.getHandle() persistence hack can be avoided returning null
Product: guibuilder Reporter: gdm <gdm-nb>
Component: CodeAssignee: issues@guibuilder <issues>
Status: NEW ---    
Severity: normal CC: gdm-nb
Priority: P3    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description gdm 2013-05-14 14:40:24 UTC
FormNode.getHandle() implements an hack to avoid restoring the
original node after IDE restarts (see commens in the code, reported below)

    // ----------
    // Persistence hacks - for the case the node is selected in some
    // (standalone) properties window when IDE exits. We don't restore the
    // original node after IDE restarts (would require to load the form), but
    // provide a fake node which destroys itself immediately - closing the
    // properties window. [Would be nice to find some better solution...]

This can be avoided returning null to signal that the node is not persistable, see javadoc of Node.getHandle() (reported below):

public abstract Node.Handle getHandle()
Obtain handle for this node (for serialization). The handle can be serialized   and Node.Handle.getNode() used after deserialization to obtain the original node.
    the handle, or null if this node is not persistable