Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2015-11-20 13:31:07 +0000
committerGerrit Code Review @ Eclipse.org2016-01-08 15:28:22 +0000
commit419ea81bf5c4267f18ef147cee01ebedbb4b7679 (patch)
tree3c1a91b9c8849927b3f85c5b007d8131049ef2a1 /plugins/uml
parent7699488dacebed22c60befb7ca7158fb9572bb79 (diff)
downloadorg.eclipse.papyrus-419ea81bf5c4267f18ef147cee01ebedbb4b7679.tar.gz
org.eclipse.papyrus-419ea81bf5c4267f18ef147cee01ebedbb4b7679.tar.xz
org.eclipse.papyrus-419ea81bf5c4267f18ef147cee01ebedbb4b7679.zip
Bug 481020: [Table][requirement table] NPE during the synchronization
processus https://bugs.eclipse.org/bugs/show_bug.cgi?id=481020 The problem was available when a requirement contains requirement in tree table (the configuration must have 'packagedElement' as first depth and 'nestedClassifier' as second depth) and the requirements was deleted. This problem is corrected by a test of the deletion of non-existing tree item axis. By this correction, an other linked bug appeared : When the requirement was deleted and an undo was done, the requirement was displayed twice in the table. This was corrected by a test in the 'manageAddNotification' method by checking that the element was not already available in the managed elements (in the case of stereotyped element, the 'SET' event is caught before the 'ADD' and was already managed) + Add the JUnit test Change-Id: I775417673701e2617402797901faa2b338c2e0c8 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@all4tec.net>
Diffstat (limited to 'plugins/uml')
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLElementTreeAxisManagerForEventList.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLElementTreeAxisManagerForEventList.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLElementTreeAxisManagerForEventList.java
index 4a2d11b42fd..df9985f5dbe 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLElementTreeAxisManagerForEventList.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLElementTreeAxisManagerForEventList.java
@@ -219,7 +219,9 @@ public class UMLElementTreeAxisManagerForEventList extends EObjectTreeAxisManage
if (values.isEmpty()) {
if (confRep != null) {
ITreeItemAxis toDestroy = getITreeItemAxisRepresentingObject(confRep.getChildren(), baseElement);
- removeObject(toDestroy);
+ if(null != toDestroy){
+ removeObject(toDestroy);
+ }
}
} else {
if (values.contains(baseElement)) {
@@ -232,7 +234,7 @@ public class UMLElementTreeAxisManagerForEventList extends EObjectTreeAxisManage
ITreeItemAxis stereotypedElementRep = getITreeItemAxisRepresentingObject(confRep.getChildren(), baseElement);
if (stereotypedElementRep == null) {
ITreeItemAxis newAxis = addObject(confRep, baseElement);
- if (alreadyExpanded.contains(confRep) || confRep.getParent() == null) {// already expanded or root!
+ if (!managedElements.containsKey(baseElement) && (alreadyExpanded.contains(confRep) || confRep.getParent() == null)) {// already expanded or root!
fillChildrenForSemanticElement(newAxis);
}
}

Back to the top