diff options
author | Mikhail Khodjaiants | 2007-03-29 16:00:49 +0000 |
---|---|---|
committer | Mikhail Khodjaiants | 2007-03-29 16:00:49 +0000 |
commit | 7b9a5bdfa384bc3a610ce382759aa3784d0646d0 (patch) | |
tree | 98a5affd9e2d967293caf81bfaa1f4f661c7c357 /debug/org.eclipse.cdt.debug.core | |
parent | b6ed78d39974f57e470f6c41ba301d5d0af57cf4 (diff) | |
download | org.eclipse.cdt-7b9a5bdfa384bc3a610ce382759aa3784d0646d0.tar.gz org.eclipse.cdt-7b9a5bdfa384bc3a610ce382759aa3784d0646d0.tar.xz org.eclipse.cdt-7b9a5bdfa384bc3a610ce382759aa3784d0646d0.zip |
Bug 179425: two periods ".." appear at end of some CDT "Target request failed: ..." error messages.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.core')
-rw-r--r-- | debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugElement.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugElement.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugElement.java index 24ce8776a7b..4696ea2777b 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugElement.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugElement.java @@ -7,6 +7,7 @@ * * Contributors: * QNX Software Systems - Initial API and implementation + * Ling Wang, Nokia - Bug 179425 *******************************************************************************/ package org.eclipse.cdt.debug.internal.core.model; @@ -237,7 +238,12 @@ abstract public class CDebugElement extends PlatformObject implements ICDebugEle * @throws DebugException The exception with a status code of <code>TARGET_REQUEST_FAILED</code> */ public static void targetRequestFailed( String message, CDIException e ) throws DebugException { - requestFailed( MessageFormat.format( "Target request failed: {0}.", new String[]{ message } ), e, DebugException.TARGET_REQUEST_FAILED ); //$NON-NLS-1$ + String format = "Target request failed: {0}"; //$NON-NLS-1$ + // Append a period only when incoming message does not end with one. + if ( !message.endsWith( "." ) ) //$NON-NLS-1$ + format += "."; //$NON-NLS-1$ + + requestFailed( MessageFormat.format( format, new String[] { message } ), e, DebugException.TARGET_REQUEST_FAILED ); } /** @@ -260,7 +266,12 @@ abstract public class CDebugElement extends PlatformObject implements ICDebugEle * @throws DebugException The exception with a status code of <code>TARGET_REQUEST_FAILED</code> */ public static void targetRequestFailed( String message, Throwable e ) throws DebugException { - throwDebugException( MessageFormat.format( "Target request failed: {0}.", new String[]{ message } ), DebugException.TARGET_REQUEST_FAILED, e ); //$NON-NLS-1$ + String format = "Target request failed: {0}"; //$NON-NLS-1$ + // Append a period only when incoming message does not end with one. + if ( !message.endsWith( "." ) ) //$NON-NLS-1$ + format += "."; //$NON-NLS-1$ + + throwDebugException( MessageFormat.format( format, new String[]{ message } ), DebugException.TARGET_REQUEST_FAILED, e ); } /** |