diff options
| author | Florian Barbin | 2017-07-27 15:23:04 +0000 |
|---|---|---|
| committer | Florian Barbin | 2017-07-28 07:47:29 +0000 |
| commit | 3b0f264c64d712c03581302271cddbea0e393c16 (patch) | |
| tree | e6d8bfe216dd0e1969dd2e83d7778bbf08f68f64 | |
| parent | be0a34ef16906ab4f0e725d814223a229992751a (diff) | |
| download | org.eclipse.sirius-3b0f264c64d712c03581302271cddbea0e393c16.tar.gz org.eclipse.sirius-3b0f264c64d712c03581302271cddbea0e393c16.tar.xz org.eclipse.sirius-3b0f264c64d712c03581302271cddbea0e393c16.zip | |
[516669] Retrieve inverse target from DRepresentationDescriptor
The DialectManager.getRepresentations(final EObject semantic, final
Session session) implementation retrieved the representations from the
DRepresentation.target inverse reference. This code have to fulfill the
contract even if representations are not loaded. In order to not load
systematically all representations, we use the
DRepresentationDescriptor.target inverse reference instead and load the
representation only for the found DRepresentationDescriptor.
Bug: 516669
Change-Id: Ia0c8086ab23ad2a09bad16dc8668b9dbcce028ce
Signed-off-by: Florian Barbin <florian.barbin@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/DialectManagerImpl.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/DialectManagerImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/DialectManagerImpl.java index 03f0ce4916..4d4afd9ad6 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/DialectManagerImpl.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/DialectManagerImpl.java @@ -270,8 +270,12 @@ public class DialectManagerImpl implements DialectManager { Collection<DRepresentation> result = Lists.newArrayList(); ECrossReferenceAdapter xref = session.getSemanticCrossReferencer(); for (EStructuralFeature.Setting setting : xref.getInverseReferences(semantic)) { - if (ViewpointPackage.Literals.DREPRESENTATION.isInstance(setting.getEObject()) && setting.getEStructuralFeature() == ViewpointPackage.Literals.DSEMANTIC_DECORATOR__TARGET) { - result.add((DRepresentation) setting.getEObject()); + if (ViewpointPackage.Literals.DREPRESENTATION_DESCRIPTOR.isInstance(setting.getEObject()) + && setting.getEStructuralFeature() == ViewpointPackage.Literals.DREPRESENTATION_DESCRIPTOR__TARGET) { + DRepresentation representation = ((DRepresentationDescriptor) setting.getEObject()).getRepresentation(); + if (representation != null) { + result.add(representation); + } } } return result; |
