mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Do not pass an empty string.
This commit is contained in:
parent
0dc064bbd6
commit
e2482f2bc6
1 changed files with 26 additions and 17 deletions
|
@ -41,28 +41,37 @@ public class TxThread extends Thread {
|
|||
}
|
||||
|
||||
if (cmd != null) {
|
||||
// Move to the RxQueue only if RxThread is alive.
|
||||
Thread rx = session.getRxThread();
|
||||
if (rx != null && rx.isAlive()) {
|
||||
CommandQueue rxQueue = session.getRxQueue();
|
||||
rxQueue.addCommand(cmd);
|
||||
String str = cmd.toString();
|
||||
// if string is empty consider as a noop
|
||||
if (str.length() > 0) {
|
||||
// Move to the RxQueue only if RxThread is alive.
|
||||
Thread rx = session.getRxThread();
|
||||
if (rx != null && rx.isAlive()) {
|
||||
CommandQueue rxQueue = session.getRxQueue();
|
||||
rxQueue.addCommand(cmd);
|
||||
} else {
|
||||
// The RxThread is not running
|
||||
synchronized (cmd) {
|
||||
cmd.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
// Process the Command line to recognise patterns we may need to fire event.
|
||||
if (cmd instanceof CLICommand) {
|
||||
cli.process((CLICommand)cmd);
|
||||
}
|
||||
|
||||
// shove in the pipe
|
||||
if (out != null) {
|
||||
out.write(str.getBytes());
|
||||
out.flush();
|
||||
}
|
||||
} else {
|
||||
// String is empty consider as a noop
|
||||
synchronized (cmd) {
|
||||
cmd.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
// May need to fire event.
|
||||
if (cmd instanceof CLICommand) {
|
||||
cli.process((CLICommand)cmd);
|
||||
}
|
||||
|
||||
// shove in the pipe
|
||||
String str = cmd.toString();
|
||||
if (out != null && str.length() > 0) {
|
||||
out.write(str.getBytes());
|
||||
out.flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue