1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

dstore - removing some warnings

This commit is contained in:
David McKnight 2007-11-05 20:55:51 +00:00
parent 2028bc88ad
commit e5834735b3
12 changed files with 38 additions and 46 deletions

View file

@ -461,7 +461,7 @@ public final class DataElement implements IDataElement
public String getAttribute(int attributeIndex)
{
if (_attributes == null)
return "";
return ""; //$NON-NLS-1$
return _attributes[attributeIndex];
}

View file

@ -2662,7 +2662,7 @@ public final class DataStore
* Finds all the deleted elements
*
* @param root where to search from
* @param type the descriptor representing the type of the objects to search for
* @param depth the depth to search
* @return a list of elements
*/
public List findDeleted(DataElement root, int depth)
@ -3206,9 +3206,9 @@ public final class DataStore
/**
* Saves a class instance
*
* @param className the fully qualified name of the class
* @param buffer the contents of the class
* @param size the size of the buffer
* @param classbyteStreamHandlerId the id for the byte stream handler
*/
public void saveClassInstance(byte[] buffer, int size, String classbyteStreamHandlerId)
{
@ -3491,7 +3491,7 @@ public final class DataStore
// if the idle is 0 or not set then it is considered indefinite.
// The server is considered idle for the period of which no commands are
// received in server command handler
String serverIdleShutdownTimeout = System.getProperty("DSTORE_IDLE_SHUTDOWN_TIMEOUT");
String serverIdleShutdownTimeout = System.getProperty("DSTORE_IDLE_SHUTDOWN_TIMEOUT"); //$NON-NLS-1$
if (serverIdleShutdownTimeout != null)
{
_serverIdleShutdownTimeout = Integer.parseInt(serverIdleShutdownTimeout);
@ -4266,18 +4266,18 @@ public final class DataStore
total++;
boolean isSpirit = root.isSpirit();
boolean isDeleted = root.isDeleted();
String prefix = "DataElement";
String prefix = "DataElement"; //$NON-NLS-1$
if (isSpirit)
prefix += "<spirit>";
prefix += "<spirit>"; //$NON-NLS-1$
if (isDeleted)
prefix += "<deleted>";
prefix += "<deleted>"; //$NON-NLS-1$
String msg = indent + prefix + "["+ total + "]("+root.getType()+", "+root.getName()+")";
String msg = indent + prefix + "["+ total + "]("+root.getType()+", "+root.getName()+")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
System.out.println(msg);
for (int i = 0; i < root.getNestedSize(); i++)
{
DataElement currentElement = (DataElement) root.get(i);
total = printTree(indent + " ", total, currentElement);
DataElement currentElement = root.get(i);
total = printTree(indent + " ", total, currentElement); //$NON-NLS-1$
}
}
return total;

View file

@ -78,7 +78,7 @@ public class ServerCommandHandler extends CommandHandler
// if we do timeout then it's time to shutdown the server
return;
}
System.out.println("server timed out!");
System.out.println("server timed out!"); //$NON-NLS-1$
_serverTimedOut = true;
}

View file

@ -191,10 +191,10 @@ public class CommandMiner extends Miner
{
String invocation = ">"; //$NON-NLS-1$
DataElement encodingArg = getCommandArgument(theElement, 1);
if (encodingArg.getType().equals("shell.encoding"))
if (encodingArg.getType().equals("shell.encoding")) //$NON-NLS-1$
{
// fix for 191599
System.setProperty("dstore.stdin.encoding",encodingArg.getValue()); //$NON-NLS-1$ //$NON-NLS-2$
System.setProperty("dstore.stdin.encoding",encodingArg.getValue()); //$NON-NLS-1$
}
launchCommand(subject, invocation, status);
}
@ -204,7 +204,7 @@ public class CommandMiner extends Miner
// DataElement de = (DataElement) subject.dereference().get(1);
subject.dereference().get(1);
sendInputToCommand(input.getName(), getCommandStatus(subject));
status.setAttribute(DE.A_NAME, "done");
status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$
}
else if (name.equals("C_CANCEL")) //$NON-NLS-1$
{

View file

@ -1091,13 +1091,12 @@ public class CommandMinerThread extends MinerThread
try
{
String fileName = parsedMsg.file;
DataElement object = null;
if (parsedMsg.type.equals("prompt"))
if (parsedMsg.type.equals("prompt")) //$NON-NLS-1$
{
int tildaIndex = fileName.indexOf("~");
int tildaIndex = fileName.indexOf("~"); //$NON-NLS-1$
if (tildaIndex == 0)
{
String userHome = System.getProperty("user.home");
String userHome = System.getProperty("user.home"); //$NON-NLS-1$
fileName = userHome + fileName.substring(1);
}
@ -1113,13 +1112,13 @@ public class CommandMinerThread extends MinerThread
createObject(_descriptors._stdout, line);
}
}
else if (parsedMsg.type.equals("file"))
else if (parsedMsg.type.equals("file")) //$NON-NLS-1$
{
object = createObject(parsedMsg.type, line, fileName, null);
createObject(parsedMsg.type, line, fileName, null);
}
else
{
object = createObject(parsedMsg.type, line, fileName, new Integer(parsedMsg.line));
createObject(parsedMsg.type, line, fileName, new Integer(parsedMsg.line));
}
}
catch (NumberFormatException e)

View file

@ -210,7 +210,7 @@ public class OutputHandler extends Handler {
// output
// the delimiters are therefore set to "\n\r"
StringTokenizer tokenizer = new StringTokenizer(
fullOutput, "\n\r");
fullOutput, "\n\r"); //$NON-NLS-1$
int numTokens = tokenizer.countTokens();
output = new String[numTokens];
int index = 0;
@ -220,7 +220,7 @@ public class OutputHandler extends Handler {
}
String lastLine = output[index - 1];
if (!_endOfStream && (!fullOutput.endsWith("\n") && !fullOutput.endsWith("\r")))
if (!_endOfStream && (!fullOutput.endsWith("\n") && !fullOutput.endsWith("\r"))) //$NON-NLS-1$ //$NON-NLS-2$
{
// our last line may be cut off
byte[] lastBytes = new byte[MAX_OFFSET];
@ -253,8 +253,8 @@ public class OutputHandler extends Handler {
// check for end of line
String suffix = new String(lastBytes, 0, lastIndex + 1, encoding);
int rBreak = suffix.indexOf("\r");
int nBreak = suffix.indexOf("\n");
int rBreak = suffix.indexOf("\r"); //$NON-NLS-1$
int nBreak = suffix.indexOf("\n"); //$NON-NLS-1$
if (nBreak != -1 || rBreak != -1)
{
// we've hit the end of line;

View file

@ -37,21 +37,14 @@ import org.eclipse.rse.services.clientserver.archiveutils.VirtualChild;
public class ArchiveQueryThread extends QueryThread {
private DataElement _attributes;
private boolean _caseSensitive;
private boolean _foldersOnly;
private boolean _showHidden;
private boolean _isWindows;
public ArchiveQueryThread(DataElement subject, DataElement attributes,
boolean caseSensitive, boolean foldersOnly, boolean showHidden,
boolean isWindows, DataElement status) {
super(subject, status);
_attributes = attributes;
_foldersOnly = foldersOnly;
_caseSensitive = caseSensitive;
_showHidden = showHidden;
_isWindows = isWindows;
}
public void run() {

View file

@ -170,7 +170,7 @@ public class DStoreProcessService extends AbstractProcessService implements IPro
if (_minerElement == null || _minerElement.getDataStore() != getDataStore())
{
_minerElement = getDataStore()
.findMinerInformation(UniversalProcessMiner.MINER_ID); //$NON-NLS-1$
.findMinerInformation(UniversalProcessMiner.MINER_ID);
}
return _minerElement;
}

View file

@ -86,11 +86,11 @@ public class DStoreSearchService extends AbstractDStoreService implements ISearc
{
getStatusMonitor(ds).waitForUpdate(status, monitor);
String statusStr = status.getName();
if (statusStr.equals("done"))
if (statusStr.equals("done")) //$NON-NLS-1$
{
config.setStatus(IHostSearchConstants.FINISHED);
}
else if (statusStr.equals("cancelled"))
else if (statusStr.equals("cancelled")) //$NON-NLS-1$
{
config.setStatus(IHostSearchConstants.CANCELLED);
}

View file

@ -312,8 +312,8 @@ public class DStoreStatusMonitor implements IDomainListener
if (status != null)
{
// token command to wake up update handler
DataElement cmdDescriptor = _dataStore.findCommandDescriptor("C_REFRESH");
DataElement subject = (DataElement)status.getParent().get(0);
DataElement cmdDescriptor = _dataStore.findCommandDescriptor("C_REFRESH"); //$NON-NLS-1$
DataElement subject = status.getParent().get(0);
if (cmdDescriptor != null)
{
_dataStore.command(cmdDescriptor, subject);

View file

@ -80,7 +80,7 @@ public class DStoreFile extends AbstractRemoteFile implements IRemoteFile
if (hostParent == null)
{
DataStore ds = _dstoreHostFile.getDataElement().getDataStore();
DataElement element = ds.createObject(null, IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR, "");
DataElement element = ds.createObject(null, IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR, ""); //$NON-NLS-1$
element.setAttribute(DE.A_VALUE, pathOnly);
hostParent = new DStoreHostFile(element);
@ -101,7 +101,7 @@ public class DStoreFile extends AbstractRemoteFile implements IRemoteFile
{
parentName = pathOnly.substring(nameSep + 1);
parentPath = pathOnly.substring(0, nameSep);
if (parentPath.endsWith(":"))
if (parentPath.endsWith(":")) //$NON-NLS-1$
{
parentPath = parentPath + sep;
}
@ -109,7 +109,7 @@ public class DStoreFile extends AbstractRemoteFile implements IRemoteFile
else
{
parentName = pathOnly.substring(nameSep + 1);
parentPath = "" + sep;
parentPath = "" + sep; //$NON-NLS-1$
}
DataElement element = ds.createObject(null, IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR, parentName);
@ -135,7 +135,7 @@ public class DStoreFile extends AbstractRemoteFile implements IRemoteFile
{
parentName = pathOnly.substring(nameSep + 1);
parentPath = pathOnly.substring(0, nameSep);
if (parentPath.endsWith(":"))
if (parentPath.endsWith(":")) //$NON-NLS-1$
{
parentPath = parentPath + sep;
}
@ -143,7 +143,7 @@ public class DStoreFile extends AbstractRemoteFile implements IRemoteFile
else
{
parentName = pathOnly.substring(nameSep + 1);
parentPath = "" + sep;
parentPath = "" + sep; //$NON-NLS-1$
}
DataElement element = ds.createObject(null, IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR, parentName);

View file

@ -88,7 +88,7 @@ public class DStoreFileSubSystemSearchResultConfiguration extends DStoreSearchRe
for (int i = 0; i < results.size(); i++)
{
DataElement fileNode = (DataElement)results.get(i);
if (fileNode != null && !fileNode.getType().equals("error"))
if (fileNode != null && !fileNode.getType().equals("error")) //$NON-NLS-1$
{
IRemoteFile parentRemoteFile = null;
try
@ -140,7 +140,7 @@ public class DStoreFileSubSystemSearchResultConfiguration extends DStoreSearchRe
}
}
}
return (IRemoteFile[])_convertedResults.toArray(new IRemoteFile[_convertedResults.size()]);
return _convertedResults.toArray(new IRemoteFile[_convertedResults.size()]);
}
else
{
@ -170,7 +170,7 @@ public class DStoreFileSubSystemSearchResultConfiguration extends DStoreSearchRe
_status.getDataStore().getDomainNotifier().removeDomainListener(this);
}
else if (_status.getValue().equals("cancelled"))
else if (_status.getValue().equals("cancelled")) //$NON-NLS-1$
{
setStatus(IHostSearchConstants.CANCELLED);
_status.getDataStore().getDomainNotifier().removeDomainListener(this);