Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2019-06-11 11:56:17 +0000
committerVincent Lorenzo2019-06-11 11:56:17 +0000
commit7950d625faf2be8f90e494085475630ffaf2ec63 (patch)
tree0e5bf021ac2ed43132d5102e4e9e56d2414b8da8 /plugins
parent7880746ceec039ea19470b7e903b2fe14bd6e56d (diff)
downloadorg.eclipse.papyrus-7950d625faf2be8f90e494085475630ffaf2ec63.tar.gz
org.eclipse.papyrus-7950d625faf2be8f90e494085475630ffaf2ec63.tar.xz
org.eclipse.papyrus-7950d625faf2be8f90e494085475630ffaf2ec63.zip
Bug 548147: [SequenceDiagram][Model2Doc] NullPointerException exporting Sequence Diagram
Change-Id: Ifb9b367446531099c9acd692c2e6dae8a8fd82b1 Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/GridManagementEditPolicy.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/GridManagementEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/GridManagementEditPolicy.java
index 4952f953f9e..68051e6e0e3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/GridManagementEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/GridManagementEditPolicy.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2016, 2018 CEA LIST, ALL4TEC, Christian W. Damus, and others.
+ * Copyright (c) 2016, 2018, 2019 CEA LIST, ALL4TEC, 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 2.0
@@ -13,6 +13,7 @@
* Mickaƫl ADAM (ALL4TEC) mickael.adam@all4tec.net - Bug 519756
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Bug 531936
* Christian W. Damus - bugs 533679, 530201
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Bug 548147
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.referencialgrilling;
@@ -232,8 +233,14 @@ public class GridManagementEditPolicy extends GraphicalEditPolicyEx implements A
// Record for undo if possible, otherwise unprotected
execute(createGrillingStructureCommand);
+ // we need to do a refresh to create the GrillingEditpart for the created GrillingStructure view
+ // we bug 548147
+ host.refresh();
}
+
+ // we need to reset i to 0
+ i = 0;
while (gridCompartment == null && i < host.getChildren().size()) {
if (host.getChildren().get(i) instanceof GrillingEditpart) {
gridCompartment = (GrillingEditpart) (host.getChildren().get(i));
@@ -288,7 +295,7 @@ public class GridManagementEditPolicy extends GraphicalEditPolicyEx implements A
}
}
- UMLDiagramEditorPlugin.log.trace(LogOptions.SEQUENCE_DEBUG_REFERENCEGRID, "--> there is " + lifelineList.size() + " lifelines");//$NON-NLS-1$
+ UMLDiagramEditorPlugin.log.trace(LogOptions.SEQUENCE_DEBUG_REFERENCEGRID, "--> there is " + lifelineList.size() + " lifelines");//$NON-NLS-1$ //$NON-NLS-2$
// for each lifeline recreat the list of covered element
for (Lifeline lifeline : lifelineList) {
@@ -311,10 +318,10 @@ public class GridManagementEditPolicy extends GraphicalEditPolicyEx implements A
// update the list of covered by taking account InteractionFragment
if (covered.size() == lifeline.getCoveredBys().size()) {
- UMLDiagramEditorPlugin.log.trace(LogOptions.SEQUENCE_DEBUG_REFERENCEGRID, "the list is equals" + covered.size() + ", we reorder");//$NON-NLS-1$
+ UMLDiagramEditorPlugin.log.trace(LogOptions.SEQUENCE_DEBUG_REFERENCEGRID, "the list is equals" + covered.size() + ", we reorder");//$NON-NLS-1$ //$NON-NLS-2$
execute(new SetCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), lifeline, UMLPackage.eINSTANCE.getLifeline_CoveredBy(), covered));
} else if (covered.size() < lifeline.getCoveredBys().size()) {
- UMLDiagramEditorPlugin.log.trace(LogOptions.SEQUENCE_DEBUG_REFERENCEGRID, "More event detected! +" + (covered.size() - lifeline.getCoveredBys().size()) + "--> modify covered");//$NON-NLS-1$
+ UMLDiagramEditorPlugin.log.trace(LogOptions.SEQUENCE_DEBUG_REFERENCEGRID, "More event detected! +" + (covered.size() - lifeline.getCoveredBys().size()) + "--> modify covered");//$NON-NLS-1$ //$NON-NLS-2$
covered.addAll(lifeline.getCoveredBys());
execute(new SetCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), lifeline, UMLPackage.eINSTANCE.getLifeline_CoveredBy(), covered));
} else if (covered.size() > lifeline.getCoveredBys().size()) {

Back to the top