Program: 134776
Project: 134776
Buggy source:
/** 
 * Triggers periodic calls to   {@link #flush(boolean)},  or terminates such automatic flushing if <code>periodMillisec == 0</code>. <p> All control over periodic log flushing is confined in this method. <p>  The call returns without further action if flushing is already enabled  with the same period as <code>periodMillisec</code>.
 * @param periodMillisec the delay between end of last scheduled flush() and the next scheduled flush().
 */
void setPeriodicFlushing(final int periodMillisec){
  if (!hasRemoteDispatcher()) {
    System.err.println("String_Node_Str");
    return;
  }
  if (currentFlushPeriod == periodMillisec && flushesPeriodically()) {
    return;
  }
  currentFlushPeriod=periodMillisec;
  if (flushesPeriodically()) {
    flushScheduleFuture.cancel(false);
    flushScheduleFuture=null;
    if (DEBUG && periodMillisec == 0) {
      System.out.println("String_Node_Str");
    }
  }
  if (periodMillisec > 0) {
    Runnable cmd=new Runnable(){
      public void run(){
        if (queue.size() > 0) {
          if (lastFlushFinished <= System.currentTimeMillis() - periodMillisec) {
            try {
              flush(true);
            }
 catch (            Throwable thr) {
              System.err.println("String_Node_Str" + thr.getMessage());
            }
          }
 else {
            if (DEBUG) {
              System.err.println("String_Node_Str");
            }
          }
        }
 else {
          if (DEBUG) {
            System.err.println("String_Node_Str");
          }
        }
      }
    }
;
    flushScheduleFuture=executor.scheduleWithFixedDelay(cmd,periodMillisec,periodMillisec,TimeUnit.MILLISECONDS);
  }
}

Fixed version (ground truth):
/** 
 * Triggers periodic calls to   {@link #flush(boolean)},  or terminates such automatic flushing if <code>periodMillisec == 0</code>. <p> All control over periodic log flushing is confined in this method. <p>  The call returns without further action if flushing is already enabled  with the same period as <code>periodMillisec</code>.
 * @param periodMillisec the delay between end of last scheduled flush() and the next scheduled flush().
 */
void setPeriodicFlushing(final int periodMillisec){
  if (!hasRemoteDispatcher()) {
    System.out.println("String_Node_Str");
    return;
  }
  if (currentFlushPeriod == periodMillisec && flushesPeriodically()) {
    return;
  }
  currentFlushPeriod=periodMillisec;
  if (flushesPeriodically()) {
    flushScheduleFuture.cancel(false);
    flushScheduleFuture=null;
    if (DEBUG && periodMillisec == 0) {
      System.out.println("String_Node_Str");
    }
  }
  if (periodMillisec > 0) {
    Runnable cmd=new Runnable(){
      public void run(){
        if (queue.size() > 0) {
          if (lastFlushFinished <= System.currentTimeMillis() - periodMillisec) {
            try {
              flush(true);
            }
 catch (            Throwable thr) {
              System.out.println("String_Node_Str" + thr.getMessage());
            }
          }
 else {
            if (DEBUG) {
              System.out.println("String_Node_Str");
            }
          }
        }
 else {
          if (DEBUG) {
            System.out.println("String_Node_Str");
          }
        }
      }
    }
;
    flushScheduleFuture=executor.scheduleWithFixedDelay(cmd,periodMillisec,periodMillisec,TimeUnit.MILLISECONDS);
  }
}