Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjszursze2002-04-08 21:04:37 +0000
committerjszursze2002-04-08 21:04:37 +0000
commit166fe56085551ea38838101ceb3f06a3952cc038 (patch)
treeb9b47675fcba51b3455769b08a3748175bb25a97
parent603584546aef1f0445e55eb3762d2f82e0f426da (diff)
downloadeclipse.platform.debug-166fe56085551ea38838101ceb3f06a3952cc038.tar.gz
eclipse.platform.debug-166fe56085551ea38838101ceb3f06a3952cc038.tar.xz
eclipse.platform.debug-166fe56085551ea38838101ceb3f06a3952cc038.zip
fix for #12981
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
index 906dea3bf..900e46fac 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
@@ -662,13 +662,13 @@ public class LaunchConfigurationDialog extends TitleAreaDialog
}
/**
- * Verify that there are no name collisions.
+ * Verify that the launch configuration name is valid.
*/
protected void verifyName() throws CoreException {
- String currentName = getNameTextWidget().getText();
+ String currentName = getNameTextWidget().getText().trim();
// If there is no name, complain
- if (currentName.trim().length() < 1) {
+ if (currentName.length() < 1) {
throw new CoreException(new Status(IStatus.ERROR,
DebugUIPlugin.getDefault().getDescriptor().getUniqueIdentifier(),
0,
@@ -679,7 +679,17 @@ public class LaunchConfigurationDialog extends TitleAreaDialog
// If the name hasn't changed from the last saved name, do nothing
if (currentName.equals(getLastSavedName())) {
return;
- }
+ }
+
+ // See if name contains any 'illegal' characters
+ IStatus status = ResourcesPlugin.getWorkspace().validateName(currentName, IResource.FILE);
+ if (status.getCode() != IStatus.OK) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ DebugUIPlugin.getDefault().getDescriptor().getUniqueIdentifier(),
+ 0,
+ status.getMessage(),
+ null));
+ }
// Otherwise, if there's already a config with the same name, complain
if (getLaunchManager().isExistingLaunchConfigurationName(currentName)) {

Back to the top