Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-12-16 16:18:32 +0000
committerChristian W. Damus2014-12-16 16:18:32 +0000
commit7727eac28e5be36006b7d3ff240a82adde13433e (patch)
tree22a622f4891df0f62b849ccfe90ded4a9966dbbe /plugins/uml
parente02728cd745de91b1660a67df6caf00aa097a4a0 (diff)
downloadorg.eclipse.papyrus-7727eac28e5be36006b7d3ff240a82adde13433e.tar.gz
org.eclipse.papyrus-7727eac28e5be36006b7d3ff240a82adde13433e.tar.xz
org.eclipse.papyrus-7727eac28e5be36006b7d3ff240a82adde13433e.zip
455329: [Repair Stereotypes] The Repair Stereotypes dialog pops up everytime for Deployed Dynamic profiles
https://bugs.eclipse.org/bugs/show_bug.cgi?id=455329 Ensure that the duality of dynamically registered profile definitions that are also loaded locally in the resource set is accounted for.
Diffstat (limited to 'plugins/uml')
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.modelrepair/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/StereotypeApplicationRepairSnippet.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.uml.modelrepair/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/StereotypeApplicationRepairSnippet.java b/plugins/uml/org.eclipse.papyrus.uml.modelrepair/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/StereotypeApplicationRepairSnippet.java
index f3d1bd3cfb7..c2037a08a7e 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.modelrepair/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/StereotypeApplicationRepairSnippet.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.modelrepair/src/org/eclipse/papyrus/uml/modelrepair/internal/stereotypes/StereotypeApplicationRepairSnippet.java
@@ -9,6 +9,7 @@
* Contributors:
* Christian W. Damus (CEA) - Initial API and implementation
* Christian W. Damus - bug 455248
+ * Christian W. Damus - bug 455329
*
*/
package org.eclipse.papyrus.uml.modelrepair.internal.stereotypes;
@@ -204,13 +205,28 @@ public class StereotypeApplicationRepairSnippet implements IModelSetSnippet {
for (ProfileApplication next : profileApplications) {
EPackage definition = next.getAppliedDefinition();
if ((definition != null) && !definition.eIsProxy()) {
- result.add(definition);
+ if (result.add(definition)) {
+ // Maybe it's a registered dynamic package? Look for a Doppelgänger in the registry
+ EPackage.Registry registry = getPackageRegistry();
+ if (registry != null) {
+ EPackage registered = registry.getEPackage(definition.getNsURI());
+ if ((registered != null) && (registered != definition)) {
+ // This is the schema that EMF actually used to create stereotype instances
+ result.add(registered);
+ }
+ }
+ }
}
}
return result;
}
+ private EPackage.Registry getPackageRegistry() {
+ ResourceSet resourceSet = adapter.getResourceSet();
+ return (resourceSet == null) ? EPackage.Registry.INSTANCE : resourceSet.getPackageRegistry();
+ }
+
private LabelProviderService getLabelProvider() {
if (labelProviderService == null) {
try {

Back to the top