Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Charles David2016-10-20 19:22:30 +0000
committerPierre-Charles David2016-11-29 16:35:17 +0000
commit3fc1d8d8e73f92561bcf26b20447bdb55371da74 (patch)
treedb20edb0b77e330dcc1b6cc603222e36a093dad2
parent749d9158383e1edd191712d2ab00d6c1fba2021a (diff)
downloadorg.eclipse.sirius-3fc1d8d8e73f92561bcf26b20447bdb55371da74.tar.gz
org.eclipse.sirius-3fc1d8d8e73f92561bcf26b20447bdb55371da74.tar.xz
org.eclipse.sirius-3fc1d8d8e73f92561bcf26b20447bdb55371da74.zip
[506322] Do not use ResourceStrategy to manage the Viewpoint registry
This reverts the part of de35505b28c6c6f5d583f3616950708e36b02b73 which modified ViewpointRegistryImpl, and caused a regression when VSMs from the workspace are deleted and a different version reappear at the same location later. The ResourceStrategy abstraction introduced for ticket #442133 was designed for resources in the session's ResourceSet, but the ViewpointRegistry maintains its own ResourceSet, with very specific constraints on the resources' lifecycle to correctly handle reload/refresh notifications. The abstraction is not even needed in this case, as the performance problems it solves do not really occur here. Bug: 506322 Change-Id: I03a798ee96e02096543a39b8223b25711d0c0fa2 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/componentization/ViewpointRegistryImpl.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/componentization/ViewpointRegistryImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/componentization/ViewpointRegistryImpl.java
index efac59487b..346c465c73 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/componentization/ViewpointRegistryImpl.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/componentization/ViewpointRegistryImpl.java
@@ -29,7 +29,6 @@ import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
@@ -48,7 +47,6 @@ import org.eclipse.sirius.business.api.helper.SiriusUtil;
import org.eclipse.sirius.business.api.query.RepresentationDescriptionQuery;
import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.business.api.session.SessionManager;
-import org.eclipse.sirius.business.internal.resource.strategy.ResourceStrategyRegistry;
import org.eclipse.sirius.common.tools.DslCommonPlugin;
import org.eclipse.sirius.common.tools.api.util.EclipseUtil;
import org.eclipse.sirius.common.tools.api.util.EqualityHelper;
@@ -622,7 +620,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry {
*/
}
try {
- ResourceStrategyRegistry.getInstance().unloadAtResourceSetDispose(resource, new NullProgressMonitor());
+ resource.unload();
} catch (final IllegalArgumentException e) {
SiriusPlugin.getDefault().error(MessageFormat.format(Messages.ViewpointRegistryImpl_unableToUnloadFileErrorMsg, resource.getURI().toString()), e);
} catch (final NullPointerException e) {
@@ -862,11 +860,9 @@ public class ViewpointRegistryImpl extends ViewpointRegistry {
final URI resourceURI = resource.getURI();
if (resourceURI != null) {
if (resourceURI.toPlatformString(true) != null && resourceURI.toPlatformString(true).equals(odesignFile.getFullPath().toString())) {
+ resource.unload();
if (remove) {
- ResourceStrategyRegistry.getInstance().unloadAtResourceSetDispose(resource, new NullProgressMonitor());
sessionResourceSet.getResources().remove(resource);
- } else {
- resource.unload();
}
}
}

Back to the top