diff options
author | Michael Rennie | 2011-01-06 16:24:39 +0000 |
---|---|---|
committer | Michael Rennie | 2011-01-06 16:24:39 +0000 |
commit | 5faf5e2aab28f9811f6576a934362379be164995 (patch) | |
tree | 928d6c7499251c7e4cfc66d49093a9888c412ce5 /org.eclipse.debug.core | |
parent | de52b12901da2f2a76471d988158fbf1895f7176 (diff) | |
download | eclipse.platform.debug-5faf5e2aab28f9811f6576a934362379be164995.tar.gz eclipse.platform.debug-5faf5e2aab28f9811f6576a934362379be164995.tar.xz eclipse.platform.debug-5faf5e2aab28f9811f6576a934362379be164995.zip |
Bug 332410 - StringIndexOutOfBoundsException when loading launch configurations at startup
Diffstat (limited to 'org.eclipse.debug.core')
-rw-r--r-- | org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java | 7 |
1 files changed, 4 insertions, 3 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 3f6e6ae38..11344dde6 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, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 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 @@ -181,8 +181,9 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig * @since 3.5 */ protected static String getSimpleName(String fileName) { - if (fileName.endsWith(ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION)) { - return fileName.substring(0, fileName.length() - ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.length() - 1); + IPath path = new Path(fileName); + if(ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.equals(path.getFileExtension())) { + return path.removeFileExtension().toString(); } return fileName; } |