Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2014-03-13 12:38:18 +0000
committerVincent Lorenzo2014-03-13 12:38:18 +0000
commitb1119ca3ca602f07f954ce8e6affa1090b03eae6 (patch)
treed210291375576bd82169b43563ba7e1570cc2875 /plugins/uml
parent9356316903b662b0dfe914eda6fd81a31135c926 (diff)
downloadorg.eclipse.papyrus-b1119ca3ca602f07f954ce8e6affa1090b03eae6.tar.gz
org.eclipse.papyrus-b1119ca3ca602f07f954ce8e6affa1090b03eae6.tar.xz
org.eclipse.papyrus-b1119ca3ca602f07f954ce8e6affa1090b03eae6.zip
430280: [Table 2] In a table in detached mode, pasting a cell with a stereotype information (like port direction) fails with an NPE
https://bugs.eclipse.org/bugs/show_bug.cgi?id=430280
Diffstat (limited to 'plugins/uml')
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java
index cefd7a205f1..946701bce32 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java
@@ -198,6 +198,7 @@ public class UMLTableUtils {
}
return stereotypes;
}
+
/**
*
* @param editedElement
@@ -212,11 +213,14 @@ public class UMLTableUtils {
*/
public static final List<StereotypeApplicationStructure> findStereotypeApplicationDataStructure(final Element editedElement, final String id, final Map<?, ?> sharedMap) {
//TODO : enhance the data structure to look for an editedElement + a propQn as Key!
+ @SuppressWarnings("unchecked")
List<StereotypeApplicationStructure> list = (List<StereotypeApplicationStructure>)sharedMap.get(editedElement);
- final String propertyQN = id.replace(UMLTableUtils.PROPERTY_OF_STEREOTYPE_PREFIX, ""); //$NON-NLS-1$
- for(final StereotypeApplicationStructure current : list) {
- if(current.getProperty().getQualifiedName().equals(propertyQN)) {
- return Collections.singletonList(current);//TODO : doesn't manage when several stereotype with the same property are applied
+ if(list != null && !list.isEmpty()) {
+ final String propertyQN = id.replace(UMLTableUtils.PROPERTY_OF_STEREOTYPE_PREFIX, ""); //$NON-NLS-1$
+ for(final StereotypeApplicationStructure current : list) {
+ if(current.getProperty().getQualifiedName().equals(propertyQN)) {
+ return Collections.singletonList(current);//TODO : doesn't manage when several stereotype with the same property are applied
+ }
}
}
return null;

Back to the top