Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Richard2015-01-16 03:30:47 -0500
committerAxel Richard2015-01-16 03:30:47 -0500
commit8426205b199bdf9e85f59fe2c28b87022e99b366 (patch)
tree2615657322e745a5a72d90ee2e94a31ed0165b1d /performance
parent0d0800f4e2c5003de0e6d856ea9d6530dfd26b34 (diff)
downloadorg.eclipse.emf.compare-8426205b199bdf9e85f59fe2c28b87022e99b366.tar.gz
org.eclipse.emf.compare-8426205b199bdf9e85f59fe2c28b87022e99b366.tar.xz
org.eclipse.emf.compare-8426205b199bdf9e85f59fe2c28b87022e99b366.zip
Improve dispose method for performances tests
Change-Id: Ib9d0c9b5945e9d8f3a7235843bcafbd87bc2f224 Signed-off-by: Axel Richard <axel.richard@obeo.fr>
Diffstat (limited to 'performance')
-rw-r--r--performance/org.eclipse.emf.compare.tests.performance/src/data/models/Data.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/performance/org.eclipse.emf.compare.tests.performance/src/data/models/Data.java b/performance/org.eclipse.emf.compare.tests.performance/src/data/models/Data.java
index 2a8f222f9..16fb8c343 100644
--- a/performance/org.eclipse.emf.compare.tests.performance/src/data/models/Data.java
+++ b/performance/org.eclipse.emf.compare.tests.performance/src/data/models/Data.java
@@ -23,6 +23,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.common.util.WrappedException;
import org.eclipse.emf.compare.Comparison;
@@ -46,9 +47,11 @@ import org.eclipse.emf.compare.scope.DefaultComparisonScope;
import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.compare.uml2.internal.postprocessor.UMLPostProcessor;
import org.eclipse.emf.compare.utils.UseIdentifiers;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.resource.UMLResource;
@@ -166,9 +169,19 @@ public abstract class Data {
for (ResourceSet rs : resourceSets) {
EList<Resource> resources = rs.getResources();
for (Resource resource : resources) {
- resource.unload();
- }
+ TreeIterator<EObject> allContents = EcoreUtil.getAllProperContents(resource, false);
+ while (allContents.hasNext()) {
+ final EObject next = allContents.next();
+ next.eAdapters().clear();
+ }
+ resource.eAdapters().clear();
+ }
+
+ rs.getResources().clear();
+ rs.eAdapters().clear();
}
+
+
resourceSets = null;
}

Back to the top