Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328790 - CDOResource.isLoaded returns false after adding/clearing contents of new resource
Summary: CDOResource.isLoaded returns false after adding/clearing contents of new reso...
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Caspar D. CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-27 02:41 EDT by Caspar D. CLA
Modified: 2011-06-23 03:36 EDT (History)
1 user (show)

See Also:
stepper: review+


Attachments
Patch including test case (5.75 KB, patch)
2010-10-27 02:47 EDT, Caspar D. CLA
no flags Details | Diff
Patch including testcases (24.99 KB, patch)
2010-10-29 02:35 EDT, Caspar D. CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Caspar D. CLA 2010-10-27 02:41:10 EDT
CDOResource.isLoaded overrides Resource.isLoaded, but
violates the contract specified in the API docs of the
latter. 

API doc specifies:

"It will be set to true [...] when contents are first added
to a resource that isn't loaded. Calling clear for the
contents of a resource that isn't loaded, will set the
resource to be loaded; this is the simplest way to create an
empty resource that's considered loaded."

But a new CDOResource keeps returning false after objects
have been added to it or it's been cleared.

Will attach testcase and patch shortly.
Comment 1 Caspar D. CLA 2010-10-27 02:47:55 EDT
Created attachment 181798 [details]
Patch including test case
Comment 2 Caspar D. CLA 2010-10-29 02:35:08 EDT
Created attachment 182012 [details]
Patch including testcases

Here's a patch and a few new tests in LockingManagerTest, which
make my earlier testcase for this Zilla obsolete.
Comment 3 Caspar D. CLA 2010-10-29 02:38:12 EDT
Oops.. that one was for bug 328681. Have moved it there
and have obsoleted it here (and restored the original 
patch attachment.)
Comment 4 Eike Stepper CLA 2010-10-29 06:44:32 EDT
I think this fix is worth being ported to 3.0 maintenance- and small enough. Can you do this, Caspar?
Comment 5 Caspar D. CLA 2010-10-31 22:44:41 EDT
Committed to HEAD
Comment 6 Caspar D. CLA 2010-10-31 23:12:06 EDT
(In reply to comment #4)
> Can you do this, Caspar?

Yes, done: bug 329171.
Comment 7 Eike Stepper CLA 2011-06-23 03:36:53 EDT
Available in R20110608-1407