From d655c355e85a54fc153c6b306086f03918011433 Mon Sep 17 00:00:00 2001 From: robekras Date: Thu, 20 Oct 2005 19:06:06 +0000 Subject: [PATCH] 1) Moved the fHasChanged flag from PHPVariable to PHPValue. --- .../phpdt/internal/debug/core/model/PHPValue.java | 16 +++++++++++++++- .../internal/debug/core/model/PHPVariable.java | 8 ++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPValue.java b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPValue.java index bf97de2..b736b8e 100644 --- a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPValue.java +++ b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPValue.java @@ -56,7 +56,11 @@ public class PHPValue implements IValue { private String fValueString; // The value of this variable as text private Vector fVariables; // The children of this variable (other variables) if any private PHPStackFrame fStackFrame; // The stackframe this value (variable) belongs to - // + private boolean fHasChanged; // The value has changed between two suspends + // This variable was moved from PHPVariable due to the fact, + // that two PHPVariables can reference the same PHPValue, + // so only the first PHPVariable would win, when we check the variable tree + // for changed values. /** * @@ -77,6 +81,7 @@ public class PHPValue implements IValue { this.fValueType = fValueType; this.fValueString = value; this.fStackFrame = frame; + this.fHasChanged = false; if (subitems != null) { // If there are children for this value (variable) this.fVariables = new Vector (subitems); // Then add the children to this value (variable) @@ -217,4 +222,13 @@ public class PHPValue implements IValue { return null; } + public boolean hasValueChanged () throws DebugException { + return fHasChanged; + } + + public void setValueChanged (boolean changed) { + fHasChanged = changed; + } + + } diff --git a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPVariable.java b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPVariable.java index 0cdad2a..94fd528 100644 --- a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPVariable.java +++ b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPVariable.java @@ -32,7 +32,6 @@ public class PHPVariable implements IVariable { private PHPStackFrame fStackFrame; // The stackframe this variable belongs to private PHPVariable fParent; // The parent variable (a back link) private String fLongName; // ??? - private boolean fHasChanged; // /** * @@ -55,7 +54,6 @@ public class PHPVariable implements IVariable { this.fStackFrame = frame; this.fValue = new PHPValue (frame, value, valueType, subitems); this.fParent = parent; - this.fHasChanged = false; setName (name); } @@ -154,9 +152,7 @@ public class PHPVariable implements IVariable { * @see org.eclipse.debug.core.model.IVariable#hasValueChanged() */ public boolean hasValueChanged() throws DebugException { - // TODO Auto-generated method stub - // return false; - return fHasChanged; + return fValue.hasValueChanged (); } /** @@ -167,7 +163,7 @@ public class PHPVariable implements IVariable { * a different color. */ public void setValueChanged (boolean changed) { - fHasChanged = changed; + fValue.setValueChanged (changed); } /** -- 1.7.1