Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Campesino2019-07-19 05:36:25 -0400
committerPatrick Tessier2019-08-08 05:30:42 -0400
commit3e505a4bd3d6012de51a7d9ee005f5344a2c0eee (patch)
treed6d139bb268e8ef249c2263446a6e2cf546f4b49 /plugins
parentda907ac662c39ee09f764d60075971df27d023e0 (diff)
downloadorg.eclipse.papyrus-3e505a4bd3d6012de51a7d9ee005f5344a2c0eee.tar.gz
org.eclipse.papyrus-3e505a4bd3d6012de51a7d9ee005f5344a2c0eee.tar.xz
org.eclipse.papyrus-3e505a4bd3d6012de51a7d9ee005f5344a2c0eee.zip
Bug 542802: [SequenceDiagram] Undo after message creation removes other
elements from the model - II Fixing the case for the first message ends in the lifelines Change-Id: Id2d3a247e4c59e765e6225ad60475e958eadb0ef Signed-off-by: Antonio Campesino <antonio.campesino.robles@ericsson.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConfigureMessageEventCommand.java25
1 files changed, 16 insertions, 9 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConfigureMessageEventCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConfigureMessageEventCommand.java
index b6fd2014db3..7f7bc8ce680 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConfigureMessageEventCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConfigureMessageEventCommand.java
@@ -11,6 +11,7 @@
* Contributors:
* Celine JANSSENS (ALL4TEC) - Initial API and implementation
* Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 542802
+ * Antonio Campesino (Ericsson AB) - Bug 542802 II
*
*****************************************************************************/
@@ -125,19 +126,25 @@ public class ConfigureMessageEventCommand extends ConfigureElementCommand {
public MessageOccurrenceSpecification createMessageEnd(Message message, Lifeline lifeline, final MessageEnd previous) {
final MessageOccurrenceSpecification messageOccurrenceSpecification = UMLFactory.eINSTANCE.createMessageOccurrenceSpecification();
if (previous == null) {
- messageOccurrenceSpecification.setCovered(lifeline);
+ messageOccurrenceSpecification.setCovered(lifeline);
} else {
final int index = lifeline.getCoveredBys().indexOf(previous) + 1;
lifeline.getCoveredBys().add(index, messageOccurrenceSpecification);
- // Store the added covered to manage the undo if needed
- if (coveredLifelines == null) {
- coveredLifelines = new HashMap<>();
- }
- if (!coveredLifelines.containsKey(lifeline)) {
- coveredLifelines.put(lifeline, new ArrayList<MessageOccurrenceSpecification>());
- }
- coveredLifelines.get(lifeline).add(messageOccurrenceSpecification);
+
+ }
+
+ // Store the added covered to manage the undo if needed
+ if (coveredLifelines == null) {
+ coveredLifelines = new HashMap<>();
+ }
+
+ List<MessageOccurrenceSpecification> newCoveredBy = coveredLifelines.get(lifeline);
+ if (newCoveredBy == null) {
+ newCoveredBy = new ArrayList<>();
+ coveredLifelines.put(lifeline, newCoveredBy);
}
+
+ newCoveredBy.add(messageOccurrenceSpecification);
messageOccurrenceSpecification.setMessage(message);
((Interaction) message.getOwner()).getFragments().add(messageOccurrenceSpecification);
return messageOccurrenceSpecification;

Back to the top