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 - FormNode.getHandle() persistence hack can be avoided returning null
Summary: FormNode.getHandle() persistence hack can be avoided returning null
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-14 14:40 UTC by gdm
Modified: 2013-05-14 14:40 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.
Returns:
    the handle, or null if this node is not persistable
"