Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2007-10-04 16:20:23 +0000
committerMichael Rennie2007-10-04 16:20:23 +0000
commit511742f933d6bcac8e5b165b0c66edab332f7ae6 (patch)
tree3e4d5b965268a4361c702c54facccd12b4063a5f
parentb24f91a2164a9f5f3c2d3005c0a8bcf4aa7cc06e (diff)
downloadeclipse.platform.debug-511742f933d6bcac8e5b165b0c66edab332f7ae6.tar.gz
eclipse.platform.debug-511742f933d6bcac8e5b165b0c66edab332f7ae6.tar.xz
eclipse.platform.debug-511742f933d6bcac8e5b165b0c66edab332f7ae6.zip
Bug 12898 [launching] Import/Export of launch configs
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java35
1 files changed, 34 insertions, 1 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
index bf07cc948..b7d6bed90 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
@@ -34,6 +34,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.ListIterator;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
@@ -1107,7 +1108,21 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
*/
public synchronized void verifyImportedLaunchConfigurations() {
try {
- verifyConfigurations(findLocalLaunchConfigurations(), fLaunchConfigurationIndex);
+ //maintain consistency, we cannot have a local configuration that is the same as a shared one.
+ List shared = getSharedLaunchConfigurationNames();
+ List local = findLocalLaunchConfigurations();
+ ILaunchConfiguration config = null;
+ for(ListIterator iter = local.listIterator(); iter.hasNext();) {
+ config = (ILaunchConfiguration) iter.next();
+ if(shared.contains(config.getName())) {
+ iter.remove();
+ config.delete();
+ }
+ }
+ verifyConfigurations(local, fLaunchConfigurationIndex);
+ }
+ catch(CoreException ce) {
+ DebugPlugin.log(ce);
}
finally {
hookResourceChangeListener();
@@ -1665,6 +1680,24 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
/**
+ * Returns a collection of configuration names that are shared in the workspace
+ * @return collection of shared launch configuration names
+ * @since 3.4.0
+ */
+ protected synchronized List getSharedLaunchConfigurationNames() {
+ Iterator iter = getAllLaunchConfigurations().iterator();
+ List configs = new ArrayList();
+ ILaunchConfiguration config = null;
+ while (iter.hasNext()) {
+ config = (ILaunchConfiguration)iter.next();
+ if (!config.isLocal()) {
+ configs.add(config.getName());
+ }
+ }
+ return configs;
+ }
+
+ /**
* Returns the launch configurations mapping to the specified resource
* @param resource the resource to collect mapped launch configurations for
* @return a list of launch configurations if found or an empty list, never null

Back to the top