Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Resource change event notify guarantee for top level operations?
Resource change event notify guarantee for top level operations? [message #1387218] Tue, 24 June 2014 20:26 Go to next message
Bruno Medeiros is currently offline Bruno MedeirosFriend
Messages: 3
Registered: July 2009
Junior Member
So, I have a pretty standard situation where I have a workspace listener:
ResourcesPlugin.getWorkspace().addResourceChangeListener(
listener, IResourceChangeEvent.POST_CHANGE);

My questions is, are resource change events guaranteed to be notified to listeners right after a top-level workspace operation completes? The documentation states that if the operation is nested, the change events might be delayed, and that is fine. But is there a *guarantee* that when a top-level operation finishes, the change events effected within will be reported right after?

There seems to be a situation in some tests code of mine where that is not happening. :S At first I thought the problem was somewhere else, or that I was misunderstanding what was happening, but after further debugging, it seems to be case of what I said above. Is it a bug?
Re: Resource change event notify guarantee for top level operations? [message #1387416 is a reply to message #1387218] Wed, 25 June 2014 04:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Bruno,

Yes not getting any notification would be a bug, but note that changes
must be made via the Resource APIs, i.e., not directly via the
underlying file system using, for example, just java.io.File.


On 24/06/2014 10:26 PM, Bruno Medeiros wrote:
> So, I have a pretty standard situation where I have a workspace listener:
> ResourcesPlugin.getWorkspace().addResourceChangeListener(
> listener, IResourceChangeEvent.POST_CHANGE);
>
> My questions is, are resource change events guaranteed to be notified
> to listeners right after a top-level workspace operation completes?
> The documentation states that if the operation is nested, the change
> events might be delayed, and that is fine. But is there a *guarantee*
> that when a top-level operation finishes, the change events effected
> within will be reported right after?
>
> There seems to be a situation in some tests code of mine where that is
> not happening. :S At first I thought the problem was somewhere else,
> or that I was misunderstanding what was happening, but after further
> debugging, it seems to be case of what I said above. Is it a bug?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Resource change event notify guarantee for top level operations? [message #1392525 is a reply to message #1387416] Wed, 02 July 2014 13:12 Go to previous message
Bruno Medeiros is currently offline Bruno MedeirosFriend
Messages: 3
Registered: July 2009
Junior Member
Yes, the resource changes are beingh made with the Resource API.

Note the change event does show up after the *next* workspace top-level operation completes, so the change event doesn't disappear completely. But it's not being reported for the correct workspace top-level operation.
It does sound like a bug, I might report it, but unfortunately I wouldn't have any time soon to try to make a short reproducible example... (I already had a similar JVM bug recently that took me ages to narrow down - this one affected the program itself, not just the test suite)

I will give it a try with 4.4 though, see if I can reproduce it there.
Previous Topic:Please stop making things worse (non-native widgets)
Next Topic:Luna reintroduces ClassCastException: ContributionInfo cannot be cast to EditPart
Goto Forum:
  


Current Time: Fri Apr 19 01:59:41 GMT 2024

Powered by FUDForum. Page generated in 0.05140 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top