Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328790

Summary: CDOResource.isLoaded returns false after adding/clearing contents of new resource
Product: [Modeling] EMF Reporter: Caspar D. <caspar_d>
Component: cdo.coreAssignee: Caspar D. <caspar_d>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 CC: saulius.tvarijonas
Version: 4.0Flags: stepper: review+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch including test case
none
Patch including testcases none

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