Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2010-01-05 15:35:19 +0000
committerDarin Wright2010-01-05 15:35:19 +0000
commit43d8b079a508fc2fe6dff53c6c6a10cd095ac81f (patch)
treeb0f40c6cfd6aa073c5d06ce05d89cdb7684c3963 /org.eclipse.debug.core
parent1d89b1532982d7d3dfc7a96121ff2d1d79327042 (diff)
downloadeclipse.platform.debug-43d8b079a508fc2fe6dff53c6c6a10cd095ac81f.tar.gz
eclipse.platform.debug-43d8b079a508fc2fe6dff53c6c6a10cd095ac81f.tar.xz
eclipse.platform.debug-43d8b079a508fc2fe6dff53c6c6a10cd095ac81f.zip
Bug 288368 - getLaunchManager().launchConfigurationAdded/Changed not called for non-local LCs
Diffstat (limited to 'org.eclipse.debug.core')
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java7
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java16
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java12
3 files changed, 20 insertions, 15 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
index d409ff691..7712327e3 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
* 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
@@ -282,9 +282,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfiguration_Failed_to_delete_launch_configuration__1, null)
);
}
- // manually update the launch manager cache since there
- // will be no resource delta
- getLaunchManager().launchConfigurationDeleted(this);
}
} else {
// Delete the resource using IFile API such that
@@ -298,6 +295,8 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
}
file.delete(true, null);
}
+ // update the launch manager cache synchronously
+ getLaunchManager().launchConfigurationDeleted(this);
}
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java
index fffc54a7c..e7e2d854a 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
* 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
@@ -276,10 +276,10 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
}
SubMonitor lmonitor = SubMonitor.convert(monitor, IInternalDebugCoreConstants.EMPTY_STRING, 5);
try {
+ boolean added = false;
if (isLocal()) {
// use java.io to update configuration file
try {
- boolean added = false;
lmonitor.subTask(DebugCoreMessages.LaunchConfigurationWorkingCopy_1);
IFileStore file = getFileStore();
if (file == null) {
@@ -306,11 +306,6 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
stream.close();
}
}
- if (added) {
- getLaunchManager().launchConfigurationAdded(new LaunchConfiguration(getName(), getContainer()));
- } else {
- getLaunchManager().launchConfigurationChanged(new LaunchConfiguration(getName(), getContainer()));
- }
//notify file saved
updateMonitor(lmonitor, 1);
} catch (IOException ie) {
@@ -356,6 +351,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
}
SubMonitor smonitor = null;
if (!file.exists()) {
+ added = true;
//create file input stream: work one unit in a sub monitor
smonitor = lmonitor.newChild(1);
smonitor.setTaskName(MessageFormat.format(DebugCoreMessages.LaunchConfigurationWorkingCopy_2, new String[] {getName()}));
@@ -375,6 +371,12 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
file.setContents(stream, true, false, smonitor);
}
}
+ // notify of add/change for both local and shared configurations - see bug 288368
+ if (added) {
+ getLaunchManager().launchConfigurationAdded(new LaunchConfiguration(getName(), getContainer()));
+ } else {
+ getLaunchManager().launchConfigurationChanged(new LaunchConfiguration(getName(), getContainer()));
+ }
}
finally {
if(lmonitor != null) {
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 17d621314..6be3b2bf2 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
* 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
@@ -2122,12 +2122,16 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* @param config the launch configuration that was deleted
*/
protected void launchConfigurationDeleted(ILaunchConfiguration config) {
+ boolean removed = false;
synchronized (this) {
- fLaunchConfigurations.remove(config);
+ Object key = fLaunchConfigurations.remove(config);
+ removed = key != null;
getAllLaunchConfigurations().remove(config);
}
- getConfigurationNotifier().notify(config, REMOVED);
- clearConfigNameCache();
+ if (removed) {
+ getConfigurationNotifier().notify(config, REMOVED);
+ clearConfigNameCache();
+ }
}
/**

Back to the top