Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2015-01-28 15:11:34 +0000
committerChristian W. Damus2015-01-28 15:25:53 +0000
commit570ea5eaaf22fa4bdca5992f387b3fa78f1ba2c1 (patch)
tree294a11281982772d688e9642bdcf8c999fe64ce1
parent940803d8b2d2eab64160ab4bdec65c55deadca21 (diff)
downloadorg.eclipse.papyrus-570ea5eaaf22fa4bdca5992f387b3fa78f1ba2c1.tar.gz
org.eclipse.papyrus-570ea5eaaf22fa4bdca5992f387b3fa78f1ba2c1.tar.xz
org.eclipse.papyrus-570ea5eaaf22fa4bdca5992f387b3fa78f1ba2c1.zip
458643: [Profile] Application version annotations accumulate
https://bugs.eclipse.org/bugs/show_bug.cgi?id=458643 Ensure that any and all previous PapyrusVersion annotations are replaced by the new version annotation when migrating a profile application. Conflicts: plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/CustomUMLUtil.java plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/ApplyProfileCommand.java
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/ApplyProfileCommand.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/ApplyProfileCommand.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/ApplyProfileCommand.java
index b781258a79b..3bdd6066c65 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/ApplyProfileCommand.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/ApplyProfileCommand.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011, 2014 CEA LIST, Christian W. Damus, and others.
+ * Copyright (c) 2011, 2015 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -11,10 +11,12 @@
* Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
* Christian W. Damus - bug 399859
* Christian W. Damus - bug 451557
- *
+ * Christian W. Damus - bug 458643
*****************************************************************************/
package org.eclipse.papyrus.uml.tools.commands;
+import static org.eclipse.papyrus.uml.tools.profile.definition.IPapyrusVersionConstants.PAPYRUS_EANNOTATION_SOURCE;
+
import java.util.Collection;
import java.util.Collections;
@@ -24,7 +26,6 @@ import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.papyrus.uml.tools.helper.IProfileApplicationDelegate;
import org.eclipse.papyrus.uml.tools.helper.ProfileApplicationDelegateRegistry;
-import org.eclipse.papyrus.uml.tools.profile.definition.IPapyrusVersionConstants;
import org.eclipse.papyrus.uml.tools.utils.CustomUMLUtil;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.Profile;
@@ -131,12 +132,11 @@ public class ApplyProfileCommand extends RecordingCommand {
// Save version of applied profile if necessary
if (saveProfileApplicationVersion) {
// Get version annotation in case it is a Papyrus profile
- EAnnotation versionAnnotation = profile.getDefinition().getEAnnotation(IPapyrusVersionConstants.PAPYRUS_EANNOTATION_SOURCE);
+ EAnnotation versionAnnotation = profile.getDefinition().getEAnnotation(PAPYRUS_EANNOTATION_SOURCE);
if (versionAnnotation != null) {
- EAnnotation existing = profileApplication.getEAnnotation(IPapyrusVersionConstants.PAPYRUS_EANNOTATION_SOURCE);
int index = 0;
- if (existing != null) {
+ for (EAnnotation existing = profileApplication.getEAnnotation(PAPYRUS_EANNOTATION_SOURCE); existing != null; existing = profileApplication.getEAnnotation(PAPYRUS_EANNOTATION_SOURCE)) {
// Replace this; don't just add to the existing ones
index = profileApplication.getEAnnotations().indexOf(existing);
CustomUMLUtil.destroy(existing);

Back to the top