Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2018-06-07 02:52:37 -0400
committerAndrey Loskutov2018-06-07 02:52:37 -0400
commit0afe667b8f038e8a21b3a41762b56dd91b4bf424 (patch)
tree8b6e1dae9d0d42f4da3f180ce06e5a81b287b349
parent42247f46a308c7847a2bdbe58d5a5d51030caadb (diff)
downloadeclipse.platform.debug-0afe667b8f038e8a21b3a41762b56dd91b4bf424.tar.gz
eclipse.platform.debug-0afe667b8f038e8a21b3a41762b56dd91b4bf424.tar.xz
eclipse.platform.debug-0afe667b8f038e8a21b3a41762b56dd91b4bf424.zip
ModelDelta cleanup
Change-Id: I962d7c4043e4f50104119c6059cf368da2eb51ea Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java42
1 files changed, 8 insertions, 34 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java
index 0cf593864..d8a11b926 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java
@@ -30,12 +30,12 @@ public class ModelDelta implements IModelDelta {
private Object fElement;
private int fFlags;
private ModelDelta[] fNodes = EMPTY_NODES;
- private List<ModelDelta> fNodesList = null;
+ private List<ModelDelta> fNodesList;
// TODO this is not good, we are mixing a delta with an array of deltas
private Map<Object, Object> fNodesMap;
private Object fReplacement;
- private int fIndex = -1;
- private int fChildCount = -1;
+ private int fIndex;
+ private int fChildCount;
private static final ModelDelta[] EMPTY_NODES = new ModelDelta[0];
/**
@@ -47,6 +47,8 @@ public class ModelDelta implements IModelDelta {
public ModelDelta(Object element, int flags) {
fElement = element;
fFlags = flags;
+ fIndex = -1;
+ fChildCount = -1;
}
/**
@@ -58,9 +60,8 @@ public class ModelDelta implements IModelDelta {
* @param flags change flags
*/
public ModelDelta(Object element, Object replacement, int flags) {
- fElement = element;
+ this(element, flags);
fReplacement = replacement;
- fFlags = flags;
}
/**
@@ -72,9 +73,8 @@ public class ModelDelta implements IModelDelta {
* @param flags change flags
*/
public ModelDelta(Object element, int index, int flags) {
- fElement = element;
+ this(element, flags);
fIndex = index;
- fFlags = flags;
}
/**
@@ -87,23 +87,15 @@ public class ModelDelta implements IModelDelta {
* @param childCount number of children this node has
*/
public ModelDelta(Object element, int index, int flags, int childCount) {
- fElement = element;
- fIndex = index;
- fFlags = flags;
+ this(element, index, flags);
fChildCount = childCount;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getElement()
- */
@Override
public Object getElement() {
return fElement;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getFlags()
- */
@Override
public int getFlags() {
return fFlags;
@@ -261,33 +253,21 @@ public class ModelDelta implements IModelDelta {
fParent = node;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getParent()
- */
@Override
public IModelDelta getParentDelta() {
return fParent;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getReplacementElement()
- */
@Override
public Object getReplacementElement() {
return fReplacement;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getIndex()
- */
@Override
public int getIndex() {
return fIndex;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getNodes()
- */
@Override
public IModelDelta[] getChildDeltas() {
if (fNodes == null) {
@@ -381,17 +361,11 @@ public class ModelDelta implements IModelDelta {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta#getChildCount()
- */
@Override
public int getChildCount() {
return fChildCount;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta#accept(org.eclipse.debug.internal.ui.viewers.provisional.IModelDeltaVisitor)
- */
@Override
public void accept(IModelDeltaVisitor visitor) {
doAccept(visitor, 0);

Back to the top