if (event != null) {
throw event;
}
if (!expectingInput) {
throw new TimeoutException(
<BUG>"timeout of '"

+ timeout</BUG>
+ "' msec exceeded while waiting for expected input");
}

if (event != null) {
throw event;
}
