diff options
| author | Steve Monnier | 2016-03-25 14:26:09 +0000 |
|---|---|---|
| committer | Pierre-Charles David | 2016-03-31 13:49:13 +0000 |
| commit | fe7fc1653ae059b5a970ea501a8059b8b975125e (patch) | |
| tree | 157907b2b990711ae2eb958d78577aa3e7bca404 | |
| parent | 35b0c5c9bc728e103965053cdbc71e8c6839bf12 (diff) | |
| download | org.eclipse.sirius-fe7fc1653ae059b5a970ea501a8059b8b975125e.tar.gz org.eclipse.sirius-fe7fc1653ae059b5a970ea501a8059b8b975125e.tar.xz org.eclipse.sirius-fe7fc1653ae059b5a970ea501a8059b8b975125e.zip | |
[490092] Fix a CCE with multivalued attributes in table
Fix a casting considering only EObject list where it could be a String
list. This caused CCE when opening a table representing a multivalued
String attribute.
Bug: 490092
Change-Id: I3c202786e64ab3dd471ebfaab957d2adc567f978
Signed-off-by: Steve Monnier <steve.monnier@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/internal/refresh/DTableElementSynchronizerSpec.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/internal/refresh/DTableElementSynchronizerSpec.java b/plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/internal/refresh/DTableElementSynchronizerSpec.java index f78b4aedad..5f0eb6a5dc 100644 --- a/plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/internal/refresh/DTableElementSynchronizerSpec.java +++ b/plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/internal/refresh/DTableElementSynchronizerSpec.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES and others. + * Copyright (c) 2007, 2016 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -506,7 +506,7 @@ public class DTableElementSynchronizerSpec extends DTableElementSynchronizerImpl // objects if (featureObject instanceof EList<?>) { List<String> texts = Lists.newArrayList(); - for (EObject obj : (EList<EObject>) featureObject) { + for (Object obj : (EList<?>) featureObject) { texts.add(getText(obj)); } label = texts.toString(); @@ -1142,6 +1142,9 @@ public class DTableElementSynchronizerSpec extends DTableElementSynchronizerImpl } private String getText(final Object element) { + if (!(element instanceof EObject)) { + return element.toString(); + } String text = null; ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); IItemLabelProvider itemLabelProvider = (IItemLabelProvider) adapterFactory.adapt(element, IItemLabelProvider.class); |
