API consolidation for org.eclipse.objectteams.otdt.debug
- redefine the line between API and non-API
- add javadoc to API
- removed some unused stuff
Also:
- implemented clearing the TeamView when a launch terminates
- removed redundant sort mode "activation order"
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.debug/META-INF/MANIFEST.MF
index ce7d204..d46aec5 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.objectteams.otdt.debug/META-INF/MANIFEST.MF
@@ -15,6 +15,6 @@
  org.eclipse.objectteams.otdt
 Bundle-ActivationPolicy: lazy
 Export-Package: org.eclipse.objectteams.otdt.debug,
- org.eclipse.objectteams.otdt.debug.core.breakpoints,
- org.eclipse.objectteams.otdt.debug.internal
+ org.eclipse.objectteams.otdt.debug.internal;x-internal:="true",
+ org.eclipse.objectteams.otdt.debug.internal.breakpoints;x-friends:="org.eclipse.objectteams.otdt.tests"
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.launch b/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.launch
index 814e921..e44b039 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.launch
+++ b/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.launch
@@ -7,6 +7,6 @@
 </listAttribute>
 <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
 <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.sh}"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="${project_loc:OTRE}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="${project_loc:org.eclipse.objectteams.runtime}"/>
 <stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/org.eclipse.objectteams.otdt.debug}"/>
 </launchConfiguration>
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.sh b/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.sh
index 4aaf5bb..6050c71 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.sh
+++ b/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.sh
@@ -33,7 +33,7 @@
  * Fraunhofer FIRST - Initial API and implementation
  * Technical University Berlin - Initial API and implementation
  **********************************************************************/
-package org.eclipse.objectteams.otdt.debug.core.breakpoints;
+package org.eclipse.objectteams.otdt.debug.internal.breakpoints;
 
 /** 
  *  Do not edit: This interface is auto-generated from org/objectteams/Team.java 
@@ -48,8 +48,8 @@
 # INPUT:
 OTRE=$1
 if [ ! -d ${OTRE} ]; then
-	echo "Project root of OTRE not found at ${OTRE}".
-	echo "Perhaps you don't have project OTRE in your workspace?"
+	echo "Project root of org.eclipse.objectteams.runtime not found at ${OTRE}".
+	echo "Perhaps you don't have project org.eclipse.objectteams.runtime in your workspace?"
 	exit
 fi
 TEAM=${OTRE}/src/org/objectteams/Team.java
@@ -59,7 +59,7 @@
 fi
 
 # OUTPUT:
-OUT=src/org/eclipse/objectteams/otdt/debug/core/breakpoints/IOOTBreakPoints.java
+OUT=src/org/eclipse/objectteams/otdt/debug/internal/breakpoints/IOOTBreakPoints.java
 
 if [ "$2" != "RUN" ]
 then
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDTDebugPreferenceConstants.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDTDebugPreferenceConstants.java
index 59cfc62..7aab4f8 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDTDebugPreferenceConstants.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDTDebugPreferenceConstants.java
@@ -24,10 +24,21 @@
 {

 

 	/**

-	 * The sort mode for teams in Teamview

+	 * <h3>Sort mode for teams in the Team Monitor view.</h3> 
+	 * By this constant the UI advises the {@link OTDebugElementsContainer} to 
+	 * sort team instances by the names of their classes.

 	 */

 	public static final String TEAMS_BY_NAME = "Teams.by.name"; //$NON-NLS-1$

+	/**
+	 * <h3>Sort mode for teams in the Team Monitor view.</h3> 
+	 * By this constant the UI advises the {@link OTDebugElementsContainer} to 
+	 * sort team instances by instantiation time.
+	 */
 	public static final String TEAMS_BY_INSTANTIATION = "Teams.by.instantiation"; //$NON-NLS-1$

+	/**
+	 * <h3>Sort mode for teams in the Team Monitor view.</h3> 
+	 * By this constant the UI advises the {@link OTDebugElementsContainer} to 
+	 * sort team instances by activation time.
+	 */
 	public static final String TEAMS_BY_ACTIVATION_TIME = "Teams.by.activationtime"; //$NON-NLS-1$

-	public static final String TEAMS_BY_ACTIVATION_ORDER = "Teams.by.activationorder"; //$NON-NLS-1$

 }

diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDebugEventListener.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDebugEventListener.java
index 6b912ce..db7ffae 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDebugEventListener.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDebugEventListener.java
@@ -20,15 +20,35 @@
  **********************************************************************/
 package org.eclipse.objectteams.otdt.debug;
 
-import org.eclipse.debug.core.ILaunch;
+import org.eclipse.objectteams.otdt.debug.internal.TeamBreakpointListener;
 
 /**
+ * This interface defines a protocol between the {@link TeamBreakpointListener} (source)
+ * and the Team Monitor View (in plugin org.eclipse.objectteams.otdt.debug.ui) (sink)
+ * in order to turn events that reflect the instantiation and activation state of teams
+ * into updates of the Team Monitor View.
+ * 
+ * Note that the TeamView directly observes termination of a launch by implementing
+ * ILaunchesListener2 (no need to involve this interface for that). 
+ *  
  * @author gis
  */
 public interface IOTDebugEventListener
 {
-    public void launched(ILaunch launch);
+	/**
+	 * A team instance has been instantiated in the debug target.
+	 * @param newTeam the new team instance
+	 */
     public void teamInstantiated(TeamInstance newTeam);
+    /**
+     * A team instance has been disposed in the debug target (finalize was called).
+     * @param idx position of the element within the viewer, 
+     * 	corresponds also with the order in {@link org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer#_teamInstances}.
+     */
     public void teamDisposed(int idx);
+    /**
+     * The activation state of a team instance has changed.
+     * @param teamInstance the team instance
+     */
     public void activationStateChanged(TeamInstance teamInstance);
 }
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTLaunchConstants.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTLaunchConstants.java
index 62a0e38..294e8b2 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTLaunchConstants.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTLaunchConstants.java
@@ -25,17 +25,16 @@
  * @author resix
  */
 public interface IOTLaunchConstants {
-	public static final String uniquePrefix = "org.eclipse.objectteams.otdt.debug"; //$NON-NLS-1$
 	/**
 	 * Launch configuration attribute key. The value is a list of team names
 	 * to be woven and activated automatically in this objectteams launch configuration.
 	 */
-	public static final String ATTR_TEAMCONFIG_LIST = uniquePrefix + ".TEAMCONFIG_ATTR"; //$NON-NLS-1$
+	public static final String ATTR_TEAMCONFIG_LIST = OTDebugPlugin.PLUGIN_ID + ".TEAMCONFIG_ATTR"; //$NON-NLS-1$
 	
 	/**
 	 * Launch configuration attribute key. The value states, if the teams in the objectteams 
 	 * launch configuration will be actually used while launching.
 	 */
-	public static final String ATTR_TEAMCONFIG_ACTIVE = uniquePrefix + ".TEAMCONFIG_ACTIVE_ATTR"; //$NON-NLS-1$
+	public static final String ATTR_TEAMCONFIG_ACTIVE = OTDebugPlugin.PLUGIN_ID + ".TEAMCONFIG_ACTIVE_ATTR"; //$NON-NLS-1$
 
 }
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugElementsContainer.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugElementsContainer.java
index 7a75e4c..e87e5c6 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugElementsContainer.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugElementsContainer.java
@@ -33,7 +33,6 @@
 import org.eclipse.jdt.debug.core.IJavaThread;
 import org.eclipse.jdt.debug.core.IJavaVariable;
 import org.eclipse.jdt.internal.debug.core.model.JDIThisVariable;
-import org.eclipse.objectteams.otdt.debug.internal.util.TeamActivationOrderComparator;
 import org.eclipse.objectteams.otdt.debug.internal.util.TeamActivationTimeComparator;
 import org.eclipse.objectteams.otdt.debug.internal.util.TeamInstantiantionComparator;
 import org.eclipse.objectteams.otdt.debug.internal.util.TeamNameComparator;
@@ -53,7 +52,6 @@
  * current sorting mode.
  * 
  * @author ike
- * $Id: OTDebugElementsContainer.java 23427 2010-02-03 22:23:59Z stephan $
  */
 public class OTDebugElementsContainer implements IAdaptable
 {
@@ -141,15 +139,11 @@
 		{
 			Collections.sort(_teamInstances, new TeamActivationTimeComparator());
 		}
-		if(_sortMode.equals(IOTDTDebugPreferenceConstants.TEAMS_BY_ACTIVATION_ORDER))
-		{
-			Collections.sort(_teamInstances, new TeamActivationOrderComparator());
-		}
-		if(_sortMode.equals(IOTDTDebugPreferenceConstants.TEAMS_BY_INSTANTIATION))
+		else if(_sortMode.equals(IOTDTDebugPreferenceConstants.TEAMS_BY_INSTANTIATION))
 		{
 			Collections.sort(_teamInstances, new TeamInstantiantionComparator());
 		}
-		if(_sortMode.equals(IOTDTDebugPreferenceConstants.TEAMS_BY_NAME))
+		else if(_sortMode.equals(IOTDTDebugPreferenceConstants.TEAMS_BY_NAME))
 		{
 			Collections.sort(_teamInstances, new TeamNameComparator());
 		}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugPlugin.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugPlugin.java
index 104ec00..97f42cc 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugPlugin.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugPlugin.java
@@ -44,11 +44,15 @@
 import org.osgi.framework.BundleContext;
 
 /**
- * The main plugin class to be used in the desktop.
+ * The main plugin class.
  */
 public class OTDebugPlugin extends Plugin 
 {
+	/** ID of this plugin */
 	public static final String PLUGIN_ID = "org.eclipse.objectteams.otdt.debug"; //$NON-NLS-1$
+	/**
+	 * Key of a boolean launch configuration attribute. The value denotes whether a launch is OT/J enabled.
+	 */
 	public static final String OT_LAUNCH = "org.eclipse.objectteams.launch"; //$NON-NLS-1$
     
     private OTDebugElementsContainerFactory _containerFactory;
@@ -69,7 +73,7 @@
                     if (isOTDebugLaunch(launches[i]))
                         _otLaunches.add(launches[i]);
 				}
-				checkOTLaunches(_otLaunches.size());
+				checkRegisterOTDebugSupport(_otLaunches.size());
 			}
 		}
 		
@@ -120,7 +124,7 @@
                 if (isOTDebugLaunch(launch) && !_otLaunches.contains(launch))
                 {
                     _otLaunches.add(launch);
-                    checkOTLaunches(_otLaunches.size());
+                    checkRegisterOTDebugSupport(_otLaunches.size());
                 }
             }
         }
@@ -138,7 +142,7 @@
                 if (isOTDebugLaunch(launch) && _otLaunches.contains(launch))
                 {
                     _otLaunches.remove(launch);
-                    checkOTLaunches(_otLaunches.size());
+                    checkRegisterOTDebugSupport(_otLaunches.size());
                     otLaunchFinished(launch);
                 }
             }
@@ -158,8 +162,6 @@
 	
     //The shared instance.
 	private static OTDebugPlugin plugin;
-	//Resource bundle.
-	private ResourceBundle resourceBundle;
 	
 	private OTDebugLaunchManager _otLaunchManager;
 	private TeamBreakpointListener _otTeamBreakpointListener;
@@ -173,28 +175,6 @@
 	{
 		super();
 		plugin = this;
-		try {
-			resourceBundle = ResourceBundle.getBundle("org.eclipse.objectteams.otdt.debug.OTDebugPluginResources"); //$NON-NLS-1$
-		} catch (MissingResourceException x) {
-			resourceBundle = null;
-		}
-	}
-	
-	public void setCallinSteppingConfig(String config) {
-		this._callinSteppingConfig = config;
-	}
-	public String getCallinSteppingConfig() {
-		return this._callinSteppingConfig;
-	}
-
-	public static Status createErrorStatus(String message)
-	{
-	    return new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, null);
-	}
-	
-	public static Status createErrorStatus(String message, Throwable exception)
-	{
-	    return new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, exception);
 	}
 	
 	/**
@@ -236,30 +216,53 @@
 	}
 
 	/**
-	 * Returns the string from the plugin's resource bundle,
-	 * or 'key' if not found.
+	 * Configure the callin stepping mode. The value will be passed to the VM using
+	 * {@link OTVMRunnerAdaptor#OT_DEBUG_CALLIN_STEPPING_VMARG} and will be interpreted by the OTRE.
+	 * @param config a comma separated list (subset) of these tokens: "role", "recurse", "orig"
 	 */
-	public static String getResourceString(String key) {
-		ResourceBundle bundle = OTDebugPlugin.getDefault().getResourceBundle();
-		try {
-			return (bundle != null) ? bundle.getString(key) : key;
-		} catch (MissingResourceException e) {
-			return key;
-		}
+	public void setCallinSteppingConfig(String config) {
+		this._callinSteppingConfig = config;
+	}
+	/**
+	 * Answer the configured callin stepping mode. The value is suitable for being passed 
+	 * to the VM using {@link OTVMRunnerAdaptor#OT_DEBUG_CALLIN_STEPPING_VMARG}.
+	 * @param config a comma separated list (subset) of these tokens: "role", "recurse", "orig"
+	 */
+	public String getCallinSteppingConfig() {
+		return this._callinSteppingConfig;
 	}
 
 	/**
-	 * Returns the plugin's resource bundle,
+	 * Create an error status marked as originating from this plugin.
+	 * @param message the error message
+	 * @return a status instance
 	 */
-	public ResourceBundle getResourceBundle() {
-		return resourceBundle;
+	public static IStatus createErrorStatus(String message)
+	{
+	    return new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, null);
 	}
 
+	/**
+	 * Create an error status marked as originating from this plugin.
+	 * @param message the error message
+	 * @param exception an exception to associate with the status.
+	 * @return a status instance
+	 */
+	public static IStatus createErrorStatus(String message, Throwable exception)
+	{
+	    return new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, exception);
+	}
+
+	/**
+	 * Log an exception marked as originating from this plugin.
+	 * @param message
+	 * @param exception
+	 */
 	public static void logException(String message, Throwable exception) {
 		plugin.getLog().log(createErrorStatus(message, exception));
 	}
 
-	public TempFileManager getTempFileManager()
+	TempFileManager getTempFileManager()
     {
 	    if (_tempFileManager == null)
 	        _tempFileManager = new TempFileManager();
@@ -267,11 +270,19 @@
         return _tempFileManager;
     }
 
+	/**
+	 * Get the registered debug event listeners.
+	 * @return the stored array of listeners (unprotected)
+	 */
 	public IOTDebugEventListener[] getOTDebugEventListeners()
     {
         return _listeners;
     }
 
+	/**
+	 * Add a listener that will be called when a team-relevant breakpoint was hit.
+	 * @param listener
+	 */
 	public void addOTDebugEventListener(IOTDebugEventListener listener)
 	{
 	    int newLength = _listeners.length + 1;
@@ -280,7 +291,11 @@
 	    newListeners[_listeners.length] = listener;
 	    _listeners = newListeners;
 	}
-	
+
+	/**
+	 * remove the given debug event listener.
+	 * @param listener
+	 */
 	public void removeOTDebugEventListener(IOTDebugEventListener listener)
 	{
 	    int occurrences = 0;
@@ -306,7 +321,7 @@
 	    }
 	}
 	
-	public void checkOTLaunches(int otLaunchCount)
+	private void checkRegisterOTDebugSupport(int otLaunchCount)
 	{
 		// Note: the order seems to be undefined! After finishing a launch, we do not 
 		// immediately get the launchRemoved event. We may first get another launchAdded 
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTLaunchConfigMigrationDelegate.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTLaunchConfigMigrationDelegate.java
deleted file mode 100644
index af3c830..0000000
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTLaunchConfigMigrationDelegate.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/**********************************************************************
- * This file is part of "Object Teams Development Tooling"-Software
- * 
- * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
- * for its Fraunhofer Institute for Computer Architecture and Software
- * Technology (FIRST), Berlin, Germany and Technical University Berlin,
- * Germany.
- * 
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * $Id: OTLaunchConfigMigrationDelegate.java 23427 2010-02-03 22:23:59Z stephan $
- * 
- * Please visit http://www.eclipse.org/objectteams for updates and contact.
- * 
- * Contributors:
- * Fraunhofer FIRST - Initial API and implementation
- * Technical University Berlin - Initial API and implementation
- **********************************************************************/
-package org.eclipse.objectteams.otdt.debug;
-
-import java.util.HashMap;
-import java.util.TreeMap;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationMigrationDelegate;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.internal.core.LaunchConfiguration;
-import org.eclipse.debug.internal.core.LaunchConfigurationInfo;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-
-/**
- * This class migrates old OT-launches (Java App, OT/Equinox FW, OTEclipse App) into regular
- * Eclipse launches, but marked as OTlaunch, thereby enabling the OTRE, OT/Equinox, resp.
- * 
- * @author stephan
- * @since 1.2.2
- */
-public class OTLaunchConfigMigrationDelegate implements ILaunchConfigurationMigrationDelegate {
-
-	final static HashMap<String,String> oldToNew = new HashMap<String, String>();
-	static {
-		// 'referencing' deleted constants from old plug-ins (old, removed launch configuration types)
-		oldToNew.put("org.objectteams.otdt.debug.LaunchConfigurationType", 	IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION); //$NON-NLS-1$
-		oldToNew.put("org.objectteams.otdt.pde.ui.OTEquinoxLaunchConfigurationType", 		  "org.eclipse.pde.ui.EquinoxLauncher");  //$NON-NLS-1$ //$NON-NLS-2$
-		oldToNew.put("org.objectteams.otdt.pde.ui.EclipseApplicationLaunchConfigurationType", "org.eclipse.pde.ui.RuntimeWorkbench"); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	
-	@SuppressWarnings("nls")
-	public boolean isCandidate(ILaunchConfiguration candidate) throws CoreException {
-		String candidateType = candidate.getType().getIdentifier();
-		return   candidateType.startsWith("org.objectteams.otdt")
-			  && oldToNew.containsKey(candidateType);
-	}
-
-	public void migrate(final ILaunchConfiguration candidate) throws CoreException {
-		final String newId = oldToNew.get(candidate.getType().getIdentifier());
-		if (newId == null) return;
-		ILaunchConfiguration wrapper = new LaunchConfiguration(candidate.getMemento()) {
-			@Override
-			protected LaunchConfigurationInfo getInfo() throws CoreException {
-				return new LaunchConfigurationInfo() {
-					@Override
-					protected ILaunchConfigurationType getType() {
-						// revert to plain Eclipse launch type:
-						return DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(newId);
-					}
-					@SuppressWarnings("unchecked")
-					@Override
-					protected TreeMap getAttributes() {
-						try {
-							TreeMap orig = (TreeMap) candidate.getWorkingCopy().getAttributes();
-							// but ensure it is marked as an OT-launch:
-							orig.put(OTDebugPlugin.OT_LAUNCH, Boolean.TRUE);
-							return orig;
-						} catch (CoreException e) { /* silent. */ }
-						return new TreeMap(); // must not return null
-					}
-				};
-			}
-		};
-		wrapper.getWorkingCopy().doSave();
-	}
-
-}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTVMRunnerAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTVMRunnerAdaptor.java
index edf1b29..c7bdf18 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTVMRunnerAdaptor.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTVMRunnerAdaptor.java
@@ -33,14 +33,16 @@
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
 import org.eclipse.jdt.core.IType;
 import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.VMRunnerConfiguration;
 import org.eclipse.objectteams.otdt.core.ext.OTREContainer;
 import org.eclipse.objectteams.otdt.debug.internal.TempFileManager;
 
 
 /**
+ * Instances of this class are capable of providing the necessary command line arguments
+ * for launching a Java application with OT/J support.
  * @author gis
  */
 @SuppressWarnings("nls")
@@ -55,80 +57,28 @@
 	private String _mode;
 	private ILaunch _launch;
 
-	public void setAdaptationArgs(ILaunchConfiguration configuration, String mode, ILaunch launch) throws CoreException
+	/**
+	 * Store the original arguments as passed to {@link ILaunchConfigurationDelegate#launch(ILaunchConfiguration, String, ILaunch, org.eclipse.core.runtime.IProgressMonitor)}
+	 * @param configuration see first argument of {@link ILaunchConfigurationDelegate#launch(ILaunchConfiguration, String, ILaunch, org.eclipse.core.runtime.IProgressMonitor) launch(..)}
+	 * @param mode see second argument of {@link ILaunchConfigurationDelegate#launch(ILaunchConfiguration, String, ILaunch, org.eclipse.core.runtime.IProgressMonitor) launch(..)}
+	 * @param launch see third argument of {@link ILaunchConfigurationDelegate#launch(ILaunchConfiguration, String, ILaunch, org.eclipse.core.runtime.IProgressMonitor) launch(..)}
+	 */
+	public void setAdaptationArgs(ILaunchConfiguration configuration, String mode, ILaunch launch) 
 	{
 		_launchConfig = configuration;
 		_mode = mode;
 		_launch = launch;
 	}
-	
-	public VMRunnerConfiguration adapt(VMRunnerConfiguration vmRunnerConfig) throws CoreException
-	{
-		adaptVMArgs(vmRunnerConfig);
-		
-		return vmRunnerConfig;
-	}
 
-	protected void cloneRunner(VMRunnerConfiguration vmRunnerConfig, VMRunnerConfiguration newConfig)
-	{
-		// Only main type and class path have to be set in the constructor already
-    	newConfig.setBootClassPath(vmRunnerConfig.getBootClassPath());
-    	newConfig.setEnvironment(vmRunnerConfig.getEnvironment());
-    	newConfig.setProgramArguments(vmRunnerConfig.getProgramArguments());
-    	newConfig.setResumeOnStartup(vmRunnerConfig.isResumeOnStartup());
-    	newConfig.setVMArguments(vmRunnerConfig.getVMArguments());
-    	newConfig.setVMSpecificAttributesMap(vmRunnerConfig.getVMSpecificAttributesMap());
-    	newConfig.setWorkingDirectory(vmRunnerConfig.getWorkingDirectory());
-	}
-
-	protected void adaptVMArgs(VMRunnerConfiguration newConfig) throws CoreException
-    {
-	    List<String> otVMArgs = getOTVMArgs();
-	    String teamConfigArg = generateTeamConfigArgument(_launch, _launchConfig);
-	    if (teamConfigArg != null)
-	    	otVMArgs.add(teamConfigArg);
-	    if (ILaunchManager.DEBUG_MODE.equals(_mode)) 
-	    {
-	    	otVMArgs.add(OT_DEBUG_VMARG);
-	    	
-	    	String callinSteppingVMArg = getCallinSteppingVMArg();
-	    	if (callinSteppingVMArg != null)
-	    		otVMArgs.add(callinSteppingVMArg);
-	    }
-
-	    String[] vmArgs = newConfig.getVMArguments();
-	    if (vmArgs.length > 0)
-	    {
-	    	for (int i = 0; i < vmArgs.length; i++)
-				otVMArgs.add(vmArgs[i]);
-	    }
-	    
-	    String[] newArgs = new String[otVMArgs.size()];
-	    
-	    // new launches need to enclose file paths in quotes (cmdline is one string parsed by ArgumentParser),
-	    // which are removed here (cmdline is array of strings):
-	    for (int i = 0; i<newArgs.length; i++) {
-	    	newArgs[i] = otVMArgs.get(i).replaceAll("\"", "");
-	    }
-	    newConfig.setVMArguments(newArgs);
-    }
-	
 	/**
-	 * API version: given a list of vm arguments add ot-specific vm arguments.
+	 * Given a list of vm arguments add ot-specific vm arguments.
+	 * Uses values stored by {@link #setAdaptationArgs(ILaunchConfiguration, String, ILaunch)}
+	 * to determine the arguments to add.
 	 * 
-	 * @param vmArguments list to be augmented.
+	 * @param vmArguments space separated list of arguments to be augmented.
+	 * @return augmented space separated list of arguments
 	 * @throws CoreException
 	 */
-	public void adaptVMArguments(List vmArguments) throws CoreException 
-	{
-	    vmArguments.addAll(getOTVMArgs());
-	    String teamConfigArg = generateTeamConfigArgument(_launch, _launchConfig);
-	    if (teamConfigArg != null)
-	    	vmArguments.add(teamConfigArg);
-	    if (ILaunchManager.DEBUG_MODE.equals(_mode))
-	    	vmArguments.add(OT_DEBUG_VMARG);
-	}
-
 	public String adaptVMArgumentString(String vmArguments) throws CoreException 
 	{
 		String sep = " ";
@@ -165,10 +115,6 @@
 		return OT_DEBUG_CALLIN_STEPPING_VMARG+'='+value;
 	}
 
-	protected List<String> getOTVMArgs()
-	{
-        return new ArrayList<String>(getJplisVmargs());
-	}
 	
     /**
 	 * Teams to activate are read from ILaunchConfiguration configuration.
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamBreakpointInstaller.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamBreakpointInstaller.java
index aab2961..923c052 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamBreakpointInstaller.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamBreakpointInstaller.java
@@ -35,23 +35,28 @@
 import org.eclipse.jdt.core.JavaModelException;

 import org.eclipse.jdt.debug.core.IJavaDebugTarget;
 import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;

-import org.eclipse.objectteams.otdt.debug.core.breakpoints.OOTBreakpoints;
-

+import org.eclipse.objectteams.otdt.debug.internal.breakpoints.OOTBreakpoints;
+
+/**
+ * This class un/installs support for breakpoints in certain well-known methods in class {@link org.objectteams.Team}.
+ * <p>
+ * This happens in a two-phase model:
+ * <ul>
+ * <li>register a listener that reacts to creation of a java debug target, i.e., an application was launched in debug mode
+ * <li>for each detected new java debug target install the actual breakpoints.
+ * </ul>
+ */

 public class TeamBreakpointInstaller

 {

     private static Hashtable<String, IBreakpoint> OT_BREAKPOINTS = new Hashtable<String, IBreakpoint>(5);

-    public static boolean OOT_BREAKPOINTS_ENABLED = true; 

-    static {

-    	String prop = System.getProperty("ot.oot.breakpoints"); //$NON-NLS-1$

-    	if ("DISABLE".equals(prop))                             //$NON-NLS-1$

-    		OOT_BREAKPOINTS_ENABLED = false;

-    }

-

+
+    /**
+     * Request breakpoints to be installed once a new launch fires.
+     * @param project used for lookup of org.objectteams.Team, i.e., this class must be in the projects classpath.
+     * @throws CoreException various reasons, like could not find class org.objectteams.Team or could not create a breakpoint.
+     */

     public static void installTeamBreakpoints(IJavaProject project) throws CoreException

-    {

-    	if (!OOT_BREAKPOINTS_ENABLED)

-    		return;

-        
+    {       
         DebugPlugin.getDefault().addDebugEventListener(new IDebugEventSetListener() {
         	// since we want to avoid using the breakpoint manager (thus hiding synthetic breakpoints from the UI),
         	// we have to track creation of the debug target in order to manually install our breakpoints into the target:
@@ -107,11 +112,10 @@
             throw new CoreException(new Status(IStatus.WARNING, OTDebugPlugin.PLUGIN_ID, IStatus.OK, "Cannot set breakpoints for team-activation tracking", ex)); //$NON-NLS-1$

         }

     }

-

+
+    /** Unregister any previously installed breakpoints, so that the next launch will be without. */

     public static void uninstallTeamBreakpoints() throws CoreException

     {

-    	if (!OOT_BREAKPOINTS_ENABLED)

-    		return;

         OT_BREAKPOINTS.clear();

     }
 }

diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamInstance.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamInstance.java
index a8707c7..6c0b9c9 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamInstance.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamInstance.java
@@ -37,23 +37,60 @@
 import com.sun.jdi.ThreadReference;
 
 /**
+ * JDI representation of a known team instance.
  * @author ike
  */
 //TODO(ike): what about launches and thread termination->notify and update _activethreads
 public class TeamInstance extends JDIThisVariable implements IAdaptable
 {
+	/**
+	 * Constant for inactive team state.
+	 */
 	public static final int IS_INACTIVE = 0;
+	/**
+	 * Constant for a team instance that has been implicitly activated
+	 */
 	public static final int IS_IMPLICITACTIVE = 1;
+	/**
+	 * Constant for a team instance that has been explicitly activated
+	 */
 	public static final int IS_ACTIVE = 2;
 
+	private class TeamThread {
+		public long threadID = 0;
+		public long time = 0;
+
+		public TeamThread(long threadID, long time) {
+			this.threadID = threadID;
+			this.time = time;
+		}		
+		@Override
+		public boolean equals(Object obj) {
+			if (obj instanceof TeamThread)
+				return (threadID == ((TeamThread)obj).threadID);
+			
+			return super.equals(obj);
+		}	
+		@Override
+		public String toString() {
+			return "threadID="+threadID+",time="+time;  //$NON-NLS-1$ //$NON-NLS-2$
+		}
+	}
+	
     private List<TeamThread> _activethreads;
     private List<TeamThread> _deactivethreads;
     private List<TeamThread> _implicitActivethreads;
     private int _activationState; // TODO(SH): use for caching
     private TeamThread _globalThread;;
     private long _creationTime;
-    private long _activationTime;
+    private long _activationTime; // captured when asked, fetch value from TeamThread 
     
+    
+    /**
+     * Create a new team instance representation from a JDT variable.
+     * @param var variable from which the object reference shall be extracted
+     * @throws DebugException
+     */
     public TeamInstance(JDIThisVariable var) throws DebugException
     {
     	super((JDIDebugTarget)var.getDebugTarget(),
@@ -66,28 +103,48 @@
     	_activationTime = 0;
     }
     
+    /**
+     * Wall-clock time of when the team instance was created.
+     * @return time in milliseconds
+     */
     public long getCreationTime()
     {
     	return _creationTime;
     }
     
+    /**
+     * Wall-clock time of when the team instance was (last) activated.
+     * @return time in milliseconds
+     */
     public long getActivationTime()
     {
     	return _activationTime;
     }
 
+    /**
+     * Mark that the team instance has been implicitly activated for a given thread.
+     * @param threadID JDI-ID of the thread object
+     */
     public void setImplicitActiveForThreadID(long threadID)
     {
     	TeamThread teamThread = new TeamThread(threadID, System.currentTimeMillis());
     	_implicitActivethreads.add(teamThread);
     }
     
+    /**
+     * Mark that the team instance has been implicitly deactivated for a given thread.
+     * @param threadID JDI-ID of the thread object
+     */
     public void setImplicitInactiveForThreadID(long threadID)
     {
     	TeamThread teamThread = new TeamThread(threadID, 0);
     	_implicitActivethreads.remove(teamThread);
     }
 
+    /**
+     * Mark that the team instance has been explicitly activated for a given thread.
+     * @param threadID JDI-ID of the thread object
+     */
     public void setActiveForThreadID(long threadID)
     {
     	TeamThread teamThread = new TeamThread(threadID, System.currentTimeMillis());
@@ -95,6 +152,10 @@
     	_deactivethreads.remove(teamThread);
     }
     
+    /**
+     * Mark that the team instance has been explicitly deactivated for a given thread.
+     * @param threadID JDI-ID of the thread object
+     */
     public void setInactiveForThreadID(long threadID)
     {
     	TeamThread teamThread = new TeamThread(threadID, System.currentTimeMillis());
@@ -102,16 +163,18 @@
     	_deactivethreads.add(teamThread);
     }
 
-    public List getThreads()
-    {
-    	return _activethreads;
-    }
-
 	public Object getAdapter(Class adapter)
 	{
 		return AdapterManager.getDefault().getAdapter(this, adapter);
 	}
 	
+	/**
+	 * Answer the activation state of the team instance with respect to the given debug element.
+	 * When debugElement is either a stackframe or a thread the corresponding thread is used.
+	 * Otherwise the global activation state is answered. 
+	 * @param debugElement may be used to denote a thread for which activation is queried.
+	 * @return activation state encoded as one of {@link #IS_ACTIVE}, {@link #IS_IMPLICITACTIVE} or {@link #IS_INACTIVE}.
+	 */
 	public int getActivationState(IDebugElement debugElement)
 	{
 		IThread thread= null;
@@ -120,22 +183,17 @@
 			thread= stackFrame.getThread();
 		} else if (debugElement instanceof IThread) {
 			thread = (IThread)debugElement;
-		} if (thread != null)
+		} 
+		if (thread != null)
 			return getActivationState(thread);
 		return globalActivationState();
 	}
 
-	private int getActivationState(IThread thread)
-	{
-		if(isActiveFor(thread))
-			return TeamInstance.IS_ACTIVE;
-		else
-			if(isImplicitActiveFor(thread))
-				return TeamInstance.IS_IMPLICITACTIVE;
-			else
-				return TeamInstance.IS_INACTIVE;
-	}
-	
+	/**
+	 * Answer whether the team instance is active for the given thread
+	 * @param thread debug representation of the thread
+	 * @return true if the team instance is active for the given thread.
+	 */
 	public boolean isActiveFor(IThread thread)
 	{
 		boolean isActive= false;
@@ -159,17 +217,11 @@
 		return isActive;
 	}
 
-	private  int globalActivationState() {
-		if (_activethreads.contains(_globalThread))
-			return IS_ACTIVE;
-		return IS_INACTIVE;
-	}
-	
-	private void setActivationTime(long time)
-	{
-		_activationTime = time;
-	}
-
+	/**
+	 * Answer whether the team instance is implicitly active for the given thread
+	 * @param thread debug representation of the thread
+	 * @return true if the team instance is implicitly active for the given thread.
+	 */
 	public boolean isImplicitActiveFor(IThread thread)
 	{
 		ThreadReference threadRef = ((JDIThread)thread).getUnderlyingThread();
@@ -185,8 +237,34 @@
 		return isImplicitActive;
 	}
 	
+	/**
+	 * Store the value of the pseudo thread org.objectteams.Team.ALL_THREADS.
+	 * @param globalThreadID JDI object ID of the constant value
+	 */
 	public void setGlobalThreadID(long globalThreadID)
 	{
 		_globalThread.threadID = globalThreadID;
 	}
+
+	private int getActivationState(IThread thread)
+	{
+		if(isActiveFor(thread))
+			return TeamInstance.IS_ACTIVE;
+		else
+			if(isImplicitActiveFor(thread))
+				return TeamInstance.IS_IMPLICITACTIVE;
+			else
+				return TeamInstance.IS_INACTIVE;
+	}
+
+	private  int globalActivationState() {
+		if (_activethreads.contains(_globalThread))
+			return IS_ACTIVE;
+		return IS_INACTIVE;
+	}
+
+	private void setActivationTime(long time)
+	{
+		_activationTime = time;
+	}
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/TeamBreakpointListener.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/TeamBreakpointListener.java
index 79b9b05..27dcb7e 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/TeamBreakpointListener.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/TeamBreakpointListener.java
@@ -38,7 +38,7 @@
 import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
 import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
 import org.eclipse.objectteams.otdt.debug.TeamInstance;
-import org.eclipse.objectteams.otdt.debug.core.breakpoints.OOTBreakpoints;
+import org.eclipse.objectteams.otdt.debug.internal.breakpoints.OOTBreakpoints;
 

 public class TeamBreakpointListener implements IJavaBreakpointListener

 {

diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/breakpoints/IOOTBreakPoints.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/breakpoints/IOOTBreakPoints.java
index 629adcc..0fe1beb 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/breakpoints/IOOTBreakPoints.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/breakpoints/IOOTBreakPoints.java
@@ -18,7 +18,7 @@
  * Fraunhofer FIRST - Initial API and implementation
  * Technical University Berlin - Initial API and implementation
  **********************************************************************/
-package org.eclipse.objectteams.otdt.debug.core.breakpoints;
+package org.eclipse.objectteams.otdt.debug.internal.breakpoints;
 
 /** 
  *  Do not edit: This interface is auto-generated from org/objectteams/Team.java 
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/breakpoints/OOTBreakpoints.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/breakpoints/OOTBreakpoints.java
index 586d3a3..4c7fb38 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/breakpoints/OOTBreakpoints.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/breakpoints/OOTBreakpoints.java
@@ -18,7 +18,7 @@
  * Fraunhofer FIRST - Initial API and implementation
  * Technical University Berlin - Initial API and implementation
  **********************************************************************/
-package org.eclipse.objectteams.otdt.debug.core.breakpoints;
+package org.eclipse.objectteams.otdt.debug.internal.breakpoints;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -31,7 +31,7 @@
 import org.eclipse.jdt.debug.core.JDIDebugModel;
 import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
 
-import static org.eclipse.objectteams.otdt.debug.core.breakpoints.IOOTBreakPoints.*;
+import static org.eclipse.objectteams.otdt.debug.internal.breakpoints.IOOTBreakPoints.*;
 
 /**
  * @author ike
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/breakpoints/OTJavaWatchpoint.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/breakpoints/OTJavaWatchpoint.java
index 0d5fc51..d49d4a8 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/breakpoints/OTJavaWatchpoint.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/breakpoints/OTJavaWatchpoint.java
@@ -18,7 +18,7 @@
  * Fraunhofer FIRST - Initial API and implementation
  * Technical University Berlin - Initial API and implementation
  **********************************************************************/
-package org.eclipse.objectteams.otdt.debug.core.breakpoints;
+package org.eclipse.objectteams.otdt.debug.internal.breakpoints;
 
 import java.util.Hashtable;
 import java.util.Iterator;