From 7b9a5bdfa384bc3a610ce382759aa3784d0646d0 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Thu, 29 Mar 2007 16:00:49 +0000 Subject: [PATCH] Bug 179425: two periods ".." appear at end of some CDT "Target request failed: ..." error messages. --- .../debug/internal/core/model/CDebugElement.java | 15 +++++++++++++-- 1 file 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 TARGET_REQUEST_FAILED */ 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 TARGET_REQUEST_FAILED */ 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 ); } /**