Program: 10824
Project: 10824
Buggy source:
public void checkRemoteLatency(final long testTime,final TimeUnit testTimeUnit,SystemMonitorManager monitor){
  String msgName=(name != null) ? "String_Node_Str" + name + "String_Node_Str" : "String_Node_Str";
  if (localChangeColor == null || remoteChangeColor == null) {
    throw new RuntimeException(msgName + "String_Node_Str" + "String_Node_Str");
  }
  try {
    final Thread waitingThread=Thread.currentThread();
    Thread t=new Thread(){
      public void run(){
        try {
          testTimeUnit.sleep(testTime);
          waitingThread.interrupt();
        }
 catch (        InterruptedException e) {
        }
      }
    }
;
    t.setDaemon(true);
    t.start();
    boolean firstTime=true;
    while (true) {
      if (!localEventLatch.tryAcquire(timeout,timeoutTimeUnit)) {
        t.interrupt();
        throw new RuntimeException(msgName + "String_Node_Str" + timeout+ "String_Node_Str"+ timeoutTimeUnit);
      }
      if (!remoteEventLatch.tryAcquire(timeout,timeoutTimeUnit)) {
        t.interrupt();
        throw new RuntimeException(msgName + "String_Node_Str" + timeout+ "String_Node_Str"+ timeoutTimeUnit);
      }
      if (firstTime) {
        firstTime=false;
      }
 else {
        long latencyMilis=lastRemoteColorChangeTime - lastLocalColorChangeTime;
        if (monitor != null) {
          monitor.addCurrentLatency(latencyMilis);
        }
        String parsedLocaltime=new SimpleDateFormat("String_Node_Str").format(lastLocalColorChangeTime);
        String parsedRemotetime=new SimpleDateFormat("String_Node_Str").format(lastRemoteColorChangeTime);
        if (lastLocalColor.equals(lastRemoteColor)) {
          LatencyRegistry LatencyRegistry=new LatencyRegistry(rgba2Color(lastRemoteColor),latencyMilis);
          if (latencyMilis > getLatencyThreshold(TimeUnit.MILLISECONDS)) {
            LatencyException latencyException=new LatencyException(latencyMilis,testTimeUnit,parsedLocaltime,parsedRemotetime,testTime,latencyMilis);
            LatencyRegistry.setLatencyException(latencyException);
            if (failIfLatencyProblem) {
              t.interrupt();
              throw latencyException;
            }
 else {
              log.warn(latencyException.getMessage());
            }
            if (monitor != null) {
              monitor.incrementLatencyErrors();
            }
          }
          latencyMap.put(lastRemoteColorChangeTime,LatencyRegistry);
        }
      }
    }
  }
 catch (  IOException e) {
    log.debug("String_Node_Str");
  }
catch (  InterruptedException e) {
    log.debug("String_Node_Str");
  }
  localColorTrigger.interrupt();
  remoteColorTrigger.interrupt();
}

Fixed version (ground truth):
public void checkRemoteLatency(final long testTime,final TimeUnit testTimeUnit,SystemMonitorManager monitor){
  String msgName=(name != null) ? "String_Node_Str" + name + "String_Node_Str" : "String_Node_Str";
  if (localChangeColor == null || remoteChangeColor == null) {
    throw new RuntimeException(msgName + "String_Node_Str" + "String_Node_Str");
  }
  try {
    final Thread waitingThread=Thread.currentThread();
    Thread t=new Thread(){
      public void run(){
        try {
          testTimeUnit.sleep(testTime);
          waitingThread.interrupt();
        }
 catch (        InterruptedException e) {
        }
      }
    }
;
    t.setDaemon(true);
    t.start();
    do {
      waitForLocalColor(msgName,t);
    }
 while (!similarColor(lastLocalColor,"String_Node_Str"));
    do {
      waitForRemoteColor(msgName,t);
    }
 while (!similarColor(lastLocalColor,"String_Node_Str"));
    while (true) {
      waitForLocalColor(msgName,t);
      waitForRemoteColor(msgName,t);
      long latencyMilis=Math.abs(lastRemoteColorChangeTimeAbsolute - lastLocalColorChangeTimeAbsolute);
      if (monitor != null) {
        monitor.addCurrentLatency(latencyMilis);
      }
      SimpleDateFormat formater=new SimpleDateFormat("String_Node_Str");
      String parsedLocaltime=formater.format(lastLocalColorChangeTimeAbsolute);
      String parsedRemotetime=formater.format(lastRemoteColorChangeTimeAbsolute);
      log.info("String_Node_Str" + "String_Node_Str" + "String_Node_Str",latencyMilis,lastLocalColor,lastRemoteColor,formater.format(lastLocalColorChangeTime),formater.format(lastRemoteColorChangeTime),parsedLocaltime,parsedRemotetime);
      if (similarColor(lastLocalColor,lastRemoteColor)) {
        log.info("String_Node_Str",latencyMilis);
        LatencyRegistry LatencyRegistry=new LatencyRegistry(rgba2Color(lastRemoteColor),latencyMilis);
        if (latencyMilis > getLatencyThreshold(TimeUnit.MILLISECONDS)) {
          LatencyException latencyException=new LatencyException(latencyMilis,testTimeUnit,parsedLocaltime,parsedRemotetime,testTime,latencyMilis);
          LatencyRegistry.setLatencyException(latencyException);
          if (failIfLatencyProblem) {
            t.interrupt();
            throw latencyException;
          }
 else {
            log.warn(latencyException.getMessage());
          }
          if (monitor != null) {
            monitor.incrementLatencyErrors();
          }
        }
        latencyMap.put(lastRemoteColorChangeTime,LatencyRegistry);
      }
    }
  }
 catch (  IOException e) {
    log.debug("String_Node_Str");
  }
catch (  InterruptedException e) {
    log.debug("String_Node_Str");
  }
  localColorTrigger.interrupt();
  remoteColorTrigger.interrupt();
}