* (non-Javadoc)
* @see org.eclipse.linuxtools.lttng.stubs.service.shells.TestCommandShell#executeCommand(java.lang.String, org.eclipse.core.runtime.IProgressMonitor, boolean)
*/
- @SuppressWarnings("nls")
@Override
public synchronized ICommandResult executeCommand(String command, IProgressMonitor monitor, boolean checkReturnValue) throws ExecutionException {
Map<String, ICommandResult> commands = fScenarioMap.get(fScenario);
+ String fullCommand = command;
Matcher matcher = LTTNG_LIST_SESSION_PATTERN.matcher(command);
if (matcher.matches() && !command.matches(LTTNG_LIST_PROVIDER_PATTERN)) {
i = 0;
}
fSessionNameMap.put(sessionName, i);
- command += String.valueOf(i);
+ fullCommand += String.valueOf(i);
}
- if (commands.containsKey(command)) {
- return commands.get(command);
+ if (commands.containsKey(fullCommand)) {
+ return commands.get(fullCommand);
}
String[] output = new String[1];
- output[0] = String.valueOf("Command not found");
+ output[0] = String.valueOf("Command not found"); //$NON-NLS-1$
CommandResult result = new CommandResult(0, null);
// For verification of setters of class CommandResult
result.setOutput(output);