Debugging update and imports optimization
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/dbgp/IDbgpProperty.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/dbgp/IDbgpProperty.java
index 5e74ee6..1fb434d 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/dbgp/IDbgpProperty.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/dbgp/IDbgpProperty.java
@@ -9,7 +9,6 @@
  *******************************************************************************/
 package org.eclipse.dltk.dbgp;
 
-import java.util.List;
 
 public interface IDbgpProperty {
 
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/dbgp/internal/packets/DbgpPacketReceiver.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/dbgp/internal/packets/DbgpPacketReceiver.java
index f493d37..0b7eae6 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/dbgp/internal/packets/DbgpPacketReceiver.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/dbgp/internal/packets/DbgpPacketReceiver.java
@@ -36,8 +36,12 @@
 			while (!map.containsKey(key)) {
 				wait();
 			}
-
-			return map.get(key);
+			
+			return map.remove(key);			
+		}
+		
+		public synchronized int size() {
+			return map.size();
 		}
 	}
 
@@ -123,6 +127,7 @@
 
 	public DbgpResponsePacket getResponsePacket(int transactionId)
 			throws InterruptedException {
+					
 		return (DbgpResponsePacket) responseQueue
 				.get(new Integer(transactionId));
 	}
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/dbgp/internal/utils/DbgpXmlEntityParser.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/dbgp/internal/utils/DbgpXmlEntityParser.java
index d2c8316..46376d3 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/dbgp/internal/utils/DbgpXmlEntityParser.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/dbgp/internal/utils/DbgpXmlEntityParser.java
@@ -39,8 +39,7 @@
 
 	}
 
-	public static DbgpStackLevel parseStackLevel(Element element)
-			throws DbgpException {
+	public static DbgpStackLevel parseStackLevel(Element element) throws DbgpException {
 		final String ATTR_LEVEL = "level";
 		final String ATTR_CMDBEGIN = "cmdbegin";
 		final String ATTR_CMDEND = "cmdend";
@@ -77,12 +76,10 @@
 		// }
 
 		String where = element.getAttribute(ATTR_WHERE);
-		return new DbgpStackLevel(fileUri, where, level, lineNumber, lineBegin,
-				lineEnd);
+		return new DbgpStackLevel(fileUri, where, level, lineNumber, lineBegin, lineEnd);
 	}
 
-	public static DbgpFeature parseFeature(Element element)
-			throws DbgpProtocolException {
+	public static DbgpFeature parseFeature(Element element) throws DbgpProtocolException {
 		final String ATTR_FEATURE_NAME = "feature_name";
 		final String ATTR_SUPPORTED = "supported";
 
@@ -119,7 +116,9 @@
 		int childrenCount = 0;
 		List availableChildren = new ArrayList();
 		if (hasChildren) {
-			childrenCount = Integer.parseInt(property	.getAttribute(ATTR_NUMCHILDREN));
+			if (property.hasAttribute(ATTR_NUMCHILDREN)) {
+				childrenCount = Integer.parseInt(property.getAttribute(ATTR_NUMCHILDREN));
+			}
 
 			NodeList properties = property.getChildNodes();
 			for (int i = 0; i < properties.getLength(); ++i) {
@@ -141,7 +140,7 @@
 		if (property.hasAttribute(ATTR_ENCODING)) {
 			encoding = property.getAttribute(ATTR_ENCODING);
 		}
-		
+
 		String key = null;
 		if (property.hasAttribute(ATTR_KEY)) {
 			key = property.getAttribute(ATTR_KEY);
@@ -156,12 +155,10 @@
 			throw new AssertionError();
 		}
 
-		return new DbgpProperty(name, fullName, type, value, size,
-				childrenCount, hasChildren, availableChildren, constant, key);
+		return new DbgpProperty(name, fullName, type, value, size, childrenCount, hasChildren, availableChildren, constant, key);
 	}
 
-	public static IDbgpStatus parseStatus(Element element)
-			throws DbgpProtocolException {
+	public static IDbgpStatus parseStatus(Element element) throws DbgpProtocolException {
 		final String ATTR_REASON = "reason";
 		final String ATTR_STATUS = "status";
 
@@ -214,30 +211,23 @@
 
 		if (type.equals(LINE_BREAKPOINT)) {
 			String fileName = element.getAttribute(ATTR_FILENAME);
-			int lineNumber = Integer
-					.parseInt(element.getAttribute(ATTR_LINENO));
-			return new DbgpLineBreakpoint(id, enabled, hitValue, hitCount,
-					hitCondition, fileName, lineNumber);
+			int lineNumber = Integer.parseInt(element.getAttribute(ATTR_LINENO));
+			return new DbgpLineBreakpoint(id, enabled, hitValue, hitCount, hitCondition, fileName, lineNumber);
 		} else if (type.equals(CALL_BREAKPOINT)) {
 			String function = element.getAttribute(ATTR_FUNCTION);
-			return new DbgpCallBreakpoint(id, enabled, hitValue, hitCount,
-					hitCondition, function);
+			return new DbgpCallBreakpoint(id, enabled, hitValue, hitCount, hitCondition, function);
 		} else if (type.equals(RETURN_BREAKPOINT)) {
 			String function = element.getAttribute(ATTR_FUNCTION);
-			return new DbgpReturnBreakpoint(id, enabled, hitValue, hitCount,
-					hitCondition, function);
+			return new DbgpReturnBreakpoint(id, enabled, hitValue, hitCount, hitCondition, function);
 		} else if (type.equals(EXCEPTION_BREAKPOINT)) {
 			String exception = element.getAttribute(ATTR_EXCEPTION);
-			return new DbgpExceptionBreakpoint(id, enabled, hitValue, hitCount,
-					hitCondition, exception);
+			return new DbgpExceptionBreakpoint(id, enabled, hitValue, hitCount, hitCondition, exception);
 		} else if (type.equals(CONDITIONAL_BREAKPOINT)) {
 			String expression = element.getAttribute(ATTR_EXPRESSION);
-			return new DbgpConditionalBreakpoint(id, enabled, hitValue,
-					hitCount, hitCondition, expression);
+			return new DbgpConditionalBreakpoint(id, enabled, hitValue, hitCount, hitCondition, expression);
 		} else if (type.equals(WATCH_BREAKPOINT)) {
 			String expression = element.getAttribute(ATTR_EXPRESSION);
-			return new DbgpWatchBreakpoint(id, enabled, hitValue, hitCount,
-					hitCondition, expression);
+			return new DbgpWatchBreakpoint(id, enabled, hitValue, hitCount, hitCondition, expression);
 		}
 
 		return null;
@@ -266,7 +256,6 @@
 		// throw new DbgpException(e);
 		// }
 
-		return new DbgpSessionInfo(appId, ideKey, session, threadId, parentId,
-				language, null);
+		return new DbgpSessionInfo(appId, ideKey, session, threadId, parentId, language, null);
 	}
 }
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/core/model/IScriptStackFrame.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/core/model/IScriptStackFrame.java
index c905422..2438625 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/core/model/IScriptStackFrame.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/core/model/IScriptStackFrame.java
@@ -11,7 +11,6 @@
 
 import org.eclipse.debug.core.DebugException;
 import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IVariable;
 
 /**
  * A stack frame in a thread on a Script virtual machine.
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/DbgpBreakpointManager.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/DbgpBreakpointManager.java
index d909938..521e437 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/DbgpBreakpointManager.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/DbgpBreakpointManager.java
@@ -174,6 +174,8 @@
 	protected static void removeBreakpoint(IDbgpBreakpointCommands commands,
 			IScriptBreakpoint breakpoint) throws DbgpException {
 		IScriptBreakpoint b = (IScriptBreakpoint) breakpoint;
+		
+		System.out.println("DbgpBreakpointManager.removeBreakpoint()");
 
 		commands.removeBreakpoint(b.getIdentifier());
 		if (b instanceof IScriptMethodEntryBreakpoint) {
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptDebugElement.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptDebugElement.java
index aea3025..06a0386 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptDebugElement.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptDebugElement.java
@@ -18,39 +18,18 @@
 import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
 import org.eclipse.dltk.dbgp.exceptions.DbgpException;
 import org.eclipse.dltk.debug.core.DLTKDebugPlugin;
 import org.eclipse.dltk.debug.core.model.IScriptDebugElement;
 
-public class ScriptDebugElement extends PlatformObject implements
-		IScriptDebugElement {
-
-	private IDebugTarget target;
-
-	public ScriptDebugElement() {
-		this.target = null;
-	}
-
-	public ScriptDebugElement(IDebugTarget target) {
-		if (target == null) {
-			throw new IllegalArgumentException();
-		}
-
-		this.target = target;
-	}
-
-	public IDebugTarget getDebugTarget() {
-		return target;
-	}
+public abstract class ScriptDebugElement extends PlatformObject implements IScriptDebugElement {
 
 	public ILaunch getLaunch() {
 		return getDebugTarget().getLaunch();
 	}
 
 	public String getModelIdentifier() {
-		//TODO: expand this!!!
-		return ScriptModelConstants.MODEL_ID;
+		return getDebugTarget().getModelIdentifier();
 	}
 
 	public Object getAdapter(Class adapter) {
@@ -64,27 +43,18 @@
 	}
 
 	protected void abort(String message, Throwable e) throws DebugException {
-		throw new DebugException(new Status(IStatus.ERROR,
-				DLTKDebugPlugin.PLUGIN_ID, DebugPlugin.INTERNAL_ERROR, message,
-				e));
+		throw new DebugException(new Status(IStatus.ERROR, DLTKDebugPlugin.PLUGIN_ID, DebugPlugin.INTERNAL_ERROR, message, e));
 	}
 
-	protected DebugException makeNotSupported(String message, Throwable e)
-			throws DebugException {
-		return new DebugException(new Status(IStatus.ERROR,
-				DLTKDebugPlugin.PLUGIN_ID, DebugException.NOT_SUPPORTED,
-				message, e));
+	protected DebugException makeNotSupported(String message, Throwable e) throws DebugException {
+		return new DebugException(new Status(IStatus.ERROR, DLTKDebugPlugin.PLUGIN_ID, DebugException.NOT_SUPPORTED, message, e));
 	}
 
 	protected DebugException wrapDbgpException(String message, DbgpException e) {
-		return new DebugException(new Status(IStatus.ERROR, DebugPlugin
-				.getUniqueIdentifier(), DebugException.INTERNAL_ERROR, message,
-				e));
+		return new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR, message, e));
 	}
 
 	protected DebugException wrapIOException(String message, IOException e) {
-		return new DebugException(new Status(IStatus.ERROR, DebugPlugin
-				.getUniqueIdentifier(), DebugException.INTERNAL_ERROR, message,
-				e));
+		return new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR, message, e));
 	}
 }
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptDebugTarget.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptDebugTarget.java
index d7f92a9..a6f5d4b 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptDebugTarget.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptDebugTarget.java
@@ -55,9 +55,13 @@
 
 	private IDbgpService dbgpService;
 	private String dbgpId;
+	
+	private String mondelId;
 
-	public ScriptDebugTarget(IDbgpService dbgpService, String id,
+	public ScriptDebugTarget(String modelId, IDbgpService dbgpService, String id,
 			ILaunch launch, IProcess process) throws CoreException {
+		
+		this.mondelId = modelId;
 
 		this.listeners = new ListenerList();
 
@@ -85,6 +89,10 @@
 		return this;
 	}
 
+	public String getModelIdentifier() {
+		return mondelId;	
+	}
+	
 	public ILaunch getLaunch() {
 		return launch;
 	}
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptMethodEntryBreakpoint.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptMethodEntryBreakpoint.java
index 1db3970..9309eba 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptMethodEntryBreakpoint.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptMethodEntryBreakpoint.java
@@ -71,5 +71,4 @@
 	public void setSecondaryId(String id) throws CoreException {
 		getMarker().setAttribute(SECONDARY_ID, id);
 	}
-
 }
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptModelConstants.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptModelConstants.java
index c82e205..f71cb2e 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptModelConstants.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptModelConstants.java
@@ -14,5 +14,6 @@
 
 	}
 
+	// TODO: should remove this
 	public static final String MODEL_ID = "org.eclipse.dltk.debug.core.model";
 }
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptStackFrame.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptStackFrame.java
index d69c7f4..2bff79c 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptStackFrame.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptStackFrame.java
@@ -15,6 +15,7 @@
 import java.util.List;
 
 import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IDebugTarget;
 import org.eclipse.debug.core.model.IRegisterGroup;
 import org.eclipse.debug.core.model.IThread;
 import org.eclipse.debug.core.model.IVariable;
@@ -26,8 +27,7 @@
 import org.eclipse.dltk.debug.core.model.IScriptThread;
 import org.eclipse.dltk.debug.core.model.IScriptVariable;
 
-public class ScriptStackFrame extends ScriptDebugElement implements
-		IScriptStackFrame {
+public class ScriptStackFrame extends ScriptDebugElement implements IScriptStackFrame {
 
 	private int stackDepth;
 
@@ -39,8 +39,7 @@
 
 	private String name;
 
-	protected IScriptVariable[] retrieveVariables(int stackDepth,
-			IDbgpCoreCommands core) throws DbgpException {
+	protected IScriptVariable[] retrieveVariables(int stackDepth, IDbgpCoreCommands core) throws DbgpException {
 
 		List properties = new ArrayList();
 
@@ -51,23 +50,18 @@
 		Iterator iter = properties.iterator();
 		while (iter.hasNext()) {
 			IDbgpProperty property = (IDbgpProperty) iter.next();
-//			if (property.hasChildren()) {
-//				property = core.getProperty(property.getFullName(), stackLevel
-//						.getLevel());
-//			}
-			variables.add(new ScriptVariable(stackDepth, property,
-					getDebugTarget(), core));
+			// if (property.hasChildren()) {
+			// property = core.getProperty(property.getFullName(), stackLevel
+			// .getLevel());
+			// }
+			variables.add(new ScriptVariable(getDebugTarget(), stackDepth, property, core));
 		}
 
-		return (IScriptVariable[]) variables
-				.toArray(new IScriptVariable[variables.size()]);
+		return (IScriptVariable[]) variables.toArray(new IScriptVariable[variables.size()]);
 
 	}
 
-	public ScriptStackFrame(IScriptThread thread, IDbgpStackLevel stackLevel,
-			IDbgpCoreCommands coreCommands, int stackDepth)
-			throws DbgpException {
-		super(thread.getDebugTarget());
+	public ScriptStackFrame(IScriptThread thread, IDbgpStackLevel stackLevel, IDbgpCoreCommands coreCommands, int stackDepth) throws DbgpException {
 
 		if (thread == null || stackLevel == null || coreCommands == null) {
 			throw new IllegalArgumentException("thread cannot be null");
@@ -76,9 +70,10 @@
 		this.thread = thread;
 		this.stackLevel = stackLevel;
 		this.name = stackLevel.getWhere();
-		//this.variables =  new IScriptVariable[0];  // retrieveVariables(stackLevel.getLevel(), coreCommands);
-		
-		this.variables =  retrieveVariables(stackLevel.getLevel(), coreCommands);
+		// this.variables = new IScriptVariable[0]; //
+		// retrieveVariables(stackLevel.getLevel(), coreCommands);
+
+		this.variables = retrieveVariables(stackLevel.getLevel(), coreCommands);
 
 		this.stackDepth = stackDepth;
 	}
@@ -222,14 +217,19 @@
 	}
 
 	public String toString() {
-		return "Stack frame (level: " + (stackDepth - stackLevel.getLevel())
-				+ ")";
+		return "Stack frame (level: " + (stackDepth - stackLevel.getLevel()) + ")";
 	}
 
 	public IScriptVariable findVariable(String varName) throws DebugException {
-		for (int a=0;a<variables.length;a++){
-			if (variables[a].getName().equals(varName))return variables[a];
+		for (int a = 0; a < variables.length; a++) {
+			if (variables[a].getName().equals(varName))
+				return variables[a];
 		}
 		return null;
 	}
+
+	// IDebugElement
+	public IDebugTarget getDebugTarget() {
+		return thread.getDebugTarget();
+	}
 }
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptThread.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptThread.java
index 916151c..3bd1079 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptThread.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptThread.java
@@ -13,13 +13,13 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.debug.core.DebugEvent;
 import org.eclipse.debug.core.DebugException;
 import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.core.model.IDebugTarget;
 import org.eclipse.debug.core.model.IStackFrame;
 import org.eclipse.dltk.core.DLTKCore;
 import org.eclipse.dltk.dbgp.IDbgpNotification;
@@ -59,6 +59,8 @@
 	private volatile boolean suspended;
 
 	private volatile boolean terminated;
+	
+	private IScriptDebugTarget target;
 
 	// Stop
 	private IDbgpStatus stopDebugger() throws DbgpException {
@@ -125,12 +127,8 @@
 	
 	public ScriptThread(IScriptDebugTarget target, IDbgpSession session,
 			ScriptThreadManager manager) throws DbgpException, CoreException {
-		super(target);
-
-		if (target == null || session == null) {
-			throw new IllegalArgumentException();
-		}
 		
+		this.target = target;
 		
 
 		this.manager = manager;
@@ -361,4 +359,8 @@
 	public String toString() {
 		return "Thread (" + session.getInfo().getThreadId() + ")";
 	}
+
+	public IDebugTarget getDebugTarget() {
+		return target.getDebugTarget();
+	}
 }
\ No newline at end of file
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptThreadManager.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptThreadManager.java
index 94c3825..a84ec83 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptThreadManager.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptThreadManager.java
@@ -10,7 +10,6 @@
 package org.eclipse.dltk.debug.internal.core.model;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import org.eclipse.core.runtime.ListenerList;
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptValue.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptValue.java
index 4776895..fcdc43b 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptValue.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptValue.java
@@ -10,6 +10,7 @@
 package org.eclipse.dltk.debug.internal.core.model;
 
 import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IDebugTarget;
 import org.eclipse.debug.core.model.IVariable;
 import org.eclipse.dltk.debug.core.model.IScriptValue;
 import org.eclipse.dltk.debug.core.model.IScriptVariable;
@@ -18,9 +19,7 @@
 
 	private IScriptVariable variable;
 
-	protected ScriptValue(IScriptVariable variable) {
-		super(variable.getDebugTarget());
-
+	protected ScriptValue(IScriptVariable variable) {		
 		this.variable = variable;
 	}
 
@@ -48,4 +47,8 @@
 	public String toString(){
 		return variable.getValueString();
 	}
+
+	public IDebugTarget getDebugTarget() {
+		return variable.getDebugTarget();
+	}
 }
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptVariable.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptVariable.java
index ca9b31a..fa88b1f 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptVariable.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptVariable.java
@@ -17,8 +17,7 @@
 import org.eclipse.dltk.dbgp.exceptions.DbgpException;
 import org.eclipse.dltk.debug.core.model.IScriptVariable;
 
-public class ScriptVariable extends ScriptDebugElement implements
-		IScriptVariable {
+public class ScriptVariable extends ScriptDebugElement implements IScriptVariable {
 
 	private int stackLevel;
 
@@ -28,9 +27,10 @@
 
 	private IDbgpCoreCommands core;
 
-	protected ScriptVariable(int stackLevel, IDbgpProperty property,
-			IDebugTarget target, IDbgpCoreCommands core) {
-		super(target);
+	private IDebugTarget target;
+	
+	protected ScriptVariable(IDebugTarget target, int stackLevel, IDbgpProperty property, IDbgpCoreCommands core) {
+		this.target = target;
 
 		this.stackLevel = stackLevel;
 		this.property = property;
@@ -40,6 +40,10 @@
 		this.core = core;
 	}
 
+	public IDebugTarget getDebugTarget() {
+		 return target;
+	}
+
 	public String getName() throws DebugException {
 		return property.getName();
 	}
@@ -96,20 +100,19 @@
 
 	public synchronized IScriptVariable[] getChildren() {
 		IDbgpProperty[] properties = property.getAvailableChildren();
-		
-		if (properties.length!=property.getChildrenCount()){
+
+		if (properties.length != property.getChildrenCount()) {
 			try {
-				property=core.getProperty(property.getFullName(), stackLevel);
+				property = core.getProperty(property.getFullName(), stackLevel);
 				return getChildren();
-			} catch (DbgpException e) {				
-				//// TODO Auto-generated catch block
-				//e.printStackTrace();				
+			} catch (DbgpException e) {
+				// // TODO Auto-generated catch block
+				// e.printStackTrace();
 			}
-		}	
+		}
 		IScriptVariable[] variables = new IScriptVariable[properties.length];
 		for (int i = 0; i < properties.length; ++i) {
-			variables[i] = new ScriptVariable(stackLevel,
-					(IDbgpProperty) properties[i], getDebugTarget(), core);
+			variables[i] = new ScriptVariable(getDebugTarget(), stackLevel, (IDbgpProperty) properties[i], core);
 		}
 		return variables;
 	}
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptWatchExpressionDelegate.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptWatchExpressionDelegate.java
index 6377f0b..90698ec 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptWatchExpressionDelegate.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/ScriptWatchExpressionDelegate.java
@@ -32,8 +32,7 @@
 import org.eclipse.dltk.debug.core.model.IScriptValue;
 import org.eclipse.dltk.debug.core.model.IScriptVariable;
 
-public class ScriptWatchExpressionDelegate implements IWatchExpressionDelegate,
-		IWatchExpressionResult {
+public class ScriptWatchExpressionDelegate implements IWatchExpressionDelegate, IWatchExpressionResult {
 
 	private IDebugElement context;
 
@@ -56,15 +55,14 @@
 		Job job = new Job("Evaluate expression") {
 			protected IStatus run(IProgressMonitor monitor) {
 				try {
-					if (context.getDebugTarget().isTerminated())return Status.OK_STATUS;
+					if (context.getDebugTarget().isTerminated())
+						return Status.OK_STATUS;
 					IDbgpProperty property = extended.evaluate(expression);
 
-					IScriptVariable variable = new ScriptVariable(0, property,
-							context.getDebugTarget(), core);
+					IScriptVariable variable = new ScriptVariable(context.getDebugTarget(), 0, property, core);
 					value = new ScriptValue(variable);
 
-					listener
-							.watchEvaluationFinished(ScriptWatchExpressionDelegate.this);
+					listener.watchEvaluationFinished(ScriptWatchExpressionDelegate.this);
 				} catch (DbgpException e) {
 					addError(e.getMessage());
 				}
@@ -90,8 +88,7 @@
 	}
 
 	// IWatchExpressionDelegate
-	public void evaluateExpression(String expression, IDebugElement context,
-			IWatchExpressionListener listener) {
+	public void evaluateExpression(String expression, IDebugElement context, IWatchExpressionListener listener) {
 		this.expression = expression;
 		this.context = context;
 		this.listener = listener;
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpDebugger.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpDebugger.java
index 17d0c14..68fad1d 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpDebugger.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpDebugger.java
@@ -17,7 +17,6 @@
 import org.eclipse.dltk.dbgp.commands.IDbgpFeatureCommands;
 import org.eclipse.dltk.dbgp.commands.IDbgpStreamCommands;
 import org.eclipse.dltk.dbgp.exceptions.DbgpException;
-import org.eclipse.dltk.debug.internal.core.model.IThreadManagement;
 
 public class DbgpDebugger {
 	// Operations
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpOperation.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpOperation.java
index 69a9251..6ed4f94 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpOperation.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpOperation.java
@@ -9,9 +9,6 @@
  *******************************************************************************/
 package org.eclipse.dltk.debug.internal.core.model.operations;
 
-import java.io.IOException;
-import java.io.OutputStream;
-
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
@@ -23,7 +20,6 @@
 import org.eclipse.dltk.dbgp.commands.IDbgpCoreCommands;
 import org.eclipse.dltk.dbgp.commands.IDbgpExtendedCommands;
 import org.eclipse.dltk.dbgp.exceptions.DbgpException;
-import org.eclipse.dltk.debug.internal.core.model.IThreadManagement;
 
 public abstract class DbgpOperation {
 	private static final boolean DEBUG = DLTKCore.DEBUG;
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpStepIntoOperation.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpStepIntoOperation.java
index bcebace..71199a5 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpStepIntoOperation.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpStepIntoOperation.java
@@ -12,7 +12,6 @@
 import org.eclipse.dltk.dbgp.IDbgpStatus;
 import org.eclipse.dltk.dbgp.commands.IDbgpCommands;
 import org.eclipse.dltk.dbgp.exceptions.DbgpException;
-import org.eclipse.dltk.debug.internal.core.model.IThreadManagement;
 
 public class DbgpStepIntoOperation extends DbgpStepOperation {
 	private static final String JOB_NAME = "StepInto operation";
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpStepOverOperation.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpStepOverOperation.java
index 278d346..8afff99 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpStepOverOperation.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpStepOverOperation.java
@@ -12,7 +12,6 @@
 import org.eclipse.dltk.dbgp.IDbgpStatus;
 import org.eclipse.dltk.dbgp.commands.IDbgpCommands;
 import org.eclipse.dltk.dbgp.exceptions.DbgpException;
-import org.eclipse.dltk.debug.internal.core.model.IThreadManagement;
 
 public class DbgpStepOverOperation extends DbgpStepOperation {
 	private static final String JOB_NAME = "StepOver operation";
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpStepReturnOperation.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpStepReturnOperation.java
index 4d6a35a..8452813 100644
--- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpStepReturnOperation.java
+++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/debug/internal/core/model/operations/DbgpStepReturnOperation.java
@@ -12,7 +12,6 @@
 import org.eclipse.dltk.dbgp.IDbgpStatus;
 import org.eclipse.dltk.dbgp.commands.IDbgpCommands;
 import org.eclipse.dltk.dbgp.exceptions.DbgpException;
-import org.eclipse.dltk.debug.internal.core.model.IThreadManagement;
 
 public class DbgpStepReturnOperation extends DbgpStepOperation {
 	private static final String JOB_NAME = "StepReturn operation";