1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 02:06:01 +02:00

Applied string externalization patch from Tanya Wolff.

This commit is contained in:
Mikhail Khodjaiants 2004-03-10 19:41:10 +00:00
parent 9b0029a7dd
commit f4766d0e55
30 changed files with 2005 additions and 1887 deletions

View file

@ -1,3 +1,13 @@
2004-03-10 Tanya Wolff
Externalized strings and marked non-translatable strings
Packages affected:
org.eclipse.cdt.debug.core
org.eclipse.cdt.debug.core.cdi
org.eclipse.cdt.debug.internal.core
org.eclipse.cdt.debug.internal.core.breakpoints
org.eclipse.cdt.debug.internal.core.model
org.eclipse.cdt.debug.internal.core.sourcelookup
2004-03-09 David Inglis 2004-03-09 David Inglis
Added PLATFORM_NATIVE const to ICDebugCongifuration Added PLATFORM_NATIVE const to ICDebugCongifuration
ICDebugConfiguration.java ICDebugConfiguration.java

View file

@ -6,7 +6,10 @@
package org.eclipse.cdt.debug.core; package org.eclipse.cdt.debug.core;
import java.text.MessageFormat;
import java.util.HashMap; import java.util.HashMap;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
import org.eclipse.cdt.debug.internal.core.DebugConfiguration; import org.eclipse.cdt.debug.internal.core.DebugConfiguration;
@ -26,6 +29,7 @@ import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IBreakpointManager; import org.eclipse.debug.core.IBreakpointManager;
import org.eclipse.debug.core.model.IBreakpoint; import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
/** /**
* The main plugin class to be used in the desktop. * The main plugin class to be used in the desktop.
@ -39,6 +43,7 @@ public class CDebugCorePlugin extends Plugin
//The shared instance. //The shared instance.
private static CDebugCorePlugin plugin; private static CDebugCorePlugin plugin;
private static ResourceBundle fgResourceBundle;
private HashMap fDebugConfigurations; private HashMap fDebugConfigurations;
@ -46,6 +51,13 @@ public class CDebugCorePlugin extends Plugin
private SessionManager fSessionManager = null; private SessionManager fSessionManager = null;
static {
try {
fgResourceBundle = ResourceBundle.getBundle("org.eclipse.cdt.debug.core.CDebugCorePluginResources"); //$NON-NLS-1$
} catch (MissingResourceException x) {
fgResourceBundle = null;
}
}
/** /**
* The constructor. * The constructor.
*/ */
@ -92,6 +104,27 @@ public class CDebugCorePlugin extends Plugin
return getDefault().getDescriptor().getUniqueIdentifier(); return getDefault().getDescriptor().getUniqueIdentifier();
} }
public static String getResourceString(String key) {
try {
return fgResourceBundle.getString(key);
} catch (MissingResourceException e) {
return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
} catch (NullPointerException e) {
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
public static String getFormattedString(String key, String arg) {
return MessageFormat.format(getResourceString(key), new String[] { arg });
}
public static String getFormattedString(String key, String[] args) {
return MessageFormat.format(getResourceString(key), args);
}
public static ResourceBundle getResourceBundle() {
return fgResourceBundle;
}
/** /**
* Logs the specified throwable with this plug-in's log. * Logs the specified throwable with this plug-in's log.
* *
@ -140,7 +173,7 @@ public class CDebugCorePlugin extends Plugin
private void initializeDebugConfiguration() { private void initializeDebugConfiguration() {
IPluginDescriptor descriptor= getDefault().getDescriptor(); IPluginDescriptor descriptor= getDefault().getDescriptor();
IExtensionPoint extensionPoint= descriptor.getExtensionPoint("CDebugger"); IExtensionPoint extensionPoint= descriptor.getExtensionPoint("CDebugger"); //$NON-NLS-1$
IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
fDebugConfigurations = new HashMap(infos.length); fDebugConfigurations = new HashMap(infos.length);
for (int i= 0; i < infos.length; i++) { for (int i= 0; i < infos.length; i++) {
@ -163,7 +196,7 @@ public class CDebugCorePlugin extends Plugin
} }
ICDebugConfiguration dbgCfg = (ICDebugConfiguration) fDebugConfigurations.get(id); ICDebugConfiguration dbgCfg = (ICDebugConfiguration) fDebugConfigurations.get(id);
if ( dbgCfg == null ) { if ( dbgCfg == null ) {
IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), 100, "No such debugger", null); IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), 100, CDebugCorePlugin.getResourceString("core.CDebugCorePlugin.No_such_debugger"), null); //$NON-NLS-1$
throw new CoreException(status); throw new CoreException(status);
} }
return dbgCfg; return dbgCfg;

View file

@ -0,0 +1,46 @@
core.CDebugCorePlugin.No_such_debugger=No such debugger
core.CDebugCorePlugin.Unable_to_set_temp_brkpt=Unable to set temporary breakpoint in main.\nReason: {0}\nContinue?
internal.core.sourcelookup.CSourceLocator.Unable_to_create_memento=Unable to create memento for C/C++ source locator.
internal.core.sourcelookup.CSourceLocator.Unable_to_restore_src_locator=Unable to restore C/C++ source locator - invalid format.
internal.core.sourcelookup.CSourceLocator.Exception_initializing_src_locator=Exception occurred initializing source locator.
internal.core.sourcelookup.CSourceLocator.Error_initializing_src_location=Error initializing directory source location.
internal.core.sourcelookup.CProjectSourceLocation.Unable_to_initialize_src_location_no_project_name=Unable to initialize source location - missing project name
internal.core.sourcelookup.CProjectSourceLocation.Exception_intializing_src_location=Exception occurred initializing source location.
internal.core.sourcelookup.CProjectSourceLocation.Unable_to_create_memento_for_src_location=Unable to create memento for C/C++ project source location {0}.
internal.core.sourcelookup.CDirectorySourceLocation.Unable_to_create_memento=Unable to create memento for C/C++ directory source location {0}
internal.core.sourcelookup.CDirectorySourceLocation.Unable_to_initialize_src_location_no_dir=Unable to initialize source location - missing directory path
internal.core.sourcelookup.CDirectorySourceLocation.Unable_to_initialize_src_location_invalid_dir=Unable to initialize source location - invalid directory path {0}
internal.core.sourcelookup.CDirectorySourceLocation.Exception_initializing_src_location=Exception occurred initializing source location.
internal.core.CBreakpointManager.Set_breakpoint_failed=Set breakpoint failed. Reason:
internal.core.CBreakpointManager.Delete_breakpoint_failed=Delete breakpoint failed. Reason:
internal.core.CBreakpointManager.Change_brkpt_properties_failed=Change breakpoint properties failed. Reason:
internal.core.breakpoints.CLineBreakpoint.Line_breakpoint=Line breakpoint:
internal.core.breakpoints.CLineBreakpoint.line=line:
internal.core.breakpoints.CBreakpoint.ignore_count=ignore count:
internal.core.breakpoints.CWatchpoint.Write_watchpoint=Write watchpoint
internal.core.breakpoints.CWatchpoint.Read_watchpoint=Read watchpoint
internal.core.breakpoints.CWatchpoint.Access_watchpoint=Access watchpoint
internal.core.breakpoints.CWatchpoint.Watchpoint=Watchpoint:
internal.core.breakpoints.CWatchpoint.at=at
internal.core.breakpoints.CAddressBreakpoint.Address_breakpoint=Address breakpoint:
internal.core.breakpoints.CAddressBreakpoint.address=\ [address:
internal.core.breakpoints.CFunctionBreakpoint.Function_breakpoint=Function breakpoint:
internal.core.breakpoints.CFunctionBreakpoint.function=function:
internal.core.breakpoints.CBreakpoint.if=\ if
internal.core.model.CStackFrame.function_at_file={0} at {1}:
internal.core.model.CArrayPartition.Type_not_available=Type is not available.
internal.core.model.CArrayPartition.Qualified_name_not_available=Qualified name is not available.
internal.core.model.CVariable.Value_modification_unsupported=Variable does not support value modification.
internal.core.model.CVariable.Qualified_name_unavailable=Qualified name is not available.
internal.core.model.CVariable.Type_unavailable=Type is not available.
internal.core.model.CVariable.not_available=not available: {0}
internal.core.model.CValue.Not_available=not available:
internal.core.model.CModificationVariable.Unable_to_set_value=Unable to set value.
internal.core.model.CThread.Stack_not_available=Stack is not available:
internal.core.model.CDebugTarget.Disconnect_session_unsupported=Session does not support \'disconnect\'
internal.core.model.CDebugTarget.Execution_suspended_because_of_error=The execution of program is suspended because of error.
internal.core.model.CDebugElement.Target_request_failed=Target request failed:
internal.core.DisassemblyStorage.disassembly=disassembly

View file

@ -659,14 +659,15 @@ public class CDebugModel
private static void stopInMain( CDebugTarget target ) throws DebugException private static void stopInMain( CDebugTarget target ) throws DebugException
{ {
ICDILocation location = target.getCDISession().getBreakpointManager().createLocation( "", "main", 0 ); ICDILocation location = target.getCDISession().getBreakpointManager().createLocation( "", "main", 0 ); //$NON-NLS-1$ //$NON-NLS-2$
try try
{ {
target.setInternalTemporaryBreakpoint( location ); target.setInternalTemporaryBreakpoint( location );
} }
catch( DebugException e ) catch( DebugException e )
{ {
String message = MessageFormat.format( "Unable to set temporary breakpoint in main.\nReason: {0}\nContinue?", new String[] { e.getStatus().getMessage() } ); //String message = MessageFormat.format( "Unable to set temporary breakpoint in main.\nReason: {0}\nContinue?", new String[] { e.getStatus().getMessage() } );
String message = CDebugCorePlugin.getFormattedString("core.CDebugCorePlugin.Unable_to_set_temp_brkpt", new String[] { e.getStatus().getMessage() } ); //$NON-NLS-1$
IStatus newStatus = new Status( IStatus.WARNING, IStatus newStatus = new Status( IStatus.WARNING,
e.getStatus().getPlugin(), e.getStatus().getPlugin(),
ICDebugInternalConstants.STATUS_CODE_QUESTION, ICDebugInternalConstants.STATUS_CODE_QUESTION,

View file

@ -93,7 +93,7 @@ public class CDebugUtils
{ {
String addressString = Long.toHexString( address ); String addressString = Long.toHexString( address );
StringBuffer sb = new StringBuffer( 10 ); StringBuffer sb = new StringBuffer( 10 );
sb.append( "0x" ); sb.append( "0x" ); //$NON-NLS-1$
for ( int i = 0; i < 8 - addressString.length(); ++i ) for ( int i = 0; i < 8 - addressString.length(); ++i )
{ {
sb.append( '0' ); sb.append( '0' );
@ -276,7 +276,7 @@ public class CDebugUtils
OutputFormat format = new OutputFormat(); OutputFormat format = new OutputFormat();
format.setIndenting( true ); format.setIndenting( true );
format.setLineSeparator( lineSeparator ); //$NON-NLS-1$ format.setLineSeparator( lineSeparator ); //$NON-NLS-1$
Serializer serializer = SerializerFactory.getSerializerFactory( Method.XML ).makeSerializer( new OutputStreamWriter( s, "UTF8" ), format ); Serializer serializer = SerializerFactory.getSerializerFactory( Method.XML ).makeSerializer( new OutputStreamWriter( s, "UTF8" ), format ); //$NON-NLS-1$
serializer.asDOMSerializer().serialize( doc ); serializer.asDOMSerializer().serialize( doc );
return s.toString( "UTF8" ); //$NON-NLS-1$ return s.toString( "UTF8" ); //$NON-NLS-1$
} }
@ -294,7 +294,7 @@ public class CDebugUtils
OutputFormat format = new OutputFormat(); OutputFormat format = new OutputFormat();
format.setIndenting( true ); format.setIndenting( true );
format.setLineSeparator( System.getProperty( "line.separator" ) ); //$NON-NLS-1$ format.setLineSeparator( System.getProperty( "line.separator" ) ); //$NON-NLS-1$
Serializer serializer = SerializerFactory.getSerializerFactory( Method.XML ).makeSerializer( new OutputStreamWriter( s, "UTF8" ), format ); Serializer serializer = SerializerFactory.getSerializerFactory( Method.XML ).makeSerializer( new OutputStreamWriter( s, "UTF8" ), format ); //$NON-NLS-1$
serializer.asDOMSerializer().serialize( doc ); serializer.asDOMSerializer().serialize( doc );
return s.toString( "UTF8" ); //$NON-NLS-1$ return s.toString( "UTF8" ); //$NON-NLS-1$
} }
@ -316,13 +316,13 @@ public class CDebugUtils
{ {
String functionName = function.getElementName(); String functionName = function.getElementName();
StringBuffer name = new StringBuffer( functionName ); StringBuffer name = new StringBuffer( functionName );
if ( functionName.indexOf( "::" ) != -1 ) if ( functionName.indexOf( "::" ) != -1 ) //$NON-NLS-1$
{ {
String[] params = function.getParameterTypes(); String[] params = function.getParameterTypes();
name.append( '(' ); name.append( '(' );
if ( params.length == 0 ) if ( params.length == 0 )
{ {
name.append( "void" ); name.append( "void" ); //$NON-NLS-1$
} }
else else
{ {

View file

@ -1,4 +1,5 @@
package org.eclipse.cdt.debug.core; package org.eclipse.cdt.debug.core;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
/* /*
* (c) Copyright QNX Software System 2002. * (c) Copyright QNX Software System 2002.
@ -8,12 +9,12 @@ package org.eclipse.cdt.debug.core;
public interface ICDTLaunchConfigurationConstants { public interface ICDTLaunchConfigurationConstants {
public static final String CDT_LAUNCH_ID = "org.eclipse.cdt.launch"; public static final String CDT_LAUNCH_ID = "org.eclipse.cdt.launch"; //$NON-NLS-1$
/** /**
* This is the launch type id. * This is the launch type id.
*/ */
public static final String ID_LAUNCH_C_APP = "org.eclipse.cdt.launch.localCLaunch"; public static final String ID_LAUNCH_C_APP = "org.eclipse.cdt.launch.localCLaunch"; //$NON-NLS-1$
/** /**
* Launch configuration attribute key. The value is a name of * Launch configuration attribute key. The value is a name of
@ -105,19 +106,21 @@ public interface ICDTLaunchConfigurationConstants {
* Launch configuration attribute value. The key is ATTR_DEBUGGER_START_MODE. * Launch configuration attribute value. The key is ATTR_DEBUGGER_START_MODE.
* Startup debugger running the program. * Startup debugger running the program.
*/ */
public static String DEBUGGER_MODE_RUN = "run"; public static String DEBUGGER_MODE_RUN = "run"; //$NON-NLS-1$
/** /**
* Launch configuration attribute value. The key is ATTR_DEBUGGER_START_MODE. * Launch configuration attribute value. The key is ATTR_DEBUGGER_START_MODE.
* Startup debugger and attach to running process. * Startup debugger and attach to running process.
*/ */
public static String DEBUGGER_MODE_ATTACH = "attach"; public static String DEBUGGER_MODE_ATTACH = "attach"; //$NON-NLS-1$
/** /**
* Launch configuration attribute value. The key is ATTR_DEBUGGER_START_MODE. * Launch configuration attribute value. The key is ATTR_DEBUGGER_START_MODE.
* Startup debugger to view a core file. * Startup debugger to view a core file.
*/ */
public static String DEBUGGER_MODE_CORE = "core"; public static String DEBUGGER_MODE_CORE = "core"; //$NON-NLS-1$
/** /**
* Status code indicating that the Eclipse runtime does not support * Status code indicating that the Eclipse runtime does not support

View file

@ -14,7 +14,7 @@ package org.eclipse.cdt.debug.core.cdi;
*/ */
public class CDIException extends Exception { public class CDIException extends Exception {
String details = ""; String details = ""; //$NON-NLS-1$
public CDIException() { public CDIException() {
super(); super();

View file

@ -333,15 +333,15 @@ public class CBreakpointManager implements ICBreakpointManager, ICDIEventListene
} }
catch( CoreException e ) catch( CoreException e )
{ {
requestFailed( "Set breakpoint failed. Reason: " + e.getMessage(), e ); requestFailed( CDebugCorePlugin.getResourceString("internal.core.CBreakpointManager.Set_breakpoint_failed") + e.getMessage(), e ); //$NON-NLS-1$
} }
catch( NumberFormatException e ) catch( NumberFormatException e )
{ {
requestFailed( "Set breakpoint failed. Reason: " + e.getMessage(), e ); requestFailed( CDebugCorePlugin.getResourceString("internal.core.CBreakpointManager.Set_breakpoint_failed") + e.getMessage(), e ); //$NON-NLS-1$
} }
catch( CDIException e ) catch( CDIException e )
{ {
targetRequestFailed( "Set breakpoint failed. Reason: " + e.getMessage(), e ); targetRequestFailed( CDebugCorePlugin.getResourceString("internal.core.CBreakpointManager.Set_breakpoint_failed") + e.getMessage(), e ); //$NON-NLS-1$
} }
} }
@ -375,7 +375,7 @@ public class CBreakpointManager implements ICBreakpointManager, ICDIEventListene
} }
catch( CDIException e ) catch( CDIException e )
{ {
targetRequestFailed( "Delete breakpoint failed. Reason: " + e.getMessage(), e ); targetRequestFailed( CDebugCorePlugin.getResourceString("internal.core.CBreakpointManager.Delete_breakpoint_failed") + e.getMessage(), e ); //$NON-NLS-1$
} }
} }
} }
@ -411,7 +411,7 @@ public class CBreakpointManager implements ICBreakpointManager, ICDIEventListene
int ignoreCount = breakpoint.getIgnoreCount(); int ignoreCount = breakpoint.getIgnoreCount();
int oldIgnoreCount = delta.getAttribute( ICBreakpoint.IGNORE_COUNT, 0 ); int oldIgnoreCount = delta.getAttribute( ICBreakpoint.IGNORE_COUNT, 0 );
String condition = breakpoint.getCondition(); String condition = breakpoint.getCondition();
String oldCondition = delta.getAttribute( ICBreakpoint.CONDITION, "" ); String oldCondition = delta.getAttribute( ICBreakpoint.CONDITION, "" ); //$NON-NLS-1$
if ( enabled != oldEnabled ) if ( enabled != oldEnabled )
{ {
cdiBreakpoint.setEnabled( enabled ); cdiBreakpoint.setEnabled( enabled );
@ -424,11 +424,11 @@ public class CBreakpointManager implements ICBreakpointManager, ICDIEventListene
} }
catch( CoreException e ) catch( CoreException e )
{ {
requestFailed( "Change breakpoint properties failed. Reason: " + e.getMessage(), e ); requestFailed( CDebugCorePlugin.getResourceString("internal.core.CBreakpointManager.Change_brkpt_properties_failed") + e.getMessage(), e ); //$NON-NLS-1$
} }
catch( CDIException e ) catch( CDIException e )
{ {
targetRequestFailed( "Change breakpoint properties failed. Reason: " + e.getMessage(), e ); targetRequestFailed( CDebugCorePlugin.getResourceString("internal.core.CBreakpointManager.Change_brkpt_properties_failed") + e.getMessage(), e ); //$NON-NLS-1$
} }
} }
@ -631,7 +631,7 @@ public class CBreakpointManager implements ICBreakpointManager, ICDIEventListene
{ {
ICDIBreakpointManager bm = getCDIBreakpointManager(); ICDIBreakpointManager bm = getCDIBreakpointManager();
String function = breakpoint.getFunction(); String function = breakpoint.getFunction();
String fileName = ( function != null && function.indexOf( "::" ) == -1 ) ? breakpoint.getFileName() : null; String fileName = ( function != null && function.indexOf( "::" ) == -1 ) ? breakpoint.getFileName() : null; //$NON-NLS-1$
ICDILocation location = bm.createLocation( fileName, function, -1 ); ICDILocation location = bm.createLocation( fileName, function, -1 );
ICDIBreakpoint cdiBreakpoint = bm.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true ); ICDIBreakpoint cdiBreakpoint = bm.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true );
getBreakpointMap().put( breakpoint, cdiBreakpoint ); getBreakpointMap().put( breakpoint, cdiBreakpoint );

View file

@ -124,7 +124,7 @@ public class CRegisterManager extends CUpdateManager implements ICRegisterManage
} }
if ( regObjects != null ) if ( regObjects != null )
{ {
fRegisterGroups.add( new CRegisterGroup( getDebugTarget(), "Main", regObjects ) ); fRegisterGroups.add( new CRegisterGroup( getDebugTarget(), "Main", regObjects ) ); //$NON-NLS-1$
} }
} }

View file

@ -13,6 +13,7 @@ import org.eclipse.cdt.debug.core.ICDebugger;
import org.eclipse.core.boot.BootLoader; import org.eclipse.core.boot.BootLoader;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
public class DebugConfiguration implements ICDebugConfiguration { public class DebugConfiguration implements ICDebugConfiguration {
/** /**
@ -21,7 +22,7 @@ public class DebugConfiguration implements ICDebugConfiguration {
private IConfigurationElement fElement; private IConfigurationElement fElement;
private HashSet fModes; private HashSet fModes;
private HashSet fCPUs; private HashSet fCPUs;
public static final String NATIVE = "native"; public static final String NATIVE = "native"; //$NON-NLS-1$
public DebugConfiguration(IConfigurationElement element) { public DebugConfiguration(IConfigurationElement element) {
fElement = element; fElement = element;
@ -32,12 +33,12 @@ public class DebugConfiguration implements ICDebugConfiguration {
} }
public ICDebugger getDebugger() throws CoreException { public ICDebugger getDebugger() throws CoreException {
return (ICDebugger) getConfigurationElement().createExecutableExtension("class"); return (ICDebugger) getConfigurationElement().createExecutableExtension("class"); //$NON-NLS-1$
} }
public String getName() { public String getName() {
String name = getConfigurationElement().getAttribute("name"); //$NON-NLS-1$ String name = getConfigurationElement().getAttribute("name"); //$NON-NLS-1$
return name != null ? name : ""; return name != null ? name : ""; //$NON-NLS-1$
} }
public String getID() { public String getID() {
@ -45,7 +46,7 @@ public class DebugConfiguration implements ICDebugConfiguration {
} }
public String getPlatform() { public String getPlatform() {
String platform = getConfigurationElement().getAttribute("platform"); String platform = getConfigurationElement().getAttribute("platform"); //$NON-NLS-1$
if (platform == null) { if (platform == null) {
return NATIVE; return NATIVE;
} }

View file

@ -20,6 +20,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IDebugTarget; import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
/** /**
* Enter type comment. * Enter type comment.
@ -110,7 +111,8 @@ public class DisassemblyStorage implements IDisassemblyStorage
{ {
// ignore // ignore
} }
return "disassembly"; return CDebugCorePlugin.getResourceString("internal.core.DisassemblyStorage.disassembly"); //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -206,7 +208,7 @@ public class DisassemblyStorage implements IDisassemblyStorage
sb.append( '+' ); sb.append( '+' );
sb.append( instruction.getOffset() ); sb.append( instruction.getOffset() );
} }
sb.append( ">:" ); sb.append( ">:" ); //$NON-NLS-1$
sb.append( spaces, 0, instrPosition - sb.length() ); sb.append( spaces, 0, instrPosition - sb.length() );
} }
sb.append( instruction.getOpcode() ); sb.append( instruction.getOpcode() );

View file

@ -13,6 +13,7 @@ import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
/** /**
* *
@ -92,7 +93,7 @@ public class CAddressBreakpoint extends CBreakpoint implements ICAddressBreakpoi
*/ */
protected String getMarkerMessage() throws CoreException protected String getMarkerMessage() throws CoreException
{ {
StringBuffer sb = new StringBuffer( "Address breakpoint:" ); StringBuffer sb = new StringBuffer( CDebugCorePlugin.getResourceString("internal.core.breakpoints.CAddressBreakpoint.Address_breakpoint") ); //$NON-NLS-1$
String name = ensureMarker().getResource().getName(); String name = ensureMarker().getResource().getName();
if ( name != null && name.length() > 0 ) if ( name != null && name.length() > 0 )
{ {
@ -102,7 +103,7 @@ public class CAddressBreakpoint extends CBreakpoint implements ICAddressBreakpoi
try try
{ {
long address = Long.parseLong( getAddress() ); long address = Long.parseLong( getAddress() );
sb.append( " [address: " ); sb.append( CDebugCorePlugin.getResourceString("internal.core.breakpoints.CAddressBreakpoint.address") ); //$NON-NLS-1$
sb.append( CDebugUtils.toHexAddressString( address ) ); sb.append( CDebugUtils.toHexAddressString( address ) );
sb.append( ']' ); sb.append( ']' );
} }

View file

@ -21,6 +21,7 @@ import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IDebugEventSetListener; import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.model.Breakpoint; import org.eclipse.debug.core.model.Breakpoint;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
/** /**
* *
@ -107,7 +108,7 @@ public abstract class CBreakpoint extends Breakpoint
*/ */
public String getCondition() throws CoreException public String getCondition() throws CoreException
{ {
return ensureMarker().getAttribute( CONDITION, "" ); return ensureMarker().getAttribute( CONDITION, "" ); //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -265,8 +266,8 @@ public abstract class CBreakpoint extends Breakpoint
int ignoreCount = getIgnoreCount(); int ignoreCount = getIgnoreCount();
if ( ignoreCount > 0 ) if ( ignoreCount > 0 )
{ {
sb.append( " [" ); sb.append( " [" ); //$NON-NLS-1$
sb.append( "ignore count:" ); sb.append( CDebugCorePlugin.getResourceString("internal.core.breakpoints.CBreakpoint.ignore_count") ); //$NON-NLS-1$
sb.append( ' ' ); sb.append( ' ' );
sb.append( ignoreCount ); sb.append( ignoreCount );
sb.append( ']' ); sb.append( ']' );
@ -274,7 +275,7 @@ public abstract class CBreakpoint extends Breakpoint
String condition = getCondition(); String condition = getCondition();
if ( condition != null && condition.length() > 0 ) if ( condition != null && condition.length() > 0 )
{ {
sb.append( " if " ); sb.append( CDebugCorePlugin.getResourceString("internal.core.breakpoints.CBreakpoint.if") ); //$NON-NLS-1$
sb.append( condition ); sb.append( condition );
} }
return sb.toString(); return sb.toString();

View file

@ -13,6 +13,7 @@ import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
/** /**
* *
@ -112,7 +113,7 @@ public class CFunctionBreakpoint extends CBreakpoint implements ICFunctionBreakp
*/ */
protected String getMarkerMessage() throws CoreException protected String getMarkerMessage() throws CoreException
{ {
StringBuffer sb = new StringBuffer( "Function breakpoint:" ); StringBuffer sb = new StringBuffer( CDebugCorePlugin.getResourceString("internal.core.breakpoints.CFunctionBreakpoint.Function_breakpoint") ); //$NON-NLS-1$
String name = ensureMarker().getResource().getName(); String name = ensureMarker().getResource().getName();
if ( name != null && name.length() > 0 ) if ( name != null && name.length() > 0 )
{ {
@ -122,8 +123,8 @@ public class CFunctionBreakpoint extends CBreakpoint implements ICFunctionBreakp
String function = getFunction(); String function = getFunction();
if ( function != null && function.trim().length() > 0 ) if ( function != null && function.trim().length() > 0 )
{ {
sb.append( " [" ); sb.append( " [" ); //$NON-NLS-1$
sb.append( "function:" ); sb.append( CDebugCorePlugin.getResourceString("internal.core.breakpoints.CFunctionBreakpoint.function") ); //$NON-NLS-1$
sb.append( ' ' ); sb.append( ' ' );
sb.append( function.trim() ); sb.append( function.trim() );
sb.append( ']' ); sb.append( ']' );

View file

@ -12,6 +12,7 @@ import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
/** /**
* *
@ -75,7 +76,7 @@ public class CLineBreakpoint extends CBreakpoint implements ICLineBreakpoint
*/ */
protected String getMarkerMessage() throws CoreException protected String getMarkerMessage() throws CoreException
{ {
StringBuffer sb = new StringBuffer( "Line breakpoint:" ); StringBuffer sb = new StringBuffer( CDebugCorePlugin.getResourceString("internal.core.breakpoints.CLineBreakpoint.Line_breakpoint") ); //$NON-NLS-1$
String fileName = ensureMarker().getResource().getName(); String fileName = ensureMarker().getResource().getName();
if ( fileName != null && fileName.length() > 0 ) if ( fileName != null && fileName.length() > 0 )
{ {
@ -85,8 +86,8 @@ public class CLineBreakpoint extends CBreakpoint implements ICLineBreakpoint
int lineNumber = getLineNumber(); int lineNumber = getLineNumber();
if ( lineNumber > 0 ) if ( lineNumber > 0 )
{ {
sb.append( " [" ); sb.append( " [" ); //$NON-NLS-1$
sb.append( "line:" ); sb.append( CDebugCorePlugin.getResourceString("internal.core.breakpoints.CLineBreakpoint.line") ); //$NON-NLS-1$
sb.append( ' ' ); sb.append( ' ' );
sb.append( lineNumber ); sb.append( lineNumber );
sb.append( ']' ); sb.append( ']' );

View file

@ -7,6 +7,7 @@ package org.eclipse.cdt.debug.internal.core.breakpoints;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.model.ICWatchpoint; import org.eclipse.cdt.debug.core.model.ICWatchpoint;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@ -58,7 +59,7 @@ public class CWatchpoint extends CBreakpoint implements ICWatchpoint
*/ */
public String getExpression() throws CoreException public String getExpression() throws CoreException
{ {
return ensureMarker().getAttribute( EXPRESSION, "" ); return ensureMarker().getAttribute( EXPRESSION, "" ); //$NON-NLS-1$
} }
/** /**
@ -76,12 +77,14 @@ public class CWatchpoint extends CBreakpoint implements ICWatchpoint
{ {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
if ( isWriteType() && !isReadType() ) if ( isWriteType() && !isReadType() )
sb.append( "Write " ); sb.append( CDebugCorePlugin.getResourceString("internal.core.breakpoints.CWatchpoint.Write_watchpoint") ); //$NON-NLS-1$
else if ( !isWriteType() && isReadType() ) else if ( !isWriteType() && isReadType() )
sb.append( "Read " ); sb.append( CDebugCorePlugin.getResourceString("internal.core.breakpoints.CWatchpoint.Read_watchpoint") ); //$NON-NLS-1$
else if ( isWriteType() && isReadType() ) else if ( isWriteType() && isReadType() )
sb.append( "Access " ); sb.append( CDebugCorePlugin.getResourceString("internal.core.breakpoints.CWatchpoint.Access_watchpoint") ); //$NON-NLS-1$
sb.append( "watchpoint: " ); else
sb.append( CDebugCorePlugin.getResourceString("internal.core.breakpoints.CWatchpoint.Watchpoint") ); //$NON-NLS-1$
sb.append( ' ' );
String fileName = ensureMarker().getResource().getName(); String fileName = ensureMarker().getResource().getName();
if ( fileName != null && fileName.length() > 0 ) if ( fileName != null && fileName.length() > 0 )
{ {
@ -91,7 +94,9 @@ public class CWatchpoint extends CBreakpoint implements ICWatchpoint
String expression = getExpression(); String expression = getExpression();
if ( expression != null && expression.length() > 0 ) if ( expression != null && expression.length() > 0 )
{ {
sb.append( " at \'" ); sb.append( " " ); //$NON-NLS-1$
sb.append( CDebugCorePlugin.getResourceString("internal.core.breakpoints.CWatchpoint.at") ); //$NON-NLS-1$
sb.append( " \'" ); //$NON-NLS-1$
sb.append( expression ); sb.append( expression );
sb.append( '\'' ); sb.append( '\'' );
} }

View file

@ -18,6 +18,7 @@ import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayValue;
import org.eclipse.cdt.debug.core.model.ICType; import org.eclipse.cdt.debug.core.model.ICType;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IValue; import org.eclipse.debug.core.model.IValue;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
/** /**
* *
@ -69,7 +70,7 @@ public class CArrayPartition extends CVariable
StringBuffer name = new StringBuffer(); StringBuffer name = new StringBuffer();
name.append( '[' ); name.append( '[' );
name.append( fStart ); name.append( fStart );
name.append( ".." ); name.append( ".." ); //$NON-NLS-1$
name.append( fEnd ); name.append( fEnd );
name.append( ']' ); name.append( ']' );
return name.toString(); return name.toString();
@ -177,7 +178,7 @@ public class CArrayPartition extends CVariable
} }
catch (CDIException e) catch (CDIException e)
{ {
requestFailed( "Type is not available.", e ); requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CArrayPartition.Type_not_available"), e ); //$NON-NLS-1$
} }
} }
return fType; return fType;
@ -207,7 +208,7 @@ public class CArrayPartition extends CVariable
} }
catch( CDIException e ) catch( CDIException e )
{ {
requestFailed( "Qualified name is not available.", e ); requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CArrayPartition.Qualified_name_not_available"), e ); //$NON-NLS-1$
} }
} }
return fQualifiedName; return fQualifiedName;

View file

@ -249,7 +249,7 @@ public class CDebugElement extends PlatformObject
*/ */
public void targetRequestFailed( String message, CDIException e ) throws DebugException public void targetRequestFailed( String message, CDIException e ) throws DebugException
{ {
requestFailed( "Target request failed: " + message, e, DebugException.TARGET_REQUEST_FAILED ); requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CDebugElement.Target_request_failed") + message, e, DebugException.TARGET_REQUEST_FAILED ); //$NON-NLS-1$
} }
/** /**
@ -274,7 +274,7 @@ public class CDebugElement extends PlatformObject
*/ */
public void targetRequestFailed( String message, Throwable e ) throws DebugException public void targetRequestFailed( String message, Throwable e ) throws DebugException
{ {
throwDebugException( "Target request failed: " + message, DebugException.TARGET_REQUEST_FAILED, e ); throwDebugException( CDebugCorePlugin.getResourceString("internal.core.model.CDebugElement.Target_request_failed") + message, DebugException.TARGET_REQUEST_FAILED, e ); //$NON-NLS-1$
} }
/** /**

View file

@ -856,7 +856,7 @@ public class CDebugTarget extends CDebugElement
if ( !canDisconnect() ) if ( !canDisconnect() )
{ {
notSupported( "Session does not support \'disconnect\'" ); notSupported( CDebugCorePlugin.getResourceString("internal.core.model.CDebugTarget.Disconnect_session_unsupported") ); //$NON-NLS-1$
} }
try try
@ -1108,7 +1108,7 @@ public class CDebugTarget extends CDebugElement
try try
{ {
ICDILocation location = getCDISession().getBreakpointManager().createLocation( "", "main", 0 ); ICDILocation location = getCDISession().getBreakpointManager().createLocation( "", "main", 0 ); //$NON-NLS-1$ //$NON-NLS-2$
setInternalTemporaryBreakpoint( location ); setInternalTemporaryBreakpoint( location );
getCDITarget().restart(); getCDITarget().restart();
restarted(); restarted();
@ -1529,9 +1529,8 @@ public class CDebugTarget extends CDebugElement
{ {
MultiStatus status = new MultiStatus( CDebugCorePlugin.getUniqueIdentifier(), MultiStatus status = new MultiStatus( CDebugCorePlugin.getUniqueIdentifier(),
ICDebugInternalConstants.STATUS_CODE_ERROR, ICDebugInternalConstants.STATUS_CODE_ERROR,
"The execution of program is suspended because of error.", CDebugCorePlugin.getResourceString("internal.core.model.CDebugTarget.Execution_suspended_because_of_error"), null ); //$NON-NLS-1$
null ); StringTokenizer st = new StringTokenizer( info.getDetailMessage(), "\n\r" ); //$NON-NLS-1$
StringTokenizer st = new StringTokenizer( info.getDetailMessage(), "\n\r" );
while( st.hasMoreTokens() ) while( st.hasMoreTokens() )
{ {
String token = st.nextToken(); String token = st.nextToken();
@ -2061,7 +2060,7 @@ public class CDebugTarget extends CDebugElement
public IPath getPath() public IPath getPath()
{ {
IPath path = new Path(""); IPath path = new Path(""); //$NON-NLS-1$
ICElement parent = var.getParent(); ICElement parent = var.getParent();
if ( parent instanceof IBinaryModule ) if ( parent instanceof IBinaryModule )
{ {
@ -2372,7 +2371,7 @@ public class CDebugTarget extends CDebugElement
*/ */
public String toString() public String toString()
{ {
String result = ""; String result = ""; //$NON-NLS-1$
try try
{ {
result = getName(); result = getName();

View file

@ -87,7 +87,7 @@ public class CDummyStackFrame extends CDebugElement implements IStackFrame, IDum
*/ */
public String getName() throws DebugException public String getName() throws DebugException
{ {
return "..."; return "..."; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -49,7 +49,7 @@ public class CGlobalVariable extends CModificationVariable
} }
catch( CDIException e ) catch( CDIException e )
{ {
requestFailed( "", e ); requestFailed( "", e ); //$NON-NLS-1$
} }
int[] dims = getType().getArrayDimensions(); int[] dims = getType().getArrayDimensions();
if ( dims.length > 0 && dims[0] > 0 ) if ( dims.length > 0 && dims[0] > 0 )

View file

@ -12,6 +12,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IValue; import org.eclipse.debug.core.model.IValue;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
/** /**
* *
@ -69,7 +70,7 @@ public class CModificationVariable extends CVariable
if ( cdiVariable != null ) if ( cdiVariable != null )
cdiVariable.setValue( newExpression ); cdiVariable.setValue( newExpression );
else else
requestFailed( "Unable to set value.", null ); requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CModificationVariable.Unable_to_set_value"), null ); //$NON-NLS-1$
} }
catch( CDIException e ) catch( CDIException e )
@ -93,7 +94,7 @@ public class CModificationVariable extends CVariable
if ( cdiVariable != null ) if ( cdiVariable != null )
cdiVariable.setValue( value ); cdiVariable.setValue( value );
else else
requestFailed( "Unable to set value.", null ); requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CModificationVariable.Unable_to_set_value"), null ); //$NON-NLS-1$
} }
catch( CDIException e ) catch( CDIException e )
{ {

View file

@ -6,6 +6,7 @@
package org.eclipse.cdt.debug.internal.core.model; package org.eclipse.cdt.debug.internal.core.model;
import java.text.NumberFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
@ -205,16 +206,26 @@ public class CStackFrame extends CDebugElement
public String getName() throws DebugException public String getName() throws DebugException
{ {
ICDILocation location = getCDIStackFrame().getLocation(); ICDILocation location = getCDIStackFrame().getLocation();
String name = new String();
String func = ""; //$NON-NLS-1$
String file = ""; //$NON-NLS-1$
String line = ""; //$NON-NLS-1$
if ( location.getFunction() != null && location.getFunction().trim().length() > 0 ) if ( location.getFunction() != null && location.getFunction().trim().length() > 0 )
name += location.getFunction() + "() "; func += location.getFunction() + "() "; //$NON-NLS-1$
if ( location.getFile() != null && location.getFile().trim().length() > 0 ) if ( location.getFile() != null && location.getFile().trim().length() > 0 )
{ {
name += "at " + location.getFile() + ":" ; file = location.getFile();
if ( location.getLineNumber() != 0 )
name += location.getLineNumber(); if ( location.getLineNumber() != 0 ) {
line = NumberFormat.getInstance().format(new Integer(location.getLineNumber()));
} }
return name.toString(); } else {
return func;
}
return CDebugCorePlugin.getFormattedString("internal.core.model.CStackFrame.function_at_file", new String[] {func, file}) + line; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -45,6 +45,7 @@ import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IBreakpoint; import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.IStackFrame; import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.core.model.IThread; import org.eclipse.debug.core.model.IThread;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
/** /**
* *
@ -274,7 +275,7 @@ public class CThread extends CDebugElement
} }
catch( CDIException e ) catch( CDIException e )
{ {
setStatus( ICDebugElementErrorStatus.WARNING, "Stack is not available: " + e.getMessage() ); setStatus( ICDebugElementErrorStatus.WARNING, CDebugCorePlugin.getResourceString("internal.core.model.CThread.Stack_not_available") + e.getMessage() ); //$NON-NLS-1$
targetRequestFailed( e.getMessage(), null ); targetRequestFailed( e.getMessage(), null );
} }
return new ICDIStackFrame[0]; return new ICDIStackFrame[0];
@ -1103,7 +1104,7 @@ public class CThread extends CDebugElement
} }
catch( CDIException e ) catch( CDIException e )
{ {
setStatus( ICDebugElementErrorStatus.WARNING, "Stack is not available: " + e.getMessage() ); setStatus( ICDebugElementErrorStatus.WARNING, CDebugCorePlugin.getResourceString("internal.core.model.CThread.Stack_not_available") + e.getMessage() ); //$NON-NLS-1$
} }
return depth; return depth;
} }
@ -1184,7 +1185,7 @@ public class CThread extends CDebugElement
*/ */
public String toString() public String toString()
{ {
String result = ""; String result = ""; //$NON-NLS-1$
try try
{ {
result = getName(); result = getName();

View file

@ -33,6 +33,7 @@ import org.eclipse.cdt.debug.core.model.ICExpressionEvaluator;
import org.eclipse.cdt.debug.core.model.ICValue; import org.eclipse.cdt.debug.core.model.ICValue;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IVariable; import org.eclipse.debug.core.model.IVariable;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
/** /**
* *
@ -186,7 +187,7 @@ public class CValue extends CDebugElement implements ICValue
} }
catch( CDIException e ) catch( CDIException e )
{ {
requestFailed( "not available: ", e ); requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CValue.Not_available"), e ); //$NON-NLS-1$
} }
return Arrays.asList( vars ); return Arrays.asList( vars );
} }
@ -260,7 +261,7 @@ public class CValue extends CDebugElement implements ICValue
byteValue != '\t' && byteValue != '\t' &&
byteValue != '\n' && byteValue != '\n' &&
byteValue != '\f' && byteValue != '\f' &&
byteValue != '\r' ) || byteValue < 0 ) ? "" : new String( new byte[] { '\'', byteValue, '\'' } ); byteValue != '\r' ) || byteValue < 0 ) ? "" : new String( new byte[] { '\'', byteValue, '\'' } ); //$NON-NLS-1$
} }
case ICDIFormat.DECIMAL: case ICDIFormat.DECIMAL:
{ {
@ -269,7 +270,7 @@ public class CValue extends CDebugElement implements ICValue
} }
case ICDIFormat.HEXADECIMAL: case ICDIFormat.HEXADECIMAL:
{ {
StringBuffer sb = new StringBuffer( "0x" ); StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
String stringValue = ( isUnsigned() ) ? Integer.toHexString( value.shortValue() ) : Integer.toHexString( (byte)value.byteValue() ); String stringValue = ( isUnsigned() ) ? Integer.toHexString( value.shortValue() ) : Integer.toHexString( (byte)value.byteValue() );
sb.append( ( stringValue.length() > 2 ) ? stringValue.substring( stringValue.length() - 2 ) : stringValue ); sb.append( ( stringValue.length() > 2 ) ? stringValue.substring( stringValue.length() - 2 ) : stringValue );
return sb.toString(); return sb.toString();
@ -287,7 +288,7 @@ public class CValue extends CDebugElement implements ICValue
return ( isUnsigned() ) ? Integer.toString( value.intValue() ) : Short.toString( value.shortValue() ); return ( isUnsigned() ) ? Integer.toString( value.intValue() ) : Short.toString( value.shortValue() );
case ICDIFormat.HEXADECIMAL: case ICDIFormat.HEXADECIMAL:
{ {
StringBuffer sb = new StringBuffer( "0x" ); StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
String stringValue = Integer.toHexString( ( isUnsigned() ) ? value.intValue() : value.shortValue() ); String stringValue = Integer.toHexString( ( isUnsigned() ) ? value.intValue() : value.shortValue() );
sb.append( ( stringValue.length() > 4 ) ? stringValue.substring( stringValue.length() - 4 ) : stringValue ); sb.append( ( stringValue.length() > 4 ) ? stringValue.substring( stringValue.length() - 4 ) : stringValue );
return sb.toString(); return sb.toString();
@ -305,7 +306,7 @@ public class CValue extends CDebugElement implements ICValue
return ( isUnsigned() ) ? Long.toString( value.longValue() ) : Integer.toString( value.intValue() ); return ( isUnsigned() ) ? Long.toString( value.longValue() ) : Integer.toString( value.intValue() );
case ICDIFormat.HEXADECIMAL: case ICDIFormat.HEXADECIMAL:
{ {
StringBuffer sb = new StringBuffer( "0x" ); StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
String stringValue = ( isUnsigned() ) ? Long.toHexString( value.longValue() ) : Integer.toHexString( value.intValue() ); String stringValue = ( isUnsigned() ) ? Long.toHexString( value.longValue() ) : Integer.toHexString( value.intValue() );
sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue );
return sb.toString(); return sb.toString();
@ -323,7 +324,7 @@ public class CValue extends CDebugElement implements ICValue
return ( isUnsigned() ) ? Long.toString( value.longValue() ) : Integer.toString( value.intValue() ); return ( isUnsigned() ) ? Long.toString( value.longValue() ) : Integer.toString( value.intValue() );
case ICDIFormat.HEXADECIMAL: case ICDIFormat.HEXADECIMAL:
{ {
StringBuffer sb = new StringBuffer( "0x" ); StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
String stringValue = Long.toHexString( ( isUnsigned() ) ? value.longValue() : value.intValue() ); String stringValue = Long.toHexString( ( isUnsigned() ) ? value.longValue() : value.intValue() );
sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue );
return sb.toString(); return sb.toString();
@ -349,7 +350,7 @@ public class CValue extends CDebugElement implements ICValue
} }
case ICDIFormat.HEXADECIMAL: case ICDIFormat.HEXADECIMAL:
{ {
StringBuffer sb = new StringBuffer( "0x" ); StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
if ( isUnsigned() ) if ( isUnsigned() )
{ {
@ -369,7 +370,7 @@ public class CValue extends CDebugElement implements ICValue
float floatValue = value.floatValue(); float floatValue = value.floatValue();
Float flt = new Float( floatValue ); Float flt = new Float( floatValue );
if ( flt.isNaN() || flt.isInfinite() ) if ( flt.isNaN() || flt.isInfinite() )
return ""; return ""; //$NON-NLS-1$
long longValue = flt.longValue(); long longValue = flt.longValue();
switch( getParentVariable().getFormat() ) switch( getParentVariable().getFormat() )
{ {
@ -379,7 +380,7 @@ public class CValue extends CDebugElement implements ICValue
return Long.toString( longValue ); return Long.toString( longValue );
case ICDIFormat.HEXADECIMAL: case ICDIFormat.HEXADECIMAL:
{ {
StringBuffer sb = new StringBuffer( "0x" ); StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
String stringValue = Long.toHexString( longValue ); String stringValue = Long.toHexString( longValue );
sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue );
return sb.toString(); return sb.toString();
@ -393,7 +394,7 @@ public class CValue extends CDebugElement implements ICValue
double doubleValue = value.doubleValue(); double doubleValue = value.doubleValue();
Double dbl = new Double( doubleValue ); Double dbl = new Double( doubleValue );
if ( dbl.isNaN() || dbl.isInfinite() ) if ( dbl.isNaN() || dbl.isInfinite() )
return ""; return ""; //$NON-NLS-1$
long longValue = dbl.longValue(); long longValue = dbl.longValue();
switch( getParentVariable().getFormat() ) switch( getParentVariable().getFormat() )
{ {
@ -403,7 +404,7 @@ public class CValue extends CDebugElement implements ICValue
return Long.toString( longValue ); return Long.toString( longValue );
case ICDIFormat.HEXADECIMAL: case ICDIFormat.HEXADECIMAL:
{ {
StringBuffer sb = new StringBuffer( "0x" ); StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
String stringValue = Long.toHexString( longValue ); String stringValue = Long.toHexString( longValue );
sb.append( ( stringValue.length() > 16 ) ? stringValue.substring( stringValue.length() - 16 ) : stringValue ); sb.append( ( stringValue.length() > 16 ) ? stringValue.substring( stringValue.length() - 16 ) : stringValue );
return sb.toString(); return sb.toString();
@ -422,7 +423,7 @@ public class CValue extends CDebugElement implements ICValue
case ICDIFormat.NATURAL: case ICDIFormat.NATURAL:
case ICDIFormat.HEXADECIMAL: case ICDIFormat.HEXADECIMAL:
{ {
StringBuffer sb = new StringBuffer( "0x" ); StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
String stringValue = Long.toHexString( longValue ); String stringValue = Long.toHexString( longValue );
sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue );
return sb.toString(); return sb.toString();
@ -441,7 +442,7 @@ public class CValue extends CDebugElement implements ICValue
case ICDIFormat.NATURAL: case ICDIFormat.NATURAL:
case ICDIFormat.HEXADECIMAL: case ICDIFormat.HEXADECIMAL:
{ {
StringBuffer sb = new StringBuffer( "0x" ); StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
String stringValue = Long.toHexString( longValue ); String stringValue = Long.toHexString( longValue );
sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue );
return sb.toString(); return sb.toString();
@ -464,7 +465,7 @@ public class CValue extends CDebugElement implements ICValue
return ( isUnsigned() ) ? Integer.toString( value.intValue() ) : Short.toString( value.shortValue() ); return ( isUnsigned() ) ? Integer.toString( value.intValue() ) : Short.toString( value.shortValue() );
case ICDIFormat.HEXADECIMAL: case ICDIFormat.HEXADECIMAL:
{ {
StringBuffer sb = new StringBuffer( "0x" ); StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
String stringValue = Integer.toHexString( ( isUnsigned() ) ? value.intValue() : value.shortValue() ); String stringValue = Integer.toHexString( ( isUnsigned() ) ? value.intValue() : value.shortValue() );
sb.append( ( stringValue.length() > 4 ) ? stringValue.substring( stringValue.length() - 4 ) : stringValue ); sb.append( ( stringValue.length() > 4 ) ? stringValue.substring( stringValue.length() - 4 ) : stringValue );
return sb.toString(); return sb.toString();
@ -480,7 +481,7 @@ public class CValue extends CDebugElement implements ICValue
return ( isUnsigned() ) ? Long.toString( value.longValue() ) : Integer.toString( value.intValue() ); return ( isUnsigned() ) ? Long.toString( value.longValue() ) : Integer.toString( value.intValue() );
case ICDIFormat.HEXADECIMAL: case ICDIFormat.HEXADECIMAL:
{ {
StringBuffer sb = new StringBuffer( "0x" ); StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
String stringValue = ( isUnsigned() ) ? Long.toHexString( value.longValue() ) : Integer.toHexString( value.intValue() ); String stringValue = ( isUnsigned() ) ? Long.toHexString( value.longValue() ) : Integer.toHexString( value.intValue() );
sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue );
return sb.toString(); return sb.toString();

View file

@ -80,7 +80,7 @@ public abstract class CVariable extends CDebugElement
*/ */
public String getName() public String getName()
{ {
return ( fVariableObject != null ) ? fVariableObject.getName() : ""; return ( fVariableObject != null ) ? fVariableObject.getName() : ""; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -88,7 +88,7 @@ public abstract class CVariable extends CDebugElement
*/ */
public String getTypeName() throws CDIException public String getTypeName() throws CDIException
{ {
return ( fVariableObject != null ) ? fVariableObject.getTypeName() : ""; return ( fVariableObject != null ) ? fVariableObject.getTypeName() : ""; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -207,7 +207,7 @@ public abstract class CVariable extends CDebugElement
{ {
fCDIVariable = new ErrorVariable( getCDIVariableObject(), e ); fCDIVariable = new ErrorVariable( getCDIVariableObject(), e );
setStatus( ICDebugElementErrorStatus.ERROR, setStatus( ICDebugElementErrorStatus.ERROR,
MessageFormat.format( "not available: {0}", new String[] { e.getMessage() } ) ); CDebugCorePlugin.getFormattedString( "internal.core.model.CVariable.not_available", new String[] { e.getMessage() } ) ); //$NON-NLS-1$
} }
} }
return fCDIVariable; return fCDIVariable;
@ -412,7 +412,7 @@ public abstract class CVariable extends CDebugElement
fShadow = null; fShadow = null;
if ( cdiVariableObject instanceof ErrorVariable ) if ( cdiVariableObject instanceof ErrorVariable )
setStatus( ICDebugElementErrorStatus.ERROR, setStatus( ICDebugElementErrorStatus.ERROR,
MessageFormat.format( "not available: {0}", new String[] { ((ErrorVariable)cdiVariableObject).getException().getMessage() } ) ); CDebugCorePlugin.getFormattedString( "internal.core.model.CVariable.not_available", new String[] { ((ErrorVariable)cdiVariableObject).getException().getMessage() } ) ); //$NON-NLS-1$
fFormat = CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT ); fFormat = CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT );
getCDISession().getEventManager().addEventListener( this ); getCDISession().getEventManager().addEventListener( this );
} }
@ -453,7 +453,7 @@ public abstract class CVariable extends CDebugElement
} }
catch( CDIException e ) catch( CDIException e )
{ {
requestFailed( "", e ); requestFailed( "", e ); //$NON-NLS-1$
} }
int[] dims = type.getArrayDimensions(); int[] dims = type.getArrayDimensions();
if ( dims.length > 0 && dims[0] > 0 ) if ( dims.length > 0 && dims[0] > 0 )
@ -482,7 +482,7 @@ public abstract class CVariable extends CDebugElement
*/ */
public void setValue( String expression ) throws DebugException public void setValue( String expression ) throws DebugException
{ {
notSupported( "Variable does not support value modification." ); notSupported( CDebugCorePlugin.getResourceString("internal.core.model.CVariable.Value_modification_unsupported") ); //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -490,7 +490,7 @@ public abstract class CVariable extends CDebugElement
*/ */
public void setValue( IValue value ) throws DebugException public void setValue( IValue value ) throws DebugException
{ {
notSupported( "Variable does not support value modification." ); notSupported( CDebugCorePlugin.getResourceString("internal.core.model.CVariable.Value_modification_unsupported") ); //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -774,7 +774,7 @@ public abstract class CVariable extends CDebugElement
{ {
logError( e ); logError( e );
} }
return ""; return ""; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -931,7 +931,7 @@ public abstract class CVariable extends CDebugElement
} }
catch( CDIException e ) catch( CDIException e )
{ {
requestFailed( "Qualified name is not available.", e ); requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CVariable.Qualified_name_unavailable"), e ); //$NON-NLS-1$
} }
return result; return result;
} }
@ -952,7 +952,7 @@ public abstract class CVariable extends CDebugElement
} }
catch( CDIException e ) catch( CDIException e )
{ {
requestFailed( "Type is not available.", e ); requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CVariable.Type_unavailable"), e ); //$NON-NLS-1$
} }
} }
return type; return type;

View file

@ -47,10 +47,10 @@ import org.xml.sax.SAXException;
*/ */
public class CDirectorySourceLocation implements IDirectorySourceLocation public class CDirectorySourceLocation implements IDirectorySourceLocation
{ {
private static final String ELEMENT_NAME = "cDirectorySourceLocation"; private static final String ELEMENT_NAME = "cDirectorySourceLocation"; //$NON-NLS-1$
private static final String ATTR_DIRECTORY = "directory"; private static final String ATTR_DIRECTORY = "directory"; //$NON-NLS-1$
private static final String ATTR_ASSOCIATION = "association"; private static final String ATTR_ASSOCIATION = "association"; //$NON-NLS-1$
private static final String ATTR_SEARCH_SUBFOLDERS = "searchSubfolders"; private static final String ATTR_SEARCH_SUBFOLDERS = "searchSubfolders"; //$NON-NLS-1$
/** /**
* The root directory of this source location * The root directory of this source location
@ -302,11 +302,11 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation
node.setAttribute( ATTR_SEARCH_SUBFOLDERS, new Boolean( searchSubfolders() ).toString() ); node.setAttribute( ATTR_SEARCH_SUBFOLDERS, new Boolean( searchSubfolders() ).toString() );
try try
{ {
return CDebugUtils.serializeDocument( doc, " " ); return CDebugUtils.serializeDocument( doc, " " ); //$NON-NLS-1$
} }
catch( IOException e ) catch( IOException e )
{ {
abort( MessageFormat.format( "Unable to create memento for C/C++ directory source location {0}", new String[] { getDirectory().toOSString() } ), e ); abort( MessageFormat.format( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CDirectorySourceLocation.Unable_to_create_memento"), new String[] { getDirectory().toOSString() } ), e ); //$NON-NLS-1$
} }
// execution will not reach here // execution will not reach here
return null; return null;
@ -329,7 +329,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation
String dir = root.getAttribute( ATTR_DIRECTORY ); String dir = root.getAttribute( ATTR_DIRECTORY );
if ( isEmpty( dir ) ) if ( isEmpty( dir ) )
{ {
abort( "Unable to initialize source location - missing directory path", null ); abort( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CDirectorySourceLocation.Unable_to_initialize_src_location_no_dir"), null ); //$NON-NLS-1$
} }
else else
{ {
@ -340,7 +340,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation
} }
else else
{ {
abort( MessageFormat.format( "Unable to initialize source location - invalid directory path {0}", new String[] { dir } ), null ); abort( MessageFormat.format( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CDirectorySourceLocation.Unable_to_initialize_src_location_invalid_dir"), new String[] { dir } ), null ); //$NON-NLS-1$
} }
} }
dir = root.getAttribute( ATTR_ASSOCIATION ); dir = root.getAttribute( ATTR_ASSOCIATION );
@ -375,7 +375,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation
{ {
ex = e; ex = e;
} }
abort( "Exception occurred initializing source location.", ex ); abort( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CDirectorySourceLocation.Exception_initializing_src_location"), ex ); //$NON-NLS-1$
} }
/** /**
@ -506,7 +506,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation
*/ */
public String toString() public String toString()
{ {
return ( getDirectory() != null ) ? getDirectory().toOSString() : ""; return ( getDirectory() != null ) ? getDirectory().toOSString() : ""; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -8,7 +8,6 @@ package org.eclipse.cdt.debug.internal.core.sourcelookup;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.StringReader; import java.io.StringReader;
import java.text.MessageFormat;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.LinkedList; import java.util.LinkedList;
@ -46,9 +45,9 @@ import org.xml.sax.SAXException;
*/ */
public class CProjectSourceLocation implements IProjectSourceLocation public class CProjectSourceLocation implements IProjectSourceLocation
{ {
private static final String ELEMENT_NAME = "cProjectSourceLocation"; private static final String ELEMENT_NAME = "cProjectSourceLocation"; //$NON-NLS-1$
private static final String ATTR_PROJECT = "project"; private static final String ATTR_PROJECT = "project"; //$NON-NLS-1$
private static final String ATTR_GENERIC = "generic"; private static final String ATTR_GENERIC = "generic"; //$NON-NLS-1$
/** /**
* The project associated with this source location * The project associated with this source location
@ -234,11 +233,11 @@ public class CProjectSourceLocation implements IProjectSourceLocation
node.setAttribute( ATTR_GENERIC, new Boolean( isGeneric() ).toString() ); node.setAttribute( ATTR_GENERIC, new Boolean( isGeneric() ).toString() );
try try
{ {
return CDebugUtils.serializeDocument( doc, " " ); return CDebugUtils.serializeDocument( doc, " " ); //$NON-NLS-1$
} }
catch( IOException e ) catch( IOException e )
{ {
abort( MessageFormat.format( "Unable to create memento for C/C++ project source location {0}.", new String[] { getProject().getName() } ), e ); abort( CDebugCorePlugin.getFormattedString("internal.core.sourcelookup.CProjectSourceLocation.Unable_to_create_memento_for_src_location", new String[] { getProject().getName() } ), e ); //$NON-NLS-1$
} }
// execution will not reach here // execution will not reach here
return null; return null;
@ -261,7 +260,7 @@ public class CProjectSourceLocation implements IProjectSourceLocation
String name = root.getAttribute( ATTR_PROJECT ); String name = root.getAttribute( ATTR_PROJECT );
if ( isEmpty( name ) ) if ( isEmpty( name ) )
{ {
abort( "Unable to initialize source location - missing project name", null ); abort( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CProjectSourceLocation.Unable_to_initialize_src_location_no_project_name"), null ); //$NON-NLS-1$
} }
else else
{ {
@ -286,7 +285,7 @@ public class CProjectSourceLocation implements IProjectSourceLocation
{ {
ex = e; ex = e;
} }
abort( "Exception occurred initializing source location.", ex ); abort( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CProjectSourceLocation.Exception_intializing_src_location"), ex ); //$NON-NLS-1$
} }
/** /**
@ -391,6 +390,6 @@ public class CProjectSourceLocation implements IProjectSourceLocation
public String toString() public String toString()
{ {
return ( getProject() != null ) ? fProject.toString() : ""; return ( getProject() != null ) ? fProject.toString() : ""; //$NON-NLS-1$
} }
} }

View file

@ -58,14 +58,14 @@ import org.xml.sax.SAXException;
public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocator, IResourceChangeListener public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocator, IResourceChangeListener
{ {
private static final String SOURCE_LOCATOR_NAME = "cSourceLocator"; private static final String SOURCE_LOCATOR_NAME = "cSourceLocator"; //$NON-NLS-1$
private static final String DISABLED_GENERIC_PROJECT_NAME = "disabledGenericProject"; private static final String DISABLED_GENERIC_PROJECT_NAME = "disabledGenericProject"; //$NON-NLS-1$
private static final String ADDITIONAL_SOURCE_LOCATION_NAME = "additionalSourceLocation"; private static final String ADDITIONAL_SOURCE_LOCATION_NAME = "additionalSourceLocation"; //$NON-NLS-1$
private static final String SOURCE_LOCATION_NAME = "cSourceLocation"; private static final String SOURCE_LOCATION_NAME = "cSourceLocation"; //$NON-NLS-1$
private static final String ATTR_CLASS = "class"; private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
private static final String ATTR_MEMENTO = "memento"; private static final String ATTR_MEMENTO = "memento"; //$NON-NLS-1$
private static final String ATTR_PROJECT_NAME = "projectName"; private static final String ATTR_PROJECT_NAME = "projectName"; //$NON-NLS-1$
private static final String ATTR_DUPLICATE_FILES = "duplicateFiles"; private static final String ATTR_DUPLICATE_FILES = "duplicateFiles"; //$NON-NLS-1$
/** /**
* The project associated with this locator. * The project associated with this locator.
@ -301,11 +301,11 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
node.setAttribute( ATTR_DUPLICATE_FILES, new Boolean( searchForDuplicateFiles() ).toString() ); node.setAttribute( ATTR_DUPLICATE_FILES, new Boolean( searchForDuplicateFiles() ).toString() );
try try
{ {
return CDebugUtils.serializeDocument( doc, " " ); return CDebugUtils.serializeDocument( doc, " " ); //$NON-NLS-1$
} }
catch( IOException e ) catch( IOException e )
{ {
abort( "Unable to create memento for C/C++ source locator.", e ); abort( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CSourceLocator.Unable_to_create_memento"), e ); //$NON-NLS-1$
} }
// execution will not reach here // execution will not reach here
return null; return null;
@ -335,7 +335,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
if ( !root.getNodeName().equalsIgnoreCase( SOURCE_LOCATOR_NAME ) ) if ( !root.getNodeName().equalsIgnoreCase( SOURCE_LOCATOR_NAME ) )
{ {
abort( "Unable to restore C/C++ source locator - invalid format.", null ); abort( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CSourceLocator.Unable_to_restore_src_locator"), null ); //$NON-NLS-1$
} }
List sourceLocations = new ArrayList(); List sourceLocations = new ArrayList();
@ -367,7 +367,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
{ {
ex = e; ex = e;
} }
abort( "Exception occurred initializing source locator.", ex ); abort( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CSourceLocator.Exception_initializing_src_locator"), ex ); //$NON-NLS-1$
} }
private void removeDisabledLocations( Element root, List sourceLocations ) throws CoreException private void removeDisabledLocations( Element root, List sourceLocations ) throws CoreException
@ -387,7 +387,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
String projectName = entry.getAttribute( ATTR_PROJECT_NAME ); String projectName = entry.getAttribute( ATTR_PROJECT_NAME );
if ( isEmpty( projectName ) ) if ( isEmpty( projectName ) )
{ {
CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); //$NON-NLS-1$
} }
disabledProjects.add( projectName.trim() ); disabledProjects.add( projectName.trim() );
} }
@ -409,7 +409,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
MultiStatus status = new MultiStatus( CDebugCorePlugin.getUniqueIdentifier(), MultiStatus status = new MultiStatus( CDebugCorePlugin.getUniqueIdentifier(),
CDebugCorePlugin.INTERNAL_ERROR, CDebugCorePlugin.INTERNAL_ERROR,
"Error initializing directory source location.", CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CSourceLocator.Error_initializing_src_location"), //$NON-NLS-1$
null ); null );
NodeList list = root.getChildNodes(); NodeList list = root.getChildNodes();
int length = list.getLength(); int length = list.getLength();
@ -426,7 +426,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
String data = entry.getAttribute( ATTR_MEMENTO ); String data = entry.getAttribute( ATTR_MEMENTO );
if ( isEmpty( className ) ) if ( isEmpty( className ) )
{ {
CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); //$NON-NLS-1$
continue; continue;
} }
Class clazz = null; Class clazz = null;
@ -436,7 +436,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
} }
catch( ClassNotFoundException e ) catch( ClassNotFoundException e )
{ {
CDebugCorePlugin.log( MessageFormat.format( "Unable to restore source location - class not found {0}", new String[] { className } ) ); CDebugCorePlugin.log( MessageFormat.format( "Unable to restore source location - class not found {0}", new String[] { className } ) ); //$NON-NLS-1$
continue; continue;
} }
@ -447,12 +447,12 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
} }
catch( IllegalAccessException e ) catch( IllegalAccessException e )
{ {
CDebugCorePlugin.log( "Unable to restore source location." ); CDebugCorePlugin.log( "Unable to restore source location." ); //$NON-NLS-1$
continue; continue;
} }
catch( InstantiationException e ) catch( InstantiationException e )
{ {
CDebugCorePlugin.log( "Unable to restore source location." ); CDebugCorePlugin.log( "Unable to restore source location." ); //$NON-NLS-1$
continue; continue;
} }
try try
@ -490,7 +490,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
String data = entry.getAttribute( ATTR_MEMENTO ); String data = entry.getAttribute( ATTR_MEMENTO );
if ( isEmpty( className ) ) if ( isEmpty( className ) )
{ {
CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); //$NON-NLS-1$
continue; continue;
} }
Class clazz = null; Class clazz = null;
@ -500,7 +500,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
} }
catch( ClassNotFoundException e ) catch( ClassNotFoundException e )
{ {
CDebugCorePlugin.log( MessageFormat.format( "Unable to restore source location - class not found {0}", new String[] { className } ) ); CDebugCorePlugin.log( MessageFormat.format( "Unable to restore source location - class not found {0}", new String[] { className } ) ); //$NON-NLS-1$
continue; continue;
} }
@ -511,12 +511,12 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
} }
catch( IllegalAccessException e ) catch( IllegalAccessException e )
{ {
CDebugCorePlugin.log( "Unable to restore source location." ); CDebugCorePlugin.log( "Unable to restore source location." ); //$NON-NLS-1$
continue; continue;
} }
catch( InstantiationException e ) catch( InstantiationException e )
{ {
CDebugCorePlugin.log( "Unable to restore source location." ); CDebugCorePlugin.log( "Unable to restore source location." ); //$NON-NLS-1$
continue; continue;
} }
location.initializeFrom( data ); location.initializeFrom( data );

View file

@ -37,10 +37,10 @@ import org.xml.sax.SAXException;
*/ */
public class SourceUtils public class SourceUtils
{ {
private static final String NAME_COMMON_SOURCE_LOCATIONS = "commonSourceLocations"; private static final String NAME_COMMON_SOURCE_LOCATIONS = "commonSourceLocations"; //$NON-NLS-1$
private static final String NAME_SOURCE_LOCATION = "sourceLocation"; private static final String NAME_SOURCE_LOCATION = "sourceLocation"; //$NON-NLS-1$
private static final String ATTR_CLASS = "class"; private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
private static final String ATTR_MEMENTO = "memento"; private static final String ATTR_MEMENTO = "memento"; //$NON-NLS-1$
public static String getCommonSourceLocationsMemento( ICSourceLocation[] locations ) public static String getCommonSourceLocationsMemento( ICSourceLocation[] locations )
{ {
@ -51,11 +51,11 @@ public class SourceUtils
saveSourceLocations( doc, node, locations ); saveSourceLocations( doc, node, locations );
try try
{ {
return CDebugUtils.serializeDocument( doc, " " ); return CDebugUtils.serializeDocument( doc, " " ); //$NON-NLS-1$
} }
catch( IOException e ) catch( IOException e )
{ {
CDebugCorePlugin.log( new Status( IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), 0, "Error saving common source settings.", e ) ); CDebugCorePlugin.log( new Status( IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), 0, "Error saving common source settings.", e ) ); //$NON-NLS-1$
} }
return null; return null;
} }
@ -96,15 +96,15 @@ public class SourceUtils
} }
catch( ParserConfigurationException e ) catch( ParserConfigurationException e )
{ {
CDebugCorePlugin.log( new Status( IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), 0, "Error initializing common source settings.", e ) ); CDebugCorePlugin.log( new Status( IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), 0, "Error initializing common source settings.", e ) ); //$NON-NLS-1$
} }
catch( SAXException e ) catch( SAXException e )
{ {
CDebugCorePlugin.log( new Status( IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), 0, "Error initializing common source settings.", e ) ); CDebugCorePlugin.log( new Status( IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), 0, "Error initializing common source settings.", e ) ); //$NON-NLS-1$
} }
catch( IOException e ) catch( IOException e )
{ {
CDebugCorePlugin.log( new Status( IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), 0, "Error initializing common source settings.", e ) ); CDebugCorePlugin.log( new Status( IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), 0, "Error initializing common source settings.", e ) ); //$NON-NLS-1$
} }
} }
return result; return result;
@ -130,7 +130,7 @@ public class SourceUtils
String data = entry.getAttribute( ATTR_MEMENTO ); String data = entry.getAttribute( ATTR_MEMENTO );
if ( className == null || className.trim().length() == 0 ) if ( className == null || className.trim().length() == 0 )
{ {
CDebugCorePlugin.log( "Unable to restore common source locations - invalid format." ); CDebugCorePlugin.log( "Unable to restore common source locations - invalid format." ); //$NON-NLS-1$
continue; continue;
} }
Class clazz = null; Class clazz = null;
@ -140,7 +140,7 @@ public class SourceUtils
} }
catch( ClassNotFoundException e ) catch( ClassNotFoundException e )
{ {
CDebugCorePlugin.log( MessageFormat.format( "Unable to restore source location - class not found {0}", new String[] { className } ) ); CDebugCorePlugin.log( MessageFormat.format( "Unable to restore source location - class not found {0}", new String[] { className } ) ); //$NON-NLS-1$
continue; continue;
} }
@ -151,12 +151,12 @@ public class SourceUtils
} }
catch( IllegalAccessException e ) catch( IllegalAccessException e )
{ {
CDebugCorePlugin.log( "Unable to restore source location: " + e.getMessage() ); CDebugCorePlugin.log( "Unable to restore source location: " + e.getMessage() ); //$NON-NLS-1$
continue; continue;
} }
catch( InstantiationException e ) catch( InstantiationException e )
{ {
CDebugCorePlugin.log( "Unable to restore source location: " + e.getMessage() ); CDebugCorePlugin.log( "Unable to restore source location: " + e.getMessage() ); //$NON-NLS-1$
continue; continue;
} }
try try
@ -166,7 +166,7 @@ public class SourceUtils
} }
catch( CoreException e ) catch( CoreException e )
{ {
CDebugCorePlugin.log( "Unable to restore source location: " + e.getMessage() ); CDebugCorePlugin.log( "Unable to restore source location: " + e.getMessage() ); //$NON-NLS-1$
} }
} }
} }