diff options
author | Vincent Lorenzo | 2014-03-13 12:37:57 +0000 |
---|---|---|
committer | Vincent Lorenzo | 2014-03-13 12:37:57 +0000 |
commit | e0a3a9f3543e492393111d849345d325c3bbe07d (patch) | |
tree | e12643a95e0bc01b538606fdb99b013559015a1f | |
parent | 9d537f59c48eefd116e0e3c4247c3fd8aa1f547d (diff) | |
download | org.eclipse.papyrus-e0a3a9f3543e492393111d849345d325c3bbe07d.tar.gz org.eclipse.papyrus-e0a3a9f3543e492393111d849345d325c3bbe07d.tar.xz org.eclipse.papyrus-e0a3a9f3543e492393111d849345d325c3bbe07d.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
-rw-r--r-- | extraplugins/table/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/extraplugins/table/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java b/extraplugins/table/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java index cefd7a205f1..ef5ca785fe5 100644 --- a/extraplugins/table/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java +++ b/extraplugins/table/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;
|