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 173971 - PropertySheet - race condition in update logic
Summary: PropertySheet - race condition in update logic
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: t_h
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-07 13:29 UTC by fvogler
Modified: 2009-10-14 11:00 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
A patch that works for me (2.31 KB, patch)
2009-10-07 13:31 UTC, fvogler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description fvogler 2009-10-07 13:29:43 UTC
Hi all,

I think there is a race condition in the update logic of the property sheet.
It reacts well to a node chage, shows up the sheet of the new node and then jumps back to the old node.
The problem is caused by the node listners. The listener sets the source node of the event as new node for the sheet.
I think that is wrong. The listener should only process events where the event source is the current node of the sheet
and skip all others.

Here is my example:
1) An object dispatches events asynchronous (a copy of the listener list an the event is scheduled).
2) A node for that object is shown in property sheet.
3) The object is modified on event dispatch thread
   -> causes an async node update -> property sheet update
4) After that the the selected object (node) is changed (still on event dispatch thread) 
   -> property sheet current node changed 
      -> node listener detached from old node and attached to new node.
         (but queued async node update from old node still pending)
5) Now queued async node update is processed
   -> node listener changes current node back to old node (event source) !! event should be skipt !!
 
Regards 
Florian
Comment 1 fvogler 2009-10-07 13:31:21 UTC
Created attachment 89005 [details]
A patch that works for me
Comment 2 t_h 2009-10-09 10:54:02 UTC
Thanks for patch. core-main #87ead09ae757
Comment 3 Quality Engineering 2009-10-14 11:00:04 UTC
Integrated into 'main-golden', will be available in build *200910140201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/87ead09ae757
User: Tomas Holy <t_h@netbeans.org>
Log: #173971: PropertySheet - race condition in update logic