1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 15:45:25 +02:00

[cleanup] compiler warnings

This commit is contained in:
Martin Oberhuber 2006-11-28 15:57:20 +00:00
parent 712899c35c
commit ba9a89c968
17 changed files with 62 additions and 64 deletions

View file

@ -34,6 +34,7 @@ import org.eclipse.rse.services.clientserver.PathUtility;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.shells.ui.ShellResources;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.subsystems.shells.core.model.ISystemOutputRemoteTypes;
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem;
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCommandShell;
import org.eclipse.rse.ui.ISystemMessages;
@ -383,7 +384,7 @@ FocusListener
else if (element instanceof RemoteOutput)
{
RemoteOutput out = (RemoteOutput)element;
if (out.getType().equals("directory")) //$NON-NLS-1$
if (out.getType().equals(ISystemOutputRemoteTypes.TYPE_DIRECTORY))
{
String path = out.getAbsolutePath();
ISubSystem cmdSubSystem = adapter.getSubSystem(element);

View file

@ -22,6 +22,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.rse.model.ISystemResourceChangeEvent;
import org.eclipse.rse.model.ISystemResourceChangeEvents;
import org.eclipse.rse.subsystems.shells.core.model.ISystemOutputRemoteTypes;
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCommandShell;
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteOutput;
import org.eclipse.rse.ui.ISystemThemeConstants;
@ -210,16 +211,16 @@ public class SystemCommandsView extends SystemTableView implements ISystemThemeC
{
IRemoteOutput rmtOutput = (IRemoteOutput) child;
String type = rmtOutput.getType();
if (type.equals("stderr") || type.equals("error")) //$NON-NLS-1$ //$NON-NLS-2$
if (type.equals("stderr") || type.equals(ISystemOutputRemoteTypes.TYPE_ERROR)) //$NON-NLS-1$
{
newItem.setForeground(_errColor);
} else if (type.equals("warning")) //$NON-NLS-1$
} else if (type.equals(ISystemOutputRemoteTypes.TYPE_WARNING))
{
newItem.setForeground(_warColor);
} else if (type.equals("informational")) //$NON-NLS-1$
} else if (type.equals(ISystemOutputRemoteTypes.TYPE_INFORMATIONAL))
{
newItem.setForeground(_infColor);
} else if (type.equals("prompt")) //$NON-NLS-1$
} else if (type.equals(ISystemOutputRemoteTypes.TYPE_PROMPT))
{
newItem.setForeground(_prmColor);
} else

View file

@ -125,7 +125,7 @@ implements ISystemViewElementAdapter, ISystemRemoteElementAdapter, ISystemOutpu
{
IRemoteOutput result = (IRemoteOutput) firstSelection;
String type = result.getType();
if (type.equals("prompt")) //$NON-NLS-1$
if (type.equals(ISystemOutputRemoteTypes.TYPE_PROMPT))
{
if (_pasteToPromptAction == null)
{
@ -134,7 +134,7 @@ implements ISystemViewElementAdapter, ISystemRemoteElementAdapter, ISystemOutpu
menu.add(menuGroup, _pasteToPromptAction);
}
else if (type.equals("directory")) //$NON-NLS-1$
else if (type.equals(ISystemOutputRemoteTypes.TYPE_DIRECTORY))
{
IRemoteOutput output = (IRemoteOutput)firstSelection;
if (output.getAbsolutePath() != null)
@ -478,15 +478,15 @@ implements ISystemViewElementAdapter, ISystemRemoteElementAdapter, ISystemOutpu
//
// marker = localMatch.createMarker(IMarker.TEXT);
//
// if (type.equals("error"))
// if (type.equals(ISystemOutputRemoteTypes.TYPE_ERROR))
// {
// marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
// }
// else if (type.equals("warning"))
// else if (type.equals(ISystemOutputRemoteTypes.TYPE_WARNING))
// {
// marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
// }
// else if (type.equals("informational"))
// else if (type.equals(ISystemOutputRemoteTypes.TYPE_INFORMATIONAL))
// {
// marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO);
// }

View file

@ -19,7 +19,6 @@ package org.eclipse.rse.internal.subsystems.shells.servicesubsystem;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.model.ISystemResourceChangeEvents;
import org.eclipse.rse.model.SystemRegistry;
import org.eclipse.rse.model.SystemResourceChangeEvent;

View file

@ -29,7 +29,6 @@ import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.rse.core.SystemBasePlugin;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.IPropertySet;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.subsystems.CommunicationsEvent;
import org.eclipse.rse.core.subsystems.ICommunicationsListener;
import org.eclipse.rse.core.subsystems.IConnectorService;
@ -172,7 +171,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
}
catch (Exception exc)
{
SystemBasePlugin.logError("Error saving command subsystem after setting env var entries", exc);
SystemBasePlugin.logError("Error saving command subsystem after setting env var entries", exc); //$NON-NLS-1$
}
}
@ -206,7 +205,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
}
catch (Exception exc)
{
SystemBasePlugin.logError("Error saving command subsystem after adding env var entry", exc);
SystemBasePlugin.logError("Error saving command subsystem after adding env var entry", exc); //$NON-NLS-1$
}
}
@ -222,7 +221,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
}
catch (Exception exc)
{
SystemBasePlugin.logError("Error saving command subsystem after removing env var entry", exc);
SystemBasePlugin.logError("Error saving command subsystem after removing env var entry", exc); //$NON-NLS-1$
}
}
@ -486,7 +485,6 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
* Get the default running command shell for this command subsystem. If no
* such shell exists or is running, a new one is launched.
*
* @param shell the window used for notification
* @return the default running command shell
*/
public IRemoteCommandShell getDefaultShell() throws Exception
@ -940,7 +938,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
}
else
SystemBasePlugin.logDebugMessage(this.getClass().getName(),
"in SubSystemImpl.sendCommandToShell: isConnected() returning false!");
"in SubSystemImpl.sendCommandToShell: isConnected() returning false!"); //$NON-NLS-1$
}
@ -978,15 +976,13 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
}
else
SystemBasePlugin.logDebugMessage(this.getClass().getName(),
"in SubSystemImpl.cancelShell: isConnected() returning false!");
"in SubSystemImpl.cancelShell: isConnected() returning false!"); //$NON-NLS-1$
}
}
/**
* Remove and Cancel a shell or running command.
*
* @param shell parent shell used to show error message. Null means you will
* handle showing the error message.
* @param commandObject the shell or command to cancel.
*/
public void removeShell(Object commandObject) throws Exception
@ -1018,7 +1014,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
}
else
SystemBasePlugin.logDebugMessage(this.getClass().getName(),
"in SubSystemImpl.removeShell: isConnected() returning false!");
"in SubSystemImpl.removeShell: isConnected() returning false!"); //$NON-NLS-1$
}
}

View file

@ -150,11 +150,11 @@ public class RemoteSystemEnvVar implements IRemoteSystemEnvVar
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(" (name: "); //$NON-NLS-1$
result.append(name);
result.append(", value: ");
result.append(", value: "); //$NON-NLS-1$
result.append(value);
result.append(", additionalAttributes: ");
result.append(", additionalAttributes: "); //$NON-NLS-1$
result.append(additionalAttributes);
result.append(')');
return result.toString();

View file

@ -65,6 +65,6 @@ public class Activator extends AbstractUIPlugin {
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.rse.subsystems.shells.core", path);
return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.rse.subsystems.shells.core", path); //$NON-NLS-1$
}
}

View file

@ -20,7 +20,7 @@ import org.eclipse.osgi.util.NLS;
public class ShellStrings extends NLS
{
private static String BUNDLE_NAME = "org.eclipse.rse.subsystems.shells.core.ShellStrings";
private static String BUNDLE_NAME = "org.eclipse.rse.subsystems.shells.core.ShellStrings"; //$NON-NLS-1$
public static String RESID_SHELLS_COMMAND_SHELL_LABEL;
public static String RSESubSystemOperation_Cancel_Shell_message;

View file

@ -30,7 +30,7 @@ public interface ISystemOutputRemoteTypes
* There is only one type category for remote output.
* It is "output".
*/
public static final String TYPECATEGORY = "output";
public static final String TYPECATEGORY = "output"; //$NON-NLS-1$
// -----------
@ -40,62 +40,62 @@ public interface ISystemOutputRemoteTypes
/**
* A folder object
*/
public static final String TYPE_DIRECTORY = "directory";
public static final String TYPE_DIRECTORY = "directory"; //$NON-NLS-1$
/**
* A file object
*/
public static final String TYPE_FILE = "file";
public static final String TYPE_FILE = "file"; //$NON-NLS-1$
/**
* A command object
*/
public static final String TYPE_COMMAND = "command";
public static final String TYPE_COMMAND = "command"; //$NON-NLS-1$
/**
* A prompt object
*/
public static final String TYPE_PROMPT = "prompt";
public static final String TYPE_PROMPT = "prompt"; //$NON-NLS-1$
/**
* An error object
*/
public static final String TYPE_ERROR = "error";
public static final String TYPE_ERROR = "error"; //$NON-NLS-1$
/**
* A warning object
*/
public static final String TYPE_WARNING = "warning";
public static final String TYPE_WARNING = "warning"; //$NON-NLS-1$
/**
* An informational object
*/
public static final String TYPE_INFORMATIONAL = "informational";
public static final String TYPE_INFORMATIONAL = "informational"; //$NON-NLS-1$
/**
* A grep object
*/
public static final String TYPE_GREP = "grep";
public static final String TYPE_GREP = "grep"; //$NON-NLS-1$
/**
* An environment variable object
*/
public static final String TYPE_ENVVAR = "envvar";
public static final String TYPE_ENVVAR = "envvar"; //$NON-NLS-1$
/**
* A libpath environment variable object
*/
public static final String TYPE_ENVVAR_LIBPATH = "libpathenvvar";
public static final String TYPE_ENVVAR_LIBPATH = "libpathenvvar"; //$NON-NLS-1$
/**
* The path environment variable object
*/
public static final String TYPE_ENVVAR_PATH = "pathenvvar";
public static final String TYPE_ENVVAR_PATH = "pathenvvar"; //$NON-NLS-1$
/**
* A process object
*/
public static final String TYPE_PROCESS = "process";
public static final String TYPE_PROCESS = "process"; //$NON-NLS-1$
}

View file

@ -55,7 +55,7 @@ public class RemoteCommandFilterString implements Cloneable
*/
public RemoteCommandFilterString()
{
shellStr = "*";
shellStr = "*"; //$NON-NLS-1$
}
/**
* Constructor to use when there is no existing filter string.
@ -67,7 +67,7 @@ public class RemoteCommandFilterString implements Cloneable
*/
public RemoteCommandFilterString(IRemoteCmdSubSystemConfiguration subsysFactory)
{
shellStr = "*";
shellStr = "*"; //$NON-NLS-1$
}
/**
* Constructor to use when an absolute filter string already exists.
@ -106,9 +106,9 @@ public class RemoteCommandFilterString implements Cloneable
*/
public static String getTypesString(String[] typesArray)
{
StringBuffer typesBuffer = new StringBuffer("");
StringBuffer typesBuffer = new StringBuffer(""); //$NON-NLS-1$
for (int idx=0; idx<typesArray.length; idx++)
typesBuffer.append(typesArray[idx]+",");
typesBuffer.append(typesArray[idx]+","); //$NON-NLS-1$
return typesBuffer.toString();
}
/**

View file

@ -74,7 +74,7 @@ public abstract class RemoteCommandShellOperation implements ISystemResourceChan
private Stack _commandStack;
private int _outputOffset = 0;
private String _cmdSeparator = ";";
private String _cmdSeparator = ";"; //$NON-NLS-1$
private Random _random;
@ -147,12 +147,12 @@ public abstract class RemoteCommandShellOperation implements ISystemResourceChan
private String getEchoCmd(CommandAlias alias)
{
return "echo " + getEchoResult(alias);
return "echo " + getEchoResult(alias); //$NON-NLS-1$
}
private String getEchoResult(CommandAlias alias)
{
return "BEGIN-END-TAG:" + alias.getAlias() + " done";
return "BEGIN-END-TAG:" + alias.getAlias() + " done"; //$NON-NLS-1$ //$NON-NLS-2$
}
public String getCurrentCommand()
@ -319,7 +319,7 @@ public abstract class RemoteCommandShellOperation implements ISystemResourceChan
int index = outputEcho.indexOf(expected);
if (index > 0)
{
if (outputEcho.charAt(index - 1) != ';' && (outputEcho.indexOf("echo") == -1))
if (outputEcho.charAt(index - 1) != ';' && (outputEcho.indexOf("echo") == -1)) //$NON-NLS-1$
{
return true;
}

View file

@ -128,7 +128,7 @@ public class SimpleCommandOperation
}
}
return "";
return ""; //$NON-NLS-1$
}
}

View file

@ -43,11 +43,11 @@ public interface IRemoteCmdSubSystem extends ISubSystem{
* Execute a remote command. This is only applicable if the subsystem factory reports
* true for supportsCommands().
* @param command Command to be executed remotely.
* @param Object context context of a command (i.e. working directory). Null is valid and means to run the
* @param context context of a command (i.e. working directory). Null is valid and means to run the
* command as a shell command in the default shell.
* @return Array of objects that are the result of running this command. Typically, these
* are messages logged by the command.
* @see org.eclipse.rse.core.subsystems.shells.ui.RemoteCommandHelpers
* @see org.eclipse.rse.shells.ui.RemoteCommandHelpers
*/
public Object[] runCommand(String command, Object context) throws Exception;
@ -55,12 +55,12 @@ public interface IRemoteCmdSubSystem extends ISubSystem{
* Execute a remote command. This is only applicable if the subsystem factory reports
* true for supportsCommands().
* @param command Command to be executed remotely.
* @param Object context context of a command (i.e. working directory). Null is valid and means to run the
* @param context context of a command (i.e. working directory). Null is valid and means to run the
* command as a shell command in the default shell.
* @param interpretOutput whether to interpret the output or not
* @return Array of objects that are the result of running this command. Typically, these
* are messages logged by the command.
* @see org.eclipse.rse.core.subsystems.shells.ui.RemoteCommandHelpers
* @see org.eclipse.rse.shells.ui.RemoteCommandHelpers
*/
public Object[] runCommand(String command, Object context, boolean interpretOutput) throws Exception;
@ -68,30 +68,30 @@ public interface IRemoteCmdSubSystem extends ISubSystem{
/**
* Launch a new command shell. This is only applicable if the subsystem factory reports
* true for supportsCommands().
* @param Object context context of a shell (i.e. working directory). Null is valid and means to use the default context.
* @param context context of a shell (i.e. working directory). Null is valid and means to use the default context.
* @return An object that represents the command and it's output.
* @see org.eclipse.rse.core.subsystems.shells.ui.RemoteCommandHelpers
* @see org.eclipse.rse.shells.ui.RemoteCommandHelpers
*/
public IRemoteCommandShell runShell(Object context) throws Exception;
/**
* Send a command as input to a running command shell.
* @param String input the command to invoke in the shell.
* @param Object commandObject the shell or command to send the invocation to.
* @see org.eclipse.rse.core.subsystems.shells.ui.RemoteCommandHelpers
* @param input the command to invoke in the shell.
* @param commandObject the shell or command to send the invocation to.
* @see org.eclipse.rse.shells.ui.RemoteCommandHelpers
*/
public void sendCommandToShell(String input, Object commandObject) throws Exception;
/**
* Cancel a shell or running command.
* @param Object commandObject the shell or command to cancel.
* @param commandObject the shell or command to cancel.
*/
public void cancelShell(Object commandObject) throws Exception;
/**
* Remove a shell. If the shell is running cancel it first.
* @param Object commandObject the shell or command to cancel & remove.
* @param commandObject the shell or command to cancel & remove.
*/
public void removeShell(Object commandObject) throws Exception;

View file

@ -55,7 +55,7 @@ public interface IRemoteCommandShell
/**
* Get the current context for this command shell. In the case of a unix shell, this
* will be the working directory as an
* @see org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile.
* @link{org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile}.
*
* This is used in order to store the state of the current shell on disconnect,
* such that the same directory can be set on reconnect. It may also be used

View file

@ -29,6 +29,7 @@ import org.eclipse.rse.services.shells.IHostShellChangeEvent;
import org.eclipse.rse.services.shells.ParsedOutput;
import org.eclipse.rse.services.shells.Patterns;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.rse.subsystems.shells.core.model.ISystemOutputRemoteTypes;
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem;
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteOutput;
import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.ServiceCommandShell;
@ -114,13 +115,13 @@ public class LocalServiceCommandShell extends ServiceCommandShell
if (parsedMsg != null)
{
String file = parsedMsg.file;
if (type.equals("prompt")) //$NON-NLS-1$
if (type.equals(ISystemOutputRemoteTypes.TYPE_PROMPT))
{
_workingDir = file;
output.setAbsolutePath(_workingDir);
}
/*
else if (type.equals("file") || type.equals("directory"))
else if (type.equals(ISystemOutputRemoteTypes.TYPE_FILE) || type.equals(ISystemOutputRemoteTypes.TYPE_DIRECTORY))
{
output.setAbsolutePath(parsedMsg.file);
}

View file

@ -142,7 +142,7 @@ public class SshServiceCommandShell extends ServiceCommandShell implements ISyst
if (parsedMsg != null)
{
String file = parsedMsg.file;
if (type.equals("prompt")) //$NON-NLS-1$
if (type.equals(ISystemOutputRemoteTypes.TYPE_PROMPT))
{
_workingDir = file;
output.setAbsolutePath(_workingDir);

View file

@ -182,7 +182,7 @@ public class SystemViewPromptableAdapter
*/
public String getMementoHandleKey(Object element)
{
return "Prompt";
return "Prompt"; //$NON-NLS-1$
}
/**