Program: 113811
Project: 113811
Buggy source:
private void checkForTimers(){
  long now=TimeSync.getLocalSystemTime();
  if (now >= lastCheck + TIMEOUT_GRANULARITY) {
synchronized (connections) {
      Iterator<ServerConnection> conIter=connections.values().iterator();
      while (conIter.hasNext()) {
        final ServerConnection con=conIter.next();
        if (con.getLastUsed() < (TimeSync.getLocalSystemTime() - connectionTimeout)) {
          if (Logging.isDebug()) {
            Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str");
          }
          try {
            conIter.remove();
            closeConnection(con.getChannel().keyFor(selector),null);
          }
 catch (          Exception ex) {
          }
        }
 else {
          List<ONCRPCRequest> cancelRq=new LinkedList();
synchronized (con) {
            Iterator<ONCRPCRequest> iter=con.getRequests().values().iterator();
            while (iter.hasNext()) {
              final ONCRPCRequest rq=iter.next();
              if (rq.getTimeQueued() + requestTimeout < TimeSync.getLocalSystemTime()) {
                cancelRq.add(rq);
                iter.remove();
              }
            }
            iter=con.getSendQueue().iterator();
            while (iter.hasNext()) {
              final ONCRPCRequest rq=iter.next();
              if (rq.getTimeQueued() + requestTimeout < TimeSync.getLocalSystemTime()) {
                cancelRq.add(rq);
                iter.remove();
              }
 else {
                break;
              }
            }
          }
          for (          ONCRPCRequest rq : cancelRq) {
            rq.getListener().requestFailed(rq,new IOException("String_Node_Str"));
          }
        }
      }
      lastCheck=now;
    }
  }
}

Fixed version (ground truth):
private void checkForTimers(){
  long now=System.currentTimeMillis();
  if (now >= lastCheck + TIMEOUT_GRANULARITY) {
synchronized (connections) {
      Iterator<ServerConnection> conIter=connections.values().iterator();
      while (conIter.hasNext()) {
        final ServerConnection con=conIter.next();
        if (con.getLastUsed() < (now - connectionTimeout)) {
          if (Logging.isDebug()) {
            Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str");
          }
          try {
            conIter.remove();
            closeConnection(con.getChannel().keyFor(selector),null);
          }
 catch (          Exception ex) {
          }
        }
 else {
          List<ONCRPCRequest> cancelRq=new LinkedList();
synchronized (con) {
            Iterator<ONCRPCRequest> iter=con.getRequests().values().iterator();
            while (iter.hasNext()) {
              final ONCRPCRequest rq=iter.next();
              if (rq.getTimeQueued() + requestTimeout < now) {
                cancelRq.add(rq);
                iter.remove();
              }
            }
            iter=con.getSendQueue().iterator();
            while (iter.hasNext()) {
              final ONCRPCRequest rq=iter.next();
              if (rq.getTimeQueued() + requestTimeout < now) {
                cancelRq.add(rq);
                iter.remove();
              }
 else {
                break;
              }
            }
          }
          for (          ONCRPCRequest rq : cancelRq) {
            rq.getListener().requestFailed(rq,new IOException("String_Node_Str"));
          }
        }
      }
      lastCheck=now;
    }
  }
}