Program: 55254
Project: 55254
Buggy source:
/** 
 * Sends an RPC request to the given   {@link InetSocketAddress}.
 * @param remoteSocketAddress the remote address to send the request to
 * @param request the RPC request to send
 * @return the return value of the RPC call, possibly <code>null</code>
 * @throws Throwable any exception that is thrown by the remote receiver of the RPC call
 */
Object sendRPCRequest(final InetSocketAddress remoteSocketAddress,final RPCRequest request) throws Throwable {
  if (this.shutdownRequested.get()) {
    throw new IOException("String_Node_Str");
  }
  DatagramPacket[] packets=messageToPackets(remoteSocketAddress,request);
  final Integer messageID=Integer.valueOf(request.getMessageID());
  final RPCRequestMonitor requestMonitor=new RPCRequestMonitor();
  this.pendingRequests.put(messageID,requestMonitor);
  for (int i=0; i < RETRY_LIMIT; ++i) {
    sendPackets(packets);
    RPCResponse rpcResponse;
    try {
synchronized (requestMonitor) {
        if (requestMonitor.rpcResponse == null) {
          requestMonitor.wait(this.statistics.calculateTimeout(packets.length,i));
        }
        rpcResponse=requestMonitor.rpcResponse;
      }
    }
 catch (    InterruptedException ie) {
      Log.debug("String_Node_Str",ie);
      return null;
    }
    if (rpcResponse == null) {
      Log.debug("String_Node_Str" + request.getMessageID());
      continue;
    }
    this.pendingRequests.remove(messageID);
    this.statistics.reportSuccessfulCall(request.getMethodName(),packets.length,i);
    packets=messageToPackets(remoteSocketAddress,new RPCCleanup(request.getMessageID()));
    sendPackets(packets);
    if (rpcResponse instanceof RPCReturnValue) {
      return ((RPCReturnValue)rpcResponse).getRetVal();
    }
    throw ((RPCThrowable)rpcResponse).getThrowable();
  }
  this.pendingRequests.remove(messageID);
  throw new IOException("String_Node_Str" + request.getMethodName() + "String_Node_Str"+ remoteSocketAddress);
}

Fixed version (ground truth):
/** 
 * Sends an RPC request to the given   {@link InetSocketAddress}.
 * @param remoteSocketAddress the remote address to send the request to
 * @param request the RPC request to send
 * @return the return value of the RPC call, possibly <code>null</code>
 * @throws Throwable any exception that is thrown by the remote receiver of the RPC call
 */
Object sendRPCRequest(final InetSocketAddress remoteSocketAddress,final RPCRequest request) throws Throwable {
  if (this.shutdownRequested.get()) {
    throw new IOException("String_Node_Str");
  }
  DatagramPacket[] packets=messageToPackets(remoteSocketAddress,request);
  final Integer messageID=Integer.valueOf(request.getMessageID());
  final RPCRequestMonitor requestMonitor=new RPCRequestMonitor();
  this.pendingRequests.put(messageID,requestMonitor);
  for (int i=0; i < RETRY_LIMIT; ++i) {
    sendPackets(packets);
    RPCResponse rpcResponse;
    try {
synchronized (requestMonitor) {
        if (requestMonitor.rpcResponse == null) {
          requestMonitor.wait(this.statistics.calculateTimeout(packets.length,i));
        }
        rpcResponse=requestMonitor.rpcResponse;
      }
    }
 catch (    InterruptedException ie) {
      Log.debug("String_Node_Str",ie);
      return null;
    }
    if (rpcResponse == null) {
      Log.debug("String_Node_Str" + request.getMessageID());
      continue;
    }
    this.pendingRequests.remove(messageID);
    this.statistics.reportSuccessfulCall(request.getMethodName(),packets.length,i);
    if (i == 0) {
      packets=messageToPackets(remoteSocketAddress,new RPCCleanup(request.getMessageID()));
      sendPackets(packets);
    }
    if (rpcResponse instanceof RPCReturnValue) {
      return ((RPCReturnValue)rpcResponse).getRetVal();
    }
    throw ((RPCThrowable)rpcResponse).getThrowable();
  }
  this.pendingRequests.remove(messageID);
  throw new IOException("String_Node_Str" + request.getMethodName() + "String_Node_Str"+ remoteSocketAddress);
}