mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 15:15:25 +02:00
Fix externalized strings warnings in tracer
This commit is contained in:
parent
73f204a7c8
commit
04251c8bcd
4 changed files with 28 additions and 19 deletions
|
@ -15,7 +15,7 @@ import org.osgi.framework.BundleContext;
|
|||
public class Activator extends AbstractUIPlugin {
|
||||
|
||||
// The plug-in ID
|
||||
public static final String PLUGIN_ID = "org.eclipse.rse.connectorservice.ssh";
|
||||
public static final String PLUGIN_ID = "org.eclipse.rse.connectorservice.ssh"; //$NON-NLS-1$
|
||||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
@ -53,12 +53,25 @@ public class Activator extends AbstractUIPlugin {
|
|||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an image descriptor for the image file at the given
|
||||
* plug-in relative path.
|
||||
*
|
||||
* @param path the path
|
||||
* @return the image descriptor
|
||||
*/
|
||||
public static ImageDescriptor getImageDescriptor(String path) {
|
||||
return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
|
||||
}
|
||||
|
||||
//<tracing code>----------------------------------------------------
|
||||
|
||||
private static Boolean fTracingOn = null;
|
||||
public static boolean isTracingOn() {
|
||||
if (fTracingOn==null) {
|
||||
String id = plugin.getBundle().getSymbolicName();
|
||||
String val = Platform.getDebugOption(id + "/debug"); //$NON-NLS-1$
|
||||
if ("true".equals(val)) {
|
||||
if ("true".equals(val)) { //$NON-NLS-1$
|
||||
fTracingOn = Boolean.TRUE;
|
||||
} else {
|
||||
fTracingOn = Boolean.FALSE;
|
||||
|
@ -79,20 +92,12 @@ public class Activator extends AbstractUIPlugin {
|
|||
}
|
||||
public static void trace(String msg) {
|
||||
if (isTracingOn()) {
|
||||
String fullMsg = getTimestamp() + " | " + Thread.currentThread().getName() + " | " + msg;
|
||||
String fullMsg = getTimestamp() + " | " + Thread.currentThread().getName() + " | " + msg; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
System.out.println(fullMsg);
|
||||
System.out.flush();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an image descriptor for the image file at the given
|
||||
* plug-in relative path.
|
||||
*
|
||||
* @param path the path
|
||||
* @return the image descriptor
|
||||
*/
|
||||
public static ImageDescriptor getImageDescriptor(String path) {
|
||||
return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
|
||||
}
|
||||
//</tracing code>---------------------------------------------------
|
||||
|
||||
}
|
||||
|
|
|
@ -62,12 +62,14 @@ public class Activator extends Plugin {
|
|||
return plugin;
|
||||
}
|
||||
|
||||
//<tracing code>----------------------------------------------------
|
||||
|
||||
private static Boolean fTracingOn = null;
|
||||
public static boolean isTracingOn() {
|
||||
if (fTracingOn==null) {
|
||||
String id = plugin.getBundle().getSymbolicName();
|
||||
String val = Platform.getDebugOption(id + "/debug"); //$NON-NLS-1$
|
||||
if ("true".equals(val)) {
|
||||
if ("true".equals(val)) { //$NON-NLS-1$
|
||||
fTracingOn = Boolean.TRUE;
|
||||
} else {
|
||||
fTracingOn = Boolean.FALSE;
|
||||
|
@ -88,10 +90,12 @@ public class Activator extends Plugin {
|
|||
}
|
||||
public static void trace(String msg) {
|
||||
if (isTracingOn()) {
|
||||
String fullMsg = getTimestamp() + " | " + Thread.currentThread().getName() + " | " + msg;
|
||||
String fullMsg = getTimestamp() + " | " + Thread.currentThread().getName() + " | " + msg; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
System.out.println(fullMsg);
|
||||
System.out.flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//</tracing code>---------------------------------------------------
|
||||
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ public class SftpHostFile implements IHostFile {
|
|||
return getName();
|
||||
} else {
|
||||
StringBuffer path = new StringBuffer(getParentPath());
|
||||
if (!fParentPath.endsWith("/"))
|
||||
if (!fParentPath.endsWith("/")) //$NON-NLS-1$
|
||||
{
|
||||
path.append('/');
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public class SftpHostFile implements IHostFile {
|
|||
}
|
||||
|
||||
public void renameTo(String newAbsolutePath) {
|
||||
int i = newAbsolutePath.lastIndexOf("/");
|
||||
int i = newAbsolutePath.lastIndexOf("/"); //$NON-NLS-1$
|
||||
if (i == -1) {
|
||||
fName = newAbsolutePath;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public class SshHostShell extends AbstractHostShell {
|
|||
fStdinHandler = new PrintWriter(fChannel.getOutputStream());
|
||||
|
||||
fChannel.connect();
|
||||
writeToShell("cd "+initialWorkingDirectory);
|
||||
writeToShell("cd "+initialWorkingDirectory); //$NON-NLS-1$
|
||||
} catch(Exception e) {
|
||||
//TODO Forward exception to RSE properly
|
||||
e.printStackTrace();
|
||||
|
|
Loading…
Add table
Reference in a new issue