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 11734 - PropertyChangeEvents are not always fired
Summary: PropertyChangeEvents are not always fired
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-04-25 12:52 UTC by Svata Dedic
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch that solves this problem (4.33 KB, patch)
2001-07-20 20:30 UTC, Svata Dedic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 2001-04-25 12:52:15 UTC
Sometimes the PropertyChangeEvent on field's "type" property is not fired after
the parser processes the source.
The field's type must be set via OpenAPIs to be some reference type name, whose
identifier must be specified using correct source and full names.
After the source is parsed, PropertyChangeEvent should be fired on the "type"
property because the identifier used there transitions from NOT_YET_RESOLVED
state to either RESOLVED or UNRESOLVED.
This property change event is mistakenly swallowed and never fired.
Comment 1 Svata Dedic 2001-04-25 12:53:04 UTC
Created attachment 1245 [details]
Patch that solves this problem
Comment 2 Svata Dedic 2001-04-25 12:57:02 UTC
The cause is that PropertyChangeSupport.firePropertyChange compares old and new
property's values and if they are equal it does not fire anything. In this
particular case, this optimization blocks the events from being delivered.

I dare not to change Identifier's equals method to include the indicated
resolution state. Identifiers are used at many places throughout the IDE.
Instead of that, I would patch the ElementImpl class to not use the standard
PropertyChangeSupport, but I've copied the necessary code to handle listener
list, sychronization and event firing.
Please see & comment the attached diff file.
Comment 3 Jan Chalupa 2001-05-05 23:21:24 UTC
Target milestone -> 3.3
Comment 4 Svata Dedic 2001-05-09 11:44:29 UTC
Changing milestone to 3.2.1, this should be fixed for the sake of tools built 
on top of NetBeans
Comment 5 Svata Dedic 2001-05-22 15:22:03 UTC
Setting milestone forth (it's still not integrated). Marking as FIXED (in dev 
trunk only)
Comment 6 Jan Becicka 2001-10-19 12:38:55 UTC
VERIFIED
Comment 7 Quality Engineering 2003-07-01 13:15:49 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.