summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2008-09-03 03:23:23 (EDT)
committerCarsten Drossel2008-09-03 03:23:23 (EDT)
commit46ffeea15862dae645a791c91023d788f0efaac7 (patch)
treeccb0f0b40bb291a45d7562696f84d09cf55fe104
parent68a49e798e2fe49d6de72965aa62827d0b302271 (diff)
downloadorg.eclipse.riena-46ffeea15862dae645a791c91023d788f0efaac7.zip
org.eclipse.riena-46ffeea15862dae645a791c91023d788f0efaac7.tar.gz
org.eclipse.riena-46ffeea15862dae645a791c91023d788f0efaac7.tar.bz2
avoid NullPointerExceptions
-rw-r--r--org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/tree/TreeStructureDiff.java24
1 files changed, 20 insertions, 4 deletions
diff --git a/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/tree/TreeStructureDiff.java b/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/tree/TreeStructureDiff.java
index 3e67067..86b0ace 100644
--- a/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/tree/TreeStructureDiff.java
+++ b/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/tree/TreeStructureDiff.java
@@ -28,16 +28,32 @@ public class TreeStructureDiff extends TreeDiff {
public TreeStructureDiff(ITreeNode parent, int[] childIndices, Serializable[] children) {
super(parent);
- this.childIndices = childIndices.clone();
- this.children = children.clone();
+ this.childIndices = clone(childIndices);
+ this.children = clone(children);
}
public int[] getChildIndices() {
- return childIndices.clone();
+ return clone(childIndices);
}
public Object[] getChildren() {
- return children.clone();
+ return clone(children);
+ }
+
+ private int[] clone(int[] intArray) {
+ if (intArray != null) {
+ return intArray.clone();
+ } else {
+ return null;
+ }
+ }
+
+ private Serializable[] clone(Serializable[] array) {
+ if (array != null) {
+ return array.clone();
+ } else {
+ return null;
+ }
}
/*