Community
Participate
Working Groups
Created attachment 96500 [details] example that demonstrates the problem According to WorkspaceJob documentation, resource change listeners will not receive event(s) about changes performed by the job until after the job has finished. Apparently, this is not true if another workspace job running concurrently happens to finish while this job is running. I am attaching small example that demonstrates the problem shortly. Tested with Eclipse 3.3.1.1 and 3.4.0 I20080409-1425
This should just be a doc clarification. WorkspaceJob does have the effect of batching events, but it doesn't guarantee that there will never be events during its execution.
Just to clarify, listeners receive events about changes done by this job before the job has finished. In other words, instead of receiving one big batch for all changes performed by the job, listeners receive events in several smaller batches. Is this really intended?
Yes, this is really intended. Imagine for example one WorkspaceJob is running a build that may take several minutes. Another thread adds a breakpoint. If we don't fire a resource change event for the breakpoint, then the UI won't notice and the breakpoint icon will not appear in the editor. You would double-click to add the breakpoint, and five minutes later the build would complete and the icon would appear. You could imagine sending only the changes that occurred in the other thread (the breakpoint creation), and holding back the changes from the build, but this would result in listeners receiving events out of order, which can be quite problematic for clients. See also: http://help.eclipse.org/help32/topic/org.eclipse.platform.doc.isv/porting/3.0/incompatibilities.html#Intermediate%20notifications%20during%20workspace%20operations http://www.eclipse.org/articles/Article-Resource-deltas/resource-deltas.html (section "When events are sent").
Created attachment 103347 [details] Proposed fix v01
Created attachment 103350 [details] Proposed fix v01 + updated copyright
Updated javadoc released to HEAD.
Verified in I20080612-2000.