Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Gabel2017-08-25 09:32:06 +0000
committerFlorian Noyrit2017-08-30 08:45:24 +0000
commitd1aea56e848138234a22bf4286179612f00274c4 (patch)
tree1755a7cda33344fd207f5f8987e6c5b5c454fe94 /plugins/infra
parentc96443a445319d99fded395453a3027e1f18a3c4 (diff)
downloadorg.eclipse.papyrus-d1aea56e848138234a22bf4286179612f00274c4.tar.gz
org.eclipse.papyrus-d1aea56e848138234a22bf4286179612f00274c4.tar.xz
org.eclipse.papyrus-d1aea56e848138234a22bf4286179612f00274c4.zip
Bug 521383 - [Element Types] Management of the element type resource
when the validation step fails https://bugs.eclipse.org/bugs/show_bug.cgi?id=521383 Use a boolean flag to detect the cases where the resource would need to be unloaded and removed from its resource set. Change-Id: I6e90f085a1ffcfb1e6187235ea27c968356bffca Signed-off-by: Sebastien Gabel <sebastien.gabel@ansys.com>
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/registries/ElementTypeSetConfigurationRegistry.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/registries/ElementTypeSetConfigurationRegistry.java b/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/registries/ElementTypeSetConfigurationRegistry.java
index c470f2d5140..a2c3d46a824 100644
--- a/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/registries/ElementTypeSetConfigurationRegistry.java
+++ b/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/registries/ElementTypeSetConfigurationRegistry.java
@@ -10,7 +10,7 @@
* CEA LIST - Initial API and implementation
* Christian W. Damus - bug 459174
* Christian W. Damus - bug 467207
- * Sebastien Gabel (Esterel Technologies SAS) - bug 517914
+ * Sebastien Gabel (Esterel Technologies SAS) - bug 517914, bug 521383
*
*****************************************************************************/
package org.eclipse.papyrus.infra.types.core.registries;
@@ -170,19 +170,26 @@ public class ElementTypeSetConfigurationRegistry {
}
URI localURI = URI.createPlatformResourceURI(path, true);
Resource resource = elementTypeSetConfigurationResourceSet.createResource(localURI);
+
+ boolean registration = true;
try {
resource.load(null);
EObject content = resource.getContents().get(0);
if (content instanceof ElementTypeSetConfiguration) {
- return loadElementTypeSetConfiguration(contextId, (ElementTypeSetConfiguration) content);
+ registration = loadElementTypeSetConfiguration(contextId, (ElementTypeSetConfiguration) content);
+ } else {
+ registration = false;
}
} catch (IOException e) {
Activator.log.error(e);
+ registration = false;
+ }
+
+ if (!registration) {
resource.unload();
elementTypeSetConfigurationResourceSet.getResources().remove(resource);
}
-
- return false;
+ return registration;
}
@@ -413,7 +420,7 @@ public class ElementTypeSetConfigurationRegistry {
// Store the advicesDependencies
advicesDeps.put(contextId, deps);
- return true;
+ return !registrableElementTypeSetConfiguration.isEmpty();
}

Back to the top