diff options
author | Laurent Redor | 2022-05-18 11:08:42 +0000 |
---|---|---|
committer | Laurent Fasani | 2022-05-19 15:50:28 +0000 |
commit | 374f9829c922a25e399825ceecd08571e42706f2 (patch) | |
tree | 23df22c21a47016d4d2f2ad09ea7dc7eb6d3993e /plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram | |
parent | 7247f83c6e204b5a7d6a17e1752998f72ffcaa5b (diff) | |
download | org.eclipse.sirius-374f9829c922a25e399825ceecd08571e42706f2.tar.gz org.eclipse.sirius-374f9829c922a25e399825ceecd08571e42706f2.tar.xz org.eclipse.sirius-374f9829c922a25e399825ceecd08571e42706f2.zip |
diagram
Avoid IllegalStateException(LifeCycleException) in
Operand.getCombinedFragment().
This exception might occur if the distant resource has been closed in
the meantime (CDO context).
Corresponding stack:
org.eclipse.net4j.util.lifecycle.LifecycleException: Not active:
CDOTransactionImpl
at org.eclipse.net4j.util.lifecycle.LifecycleUtil.checkActive(LifecycleUtil.java:100)
at org.eclipse.net4j.util.lifecycle.Lifecycle.checkActive(Lifecycle.java:206)
at org.eclipse.emf.internal.cdo.view.AbstractCDOView.getStore(AbstractCDOView.java:460)
at org.eclipse.emf.internal.cdo.CDOObjectImpl.cdoStore(CDOObjectImpl.java:555)
at org.eclipse.emf.internal.cdo.CDOObjectImpl.eInternalContainer(CDOObjectImpl.java:787)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainer(BasicEObjectImpl.java:804)
at org.eclipse.sirius.diagram.sequence.business.internal.elements.Operand.getCombinedFragment(Operand.java:182)
at org.eclipse.sirius.diagram.sequence.business.internal.elements.Operand.getIndex(Operand.java:217)
at org.eclipse.sirius.diagram.sequence.business.internal.elements.Operand.isLastOperand(Operand.java:227)
at org.eclipse.sirius.diagram.sequence.ui.tool.internal.figure.OperandFigure.isLastOperand(OperandFigure.java:100)
at org.eclipse.sirius.diagram.sequence.ui.tool.internal.figure.OperandFigure.paintBorder(OperandFigure.java:78)
at org.eclipse.draw2d.Figure.paint(Figure.java:1121)
at org.eclipse.sirius.diagram.ui.tools.api.figure.GradientRoundedRectangle.paint(GradientRoundedRectangle.java:114)
...
at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
at org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramElementContainerEditPart$1.paint(AbstractDiagramElementContainerEditPart.java:584)
at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
...
at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
at org.eclipse.draw2d.DeferredUpdateManager.paint(DeferredUpdateManager.java:168)
at org.eclipse.draw2d.LightweightSystem.paint(LightweightSystem.java:203)
Bug: 579948
Change-Id: I10e0f10fa7668d2bc5c77ec351bdc26499739d88
Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
Diffstat (limited to 'plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram')
-rw-r--r-- | plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/elements/Operand.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/elements/Operand.java b/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/elements/Operand.java index d1bc3ecc29..136394c0f1 100644 --- a/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/elements/Operand.java +++ b/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/business/internal/elements/Operand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2021 THALES GLOBAL SERVICES and others. + * Copyright (c) 2010, 2022 THALES GLOBAL SERVICES and others. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -22,6 +22,7 @@ import org.eclipse.gmf.runtime.notation.Bounds; import org.eclipse.gmf.runtime.notation.Node; import org.eclipse.gmf.runtime.notation.NotationPackage; import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.sirius.common.tools.api.query.IllegalStateExceptionQuery; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.sequence.business.api.util.Range; import org.eclipse.sirius.diagram.sequence.business.internal.layout.LayoutConstants; @@ -179,7 +180,17 @@ public class Operand extends AbstractSequenceNode implements ISequenceEvent { combinedFragment = CacheHelper.getOperandToCombinedFragmentCache().get(this); } if (combinedFragment == null) { - EObject viewContainer = this.view.eContainer(); + EObject viewContainer = null; + try { + viewContainer = this.view.eContainer(); + } catch (IllegalStateException e) { + if (new IllegalStateExceptionQuery(e).isAConnectionLostException()) { + // Nothing to log here, this can happen if the resource is not accessible anymore (distant + // resource). + } else { + throw e; + } + } if (viewContainer instanceof View) { View parentView = (View) viewContainer; Option<CombinedFragment> parentElement = ISequenceElementAccessor.getCombinedFragment(parentView); |