Skip to content

Commit

Permalink
Fix #68 by removing EStore#getContainer call in eInternalContainer()
Browse files Browse the repository at this point in the history
Note: this update may creates unexpected side-effects. All the tests pass, but
changing the container/containment behavior is always risky. Contact me if some
of your code that was previously running doesn't behave as expected anymore.
  • Loading branch information
gdaniel committed Feb 21, 2017
1 parent 609371f commit 4e5498d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,7 @@ Current SNAPSHOT.
- __[FIX]__ Issue #54: AbstractDirectWrite.toArray is not efficient
- __[FIX]__ Issue #55: DefaultPersistentEObject.eContainer is not efficient
- __[FIX]__ Issue #56: Unnecessary backend lookups in Store.eObject(Id)
- __[FIX]__ Issue #68: Creating contained objects with Epsilon does not work

### Back-ends
- __[NEW]__ Merge common code from MapDB & BerkeleyDB in Map module
Expand Down
Expand Up @@ -16,6 +16,7 @@
import fr.inria.atlanmod.neoemf.data.store.PersistentStore;
import fr.inria.atlanmod.neoemf.resource.PersistentResource;
import fr.inria.atlanmod.neoemf.util.NeoEContentsEList;
import fr.inria.atlanmod.neoemf.util.logging.NeoLogger;

import org.eclipse.emf.common.util.BasicEMap;
import org.eclipse.emf.common.util.EList;
Expand Down Expand Up @@ -231,7 +232,7 @@ else if (nonNull(eStaticClass())) {
}
return sb.toString();
}

@Override
protected void eBasicSetContainer(InternalEObject eContainer) {
this.eContainer = eContainer;
Expand Down Expand Up @@ -345,8 +346,14 @@ public void dynamicUnset(int dynamicFeatureId) {
*/
@Override
public InternalEObject eInternalContainer() {
// Do not load the container from the store here: it creates an important overhead and performance loss
return isNull(eContainer) ? super.eInternalContainer() : eContainer;
/*
* Don't load the container from the store here: it creates an important
* overhead and performance loss.
* [Update 21-02-2017] don't call super.eInternalContainer() either: it
* will delegate to the store.
*/
return eContainer;
// return isNull(eContainer) ? super.eInternalContainer() : eContainer;
}

@Override
Expand Down

0 comments on commit 4e5498d

Please sign in to comment.