Program: 113578
Project: 113578
Buggy source:
public void run(){
  List<RPCResponse> responses=new LinkedList<RPCResponse>();
  Map<String,Long> verMap=new HashMap<String,Long>();
  notifyStarted();
  while (!quit) {
synchronized (this) {
      responses.clear();
      try {
        for (        Service reg : serviceDataGen.getServiceData()) {
          RPCResponse<ServiceSet> r1=client.xtreemfs_service_get_by_uuid(null,reg.getUuid());
          long currentVersion=0;
          responses.add(r1);
          ServiceSet olset=r1.get();
          if (olset.size() > 0) {
            currentVersion=olset.get(0).getVersion();
          }
          reg.setVersion(currentVersion);
          RPCResponse<Long> r2=client.xtreemfs_service_register(null,reg);
          responses.add(r2);
          r2.get();
          if (Logging.isDebug())           Logging.logMessage(Logging.LEVEL_DEBUG,Category.misc,this,"String_Node_Str",uuid);
        }
      }
 catch (      IOException ex) {
        Logging.logError(Logging.LEVEL_ERROR,this,ex);
      }
catch (      ONCRPCException ex) {
        Logging.logError(Logging.LEVEL_ERROR,this,ex);
      }
catch (      InterruptedException ex) {
        quit=true;
        break;
      }
 finally {
        for (        RPCResponse resp : responses)         resp.freeBuffers();
      }
      if (quit)       break;
    }
    try {
      Thread.sleep(UPDATE_INTERVAL);
    }
 catch (    InterruptedException e) {
    }
  }
  notifyStopped();
}

Fixed version (ground truth):
public void run(){
  List<RPCResponse> responses=new LinkedList<RPCResponse>();
  Map<String,Long> verMap=new HashMap<String,Long>();
  notifyStarted();
  while (!quit) {
synchronized (this) {
      responses.clear();
      try {
        for (        Service reg : serviceDataGen.getServiceData()) {
          RPCResponse<ServiceSet> r1=null;
          RPCResponse<Long> r2=null;
          try {
            r1=client.xtreemfs_service_get_by_uuid(null,reg.getUuid());
            long currentVersion=0;
            responses.add(r1);
            ServiceSet olset=r1.get();
            if (olset.size() > 0) {
              currentVersion=olset.get(0).getVersion();
            }
            reg.setVersion(currentVersion);
            r2=client.xtreemfs_service_register(null,reg);
            responses.add(r2);
            r2.get();
            if (Logging.isDebug())             Logging.logMessage(Logging.LEVEL_DEBUG,Category.misc,this,"String_Node_Str",uuid);
          }
  finally {
            if (r1 != null) {
              r1.freeBuffers();
            }
            if (r2 != null) {
              r2.freeBuffers();
            }
          }
        }
      }
 catch (      IOException ex) {
        Logging.logError(Logging.LEVEL_ERROR,this,ex);
      }
catch (      ONCRPCException ex) {
        Logging.logError(Logging.LEVEL_ERROR,this,ex);
      }
catch (      InterruptedException ex) {
        quit=true;
        break;
      }
 finally {
        for (        RPCResponse resp : responses)         resp.freeBuffers();
      }
      if (quit)       break;
    }
    try {
      Thread.sleep(UPDATE_INTERVAL);
    }
 catch (    InterruptedException e) {
    }
  }
  notifyStopped();
}