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 206201 - Form loading duplicates a bean before setting all it's properties
Summary: Form loading duplicates a bean before setting all it's properties
Status: RESOLVED INCOMPLETE
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.0.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-09 16:30 UTC by raul.chirea
Modified: 2012-04-18 09:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description raul.chirea 2011-12-09 16:30:17 UTC
It appears that, when guibuilder loads a bean from a form:
1. constructs the bean
2. set the bean properties
3. duplicates the bean (I do not know why)

The problem apears when some beans have references to other beans.
In this case, if a bean has a reference to an unloaded (yet) bean, that reference property is first set to NULL and set again to correct value when the referred object is loaded.
BUT, in this case the duplication step is done immediately after the first assignment of properties and before the fix-up phase.

I have pasted here a log of the operations (baseBlock is the reference property):

JSRLov - Setting baseBlock: null ()
JSRLov - serialized: baseBlock = null ()
JSRLov - deserialized: baseBlock = null ()
JSRLov - Setting baseBlock: org.sqlroots.comps.JSRBlock@23293775 (subtipuri_produs sp)

The effect of this behaviour becomes a problem when you access the loaded object from a custom property editor. In this case, if ones tries to read the "baseBlock" property this is null (probably, the property editor sees the duplicate instance).

So, during loading of a form the "duplication" phase should be after the "fix-up" phase. This would solve the problem - the duplicate object would be identical.
Comment 1 Tomas Pavek 2011-12-09 16:55:11 UTC
Could you give us a test sample on which we could reproduce the behavior? That would help with evaluation and fixing a lot. Thanks.