aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2018-07-23 09:24:51 -0400
committerNicolas FAUVERGUE2018-07-23 09:24:51 -0400
commitaa9490b90434811a4f38075ff24d0869106c8a03 (patch)
tree2002bce8b696b6dd4687c1e1f27371a58c1d04d8
parent40ddfbc2f65f9c5495a9b8d37c677ae5e9eca642 (diff)
downloadorg.eclipse.papyrus-aa9490b90434811a4f38075ff24d0869106c8a03.tar.gz
org.eclipse.papyrus-aa9490b90434811a4f38075ff24d0869106c8a03.tar.xz
org.eclipse.papyrus-aa9490b90434811a4f38075ff24d0869106c8a03.zip
Bug 537289: [Sequence Diagram] NullPointerException in
SequenceReferenceEditPolicy.fillWeakReferenceForExecSpec Change-Id: I8397e3443a9d0a6ef0c90632e379a7ed06bdc891 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceReferenceEditPolicy.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceReferenceEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceReferenceEditPolicy.java
index 2c6c1f30bf1..936cf0772cf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceReferenceEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceReferenceEditPolicy.java
@@ -121,7 +121,7 @@ public class SequenceReferenceEditPolicy extends GraphicalEditPolicy implements
ExecutionSpecification exec = (ExecutionSpecification) ((AbstractExecutionSpecificationEditPart) getHost()).resolveSemanticElement();
// manage Strong references
fillStrongReferencesOfExecutionSpecification(exec);
-
+
// manage weak references
// the weak reference is the next element associated to next event after the finish event.
if (exec.getCovereds().size() == 1) {
@@ -179,7 +179,7 @@ public class SequenceReferenceEditPolicy extends GraphicalEditPolicy implements
}
}
}
-
+
/**
* This method is used to add a weak reference from the next event after the given event
*
@@ -194,9 +194,8 @@ public class SequenceReferenceEditPolicy extends GraphicalEditPolicy implements
if (nextEvent instanceof MessageOccurrenceSpecification && isOnlyMessageEnd((MessageOccurrenceSpecification) nextEvent)) {
addMessageIntoReferences((MessageEnd) nextEvent, weakReferences, NO_ROLE);
} else if (nextEvent instanceof OccurrenceSpecification) {
- // TODO : To determinate
ExecutionSpecification subExecutionSpec = getExecutionSpecificationAssociatedToEvent((OccurrenceSpecification) nextEvent);
- if(!subExecutionSpec.getFinish().equals(nextEvent)) {
+ if (null != subExecutionSpec && !subExecutionSpec.getFinish().equals(nextEvent)) {
addExecutionSpecIntoReferences((OccurrenceSpecification) nextEvent, weakReferences, NO_ROLE);
}
}
@@ -426,7 +425,7 @@ public class SequenceReferenceEditPolicy extends GraphicalEditPolicy implements
* This allows to fill the string references of an execution specification with:
* - The message end of start and/or finish
* - Execution specifications defined between the start and the finish of the current execution specification
- *
+ *
* @param exec
* The current execution specification.
*/
@@ -455,7 +454,7 @@ public class SequenceReferenceEditPolicy extends GraphicalEditPolicy implements
nextEvent = currentLifeline.getCoveredBys().get(index);
if (nextEvent instanceof OccurrenceSpecification) {
ExecutionSpecification subExecutionSpec = getExecutionSpecificationAssociatedToEvent((OccurrenceSpecification) nextEvent);
- if(null != subExecutionSpec && null != subExecutionSpec.getStart() && !subExecutionSpec.equals(exec) && subExecutionSpec.getStart().equals(nextEvent)) {
+ if (null != subExecutionSpec && null != subExecutionSpec.getStart() && !subExecutionSpec.equals(exec) && subExecutionSpec.getStart().equals(nextEvent)) {
foundSubExecSpec = (OccurrenceSpecification) nextEvent;
addExecutionSpecIntoReferences(foundSubExecSpec, strongReferences, ROLE_START);
}