Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2013-11-20 04:23:40 -0500
committerVincent Lorenzo2013-11-20 04:23:40 -0500
commita71774f958cd6576a6b0cf52eb44a59859c7f115 (patch)
tree4135bb856b61d85ec668984c1d870a6e3bf83eef /extraplugins
parentac560893b57ee0f130496f6e725646b134196b07 (diff)
downloadorg.eclipse.papyrus-a71774f958cd6576a6b0cf52eb44a59859c7f115.tar.gz
org.eclipse.papyrus-a71774f958cd6576a6b0cf52eb44a59859c7f115.tar.xz
org.eclipse.papyrus-a71774f958cd6576a6b0cf52eb44a59859c7f115.zip
FIX a NPE in the table.
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/helper/advice/TableContentsAdviceHelper.java26
1 files changed, 15 insertions, 11 deletions
diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/helper/advice/TableContentsAdviceHelper.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/helper/advice/TableContentsAdviceHelper.java
index 4bed241d348..146f2901321 100644
--- a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/helper/advice/TableContentsAdviceHelper.java
+++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/helper/advice/TableContentsAdviceHelper.java
@@ -14,6 +14,7 @@
package org.eclipse.papyrus.infra.nattable.helper.advice;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Set;
@@ -67,19 +68,22 @@ public class TableContentsAdviceHelper extends AbstractEditHelperAdvice {
*/
protected List<EObject> getAssociatedElementToDestroy(final EObject eobject) {
final CrossReferenceAdapter adapter = getCrossReferenceAdapter(eobject);
- Set<EObject> elementsToDestroy = adapter.getInverseReferencers(eobject, NattableaxisPackage.eINSTANCE.getEObjectAxis_Element(), NattableaxisPackage.eINSTANCE.getEObjectAxis());
- elementsToDestroy.addAll(adapter.getInverseReferencers(eobject, NattablecellPackage.eINSTANCE.getEObjectAxisWrapper_Element(), NattablecellPackage.eINSTANCE.getEObjectAxisWrapper()));
+ if(adapter != null) {
+ Set<EObject> elementsToDestroy = adapter.getInverseReferencers(eobject, NattableaxisPackage.eINSTANCE.getEObjectAxis_Element(), NattableaxisPackage.eINSTANCE.getEObjectAxis());
+ elementsToDestroy.addAll(adapter.getInverseReferencers(eobject, NattablecellPackage.eINSTANCE.getEObjectAxisWrapper_Element(), NattablecellPackage.eINSTANCE.getEObjectAxisWrapper()));
- if(eobject instanceof ICellAxisWrapper) {
- elementsToDestroy.addAll(adapter.getInverseReferencers(eobject, NattablecellPackage.eINSTANCE.getCell_RowWrapper(), NattablecellPackage.eINSTANCE.getCell()));
- elementsToDestroy.addAll(adapter.getInverseReferencers(eobject, NattablecellPackage.eINSTANCE.getCell_ColumnWrapper(), NattablecellPackage.eINSTANCE.getCell()));
+ if(eobject instanceof ICellAxisWrapper) {
+ elementsToDestroy.addAll(adapter.getInverseReferencers(eobject, NattablecellPackage.eINSTANCE.getCell_RowWrapper(), NattablecellPackage.eINSTANCE.getCell()));
+ elementsToDestroy.addAll(adapter.getInverseReferencers(eobject, NattablecellPackage.eINSTANCE.getCell_ColumnWrapper(), NattablecellPackage.eINSTANCE.getCell()));
+ }
+ // for(final EObject current : cellWrapper) {
+ // if(current instanceof ICellAxisWrapper) {
+ // elementsToDestroy.add(current.eContainer());
+ // }
+ // }
+ return new ArrayList<EObject>(elementsToDestroy);
}
- // for(final EObject current : cellWrapper) {
- // if(current instanceof ICellAxisWrapper) {
- // elementsToDestroy.add(current.eContainer());
- // }
- // }
- return new ArrayList<EObject>(elementsToDestroy);
+ return Collections.emptyList();
}
//Duplicated code from UML Diagram common

Back to the top