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

Bug 327085

Summary: EClass.getEAllStructuralFeatures gives incorrect feature order
Product: [Modeling] EMF Reporter: Egidijus Vaisnora <vaisegid>
Component: CoreAssignee: Ed Merks <Ed.Merks>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 Flags: Ed.Merks: iplog+
Version: 2.6.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Lasy initialization for EAllStructuralFeaturesList fields
none
test case none

Description Egidijus Vaisnora CLA 2010-10-06 06:35:14 EDT
Very complex description, but lets try :)
We have ECore metemodel which consist of plenty of EPackages and many packages have cycling dependencies. This cycling was riced because our model has all references as bidirectional. We are attempting to load such metamodel from serialized form (actually it is loaded on CDO server). Actions are similar to this: 
1. first is trigered to load one EPackage 
2. after load is iterating through all contents in order to resolve proxies 
3. iterating through whole EPackage is triggering method EClass.getEAllStructuralFeatures
4. in method "getEAllStructuralFeatures" is created class EAllStructuralFeaturesList, which in constructor iterates through all structural features and calls for references "!eReference.isContainer()"
5. if opposite is proxy it involves EPackage loading and process goes to the step 

As a consequence of such complex loading procedure, our model stuck in situation, when "getEAllStructuralFeatures" for super type return 0 size list, just because that this super type is already in "COMPUTATION_IN_PROGRESS" (resolving proxies for opposites in class EAllStructuralFeaturesList)
Comment 1 Egidijus Vaisnora CLA 2010-10-06 06:40:39 EDT
Created attachment 180306 [details]
Lasy initialization for EAllStructuralFeaturesList fields

Attached patch. Sorry, but there are no test case.
Comment 2 Ed Merks CLA 2010-10-06 10:46:42 EDT
I'm not comfortable making changes without a test case.  Please provide a way of reproducing the problem.
Comment 3 Egidijus Vaisnora CLA 2010-10-12 02:27:36 EDT
Created attachment 180636 [details]
test case

This should simulate my original problem, I got on CDO server
Comment 4 Egidijus Vaisnora CLA 2010-10-18 08:06:42 EDT
Ed, do you need more information regarding this issue?
Comment 5 Ed Merks CLA 2010-10-18 08:18:38 EDT
No, I've just not had the time.
Comment 6 Ed Merks CLA 2010-10-26 14:21:01 EDT
I see exactly what you  mean.  Your fix looks like a good one. Thanks!  

I'll try to find time to commit it soon....
Comment 7 Ed Merks CLA 2010-11-05 06:20:51 EDT
The fix is committed to CVS for 2.7.
Comment 8 Ed Merks CLA 2010-12-13 16:42:48 EST
The fixes are available in a published build.
Comment 9 Ed Merks CLA 2010-12-14 23:28:09 EST
Try again to resolve as fixed (and available in a build).
Comment 10 Ed Merks CLA 2010-12-14 23:29:47 EST
Oh, I guess I have to close them!