Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Cortell2009-10-02 03:32:14 +0000
committerJohn Cortell2009-10-02 03:32:14 +0000
commitb30ac38a2ab6ddaf08ab3e2e339263f0f83a21bb (patch)
tree41fc5668b1e0dccf43bb88cf718781aa499b4b97 /dsf/org.eclipse.cdt.dsf.ui
parent427138bbeb24bf876b8f694658595f7246bece96 (diff)
downloadorg.eclipse.cdt-b30ac38a2ab6ddaf08ab3e2e339263f0f83a21bb.tar.gz
org.eclipse.cdt-b30ac38a2ab6ddaf08ab3e2e339263f0f83a21bb.tar.xz
org.eclipse.cdt-b30ac38a2ab6ddaf08ab3e2e339263f0f83a21bb.zip
[291144] Stringification of VMDelta doesn't reflect delta hierarchy
Diffstat (limited to 'dsf/org.eclipse.cdt.dsf.ui')
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMDelta.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMDelta.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMDelta.java
index dc03d951151..c8b9f16c4ce 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMDelta.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMDelta.java
@@ -271,18 +271,22 @@ public class VMDelta extends ModelDelta {
@Override
public String toString() {
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
buf.append("Model Delta Start\n"); //$NON-NLS-1$
- appendDetail(buf, this);
+ appendDetail(buf, this, 0);
buf.append("Model Delta End\n"); //$NON-NLS-1$
return buf.toString();
}
- private void appendDetail(StringBuffer buf, VMDelta delta) {
- buf.append("\tElement: "); //$NON-NLS-1$
+ private void appendDetail(StringBuilder buf, VMDelta delta, int depth) {
+ String indent = new String();
+ for (int i = 0; i < depth; i++) {
+ indent += '\t';
+ }
+ buf.append(indent + "\tElement: "); //$NON-NLS-1$
buf.append(delta.getElement());
buf.append('\n');
- buf.append("\t\tFlags: "); //$NON-NLS-1$
+ buf.append(indent + "\t\tFlags: "); //$NON-NLS-1$
int flags = delta.getFlags();
if (flags == 0) {
buf.append("NO_CHANGE"); //$NON-NLS-1$
@@ -319,14 +323,14 @@ public class VMDelta extends ModelDelta {
}
}
buf.append('\n');
- buf.append("\t\tIndex: "); //$NON-NLS-1$
+ buf.append(indent + "\t\tIndex: "); //$NON-NLS-1$
buf.append(delta.fIndex);
buf.append(" Child Count: "); //$NON-NLS-1$
buf.append(delta.fChildCount);
buf.append('\n');
IModelDelta[] nodes = delta.getChildDeltas();
for (int i = 0; i < nodes.length; i++) {
- appendDetail(buf, (VMDelta)nodes[i]);
+ appendDetail(buf, (VMDelta)nodes[i], depth+1);
}
}

Back to the top