Program: 134798
Project: 134798
Buggy source:
/** 
 * Shuts down this thread loop runner,  attempting to gracefully stop the running task if   {@link CancelableRunnable} was provided,or otherwise letting the currently running loop action finish. <p> The <code>ThreadLoopRunner</code> cannot be used any more after this method has been called. (Then  {@link #isDisabled()} will return <code>true</code>, other methods will throw IllegalStateException.)<p> The <code>timeout</code> refers to how long this method waits for the task to terminate. If it terminates before the given timeout, then <code>true</code> is returned, otherwise <code>false</code> which means that the Runnable action object is still in use and should not be reused later unless it is  re-entrant.
 * @param timeout
 * @param unit
 * @return true if loop action terminated before the given timeout, or if the loop was not running.
 * @throws InterruptedException
 * @throws IllegalStateException if called after shutdown. 
 */
public boolean shutdown(long timeout,TimeUnit unit) throws InterruptedException {
  if (isDefunct.getAndSet(true)) {
    throw new IllegalStateException("String_Node_Str" + loopName + "String_Node_Str");
  }
  loopLock.lock();
  try {
    if (isLoopRunning()) {
      loop.cancel(false);
      loop=null;
      taskWrapper.attemptCancelTask();
      runner.shutdown();
      logger.finest("String_Node_Str" + loopName + "String_Node_Str");
    }
 else {
      logger.finer("String_Node_Str" + loopName + "String_Node_Str");
      return true;
    }
  }
  finally {
    loopLock.unlock();
  }
  boolean ret=runner.awaitTermination(timeout,unit);
  logger.finer("String_Node_Str" + loopName + "String_Node_Str"+ (ret ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ timeout+ "String_Node_Str"+ unit.toString().toLowerCase());
  Thread.currentThread().sleep(2);
  return ret;
}

Fixed version (ground truth):
/** 
 * Shuts down this thread loop runner,  attempting to gracefully stop the running task if   {@link CancelableRunnable} was provided,or otherwise letting the currently running loop action finish. <p> The <code>ThreadLoopRunner</code> cannot be used any more after this method has been called. (Then  {@link #isDisabled()} will return <code>true</code>, other methods will throw IllegalStateException.)<p> The <code>timeout</code> refers to how long this method waits for the task to terminate. If it terminates before the given timeout, then <code>true</code> is returned, otherwise <code>false</code> which means that the Runnable action object is still in use and should not be reused later unless it is  re-entrant.
 * @param timeout
 * @param unit
 * @return true if loop action terminated before the given timeout, or if the loop was not running.
 * @throws InterruptedException
 * @throws IllegalStateException if called after shutdown. 
 */
public boolean shutdown(long timeout,TimeUnit unit) throws InterruptedException {
  if (isDefunct.getAndSet(true)) {
    throw new IllegalStateException("String_Node_Str" + loopName + "String_Node_Str");
  }
  loopLock.lock();
  try {
    if (isLoopRunning()) {
      loop.cancel(false);
      loop=null;
      taskWrapper.attemptCancelTask();
      runner.shutdown();
      logger.finest("String_Node_Str" + loopName + "String_Node_Str");
    }
 else {
      logger.finer("String_Node_Str" + loopName + "String_Node_Str");
      return true;
    }
  }
  finally {
    loopLock.unlock();
  }
  boolean ret=runner.awaitTermination(timeout,unit);
  logger.finer("String_Node_Str" + loopName + "String_Node_Str"+ (ret ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ timeout+ "String_Node_Str"+ unit.toString().toLowerCase());
  Thread.sleep(2);
  return ret;
}