Program: 113849
Project: 113849
Buggy source:
public void run(){
  List<RPCResponse> responses=new LinkedList<RPCResponse>();
  Map<String,Long> verMap=new HashMap<String,Long>();
  try {
    for (    Entry<String,Map<String,Object>> mapEntry : serviceDataGen.getServiceData().entrySet()) {
      if (!"String_Node_Str".equals(mapEntry.getValue().get("String_Node_Str"))) {
        RPCResponse r=client.deregisterEntity(mapEntry.getKey(),authString);
        r.waitForResponse();
        responses.add(r);
      }
      registerEntity(mapEntry.getKey(),mapEntry.getValue(),verMap,authString,responses);
      if (Logging.isDebug())       Logging.logMessage(Logging.LEVEL_DEBUG,this,uuid + "String_Node_Str");
    }
    List<Map<String,Object>> endpoints=null;
    if (config.getAddress() == null) {
      endpoints=NetUtils.getReachableEndpoints(uuid.getAddress().getPort(),uuid.getProtocol());
    }
 else {
      endpoints=new ArrayList(1);
      Map<String,Object> m=RPCClient.generateMap("String_Node_Str",config.getAddress().toString(),"String_Node_Str",uuid.getAddress().getPort(),"String_Node_Str",uuid.getProtocol(),"String_Node_Str",3600,"String_Node_Str","String_Node_Str");
      endpoints.add(m);
    }
    long version=0;
    RPCResponse r2=client.getAddressMapping(uuid.toString(),authString);
    try {
      Map<String,List<Object>> result=(Map<String,List<Object>>)r2.get();
      Collection<Entry<String,List<Object>>> entries=result.entrySet();
      if (entries.size() != 0) {
        List<Object> valueList=entries.iterator().next().getValue();
        version=(Long)valueList.get(0);
      }
    }
  finally {
      responses.add(r2);
    }
    RPCResponse r3=client.registerAddressMapping(uuid.toString(),endpoints,version,authString);
    try {
      r3.waitForResponse();
    }
  finally {
      responses.add(r3);
    }
  }
 catch (  Exception ex) {
    Logging.logMessage(Logging.LEVEL_ERROR,this,"String_Node_Str" + OutputUtils.stackTraceToString(ex));
    notifyCrashed(ex);
  }
 finally {
    for (    RPCResponse resp : responses)     resp.freeBuffers();
  }
  notifyStarted();
  while (!quit) {
    responses.clear();
    try {
      for (      Entry<String,Map<String,Object>> mapEntry : serviceDataGen.getServiceData().entrySet()) {
        registerEntity(mapEntry.getKey(),mapEntry.getValue(),verMap,authString,responses);
        if (Logging.isDebug())         Logging.logMessage(Logging.LEVEL_DEBUG,this,uuid + "String_Node_Str");
      }
    }
 catch (    IOException ex) {
      Logging.logMessage(Logging.LEVEL_ERROR,this,ex);
    }
catch (    JSONException ex) {
      Logging.logMessage(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>();
  try {
    for (    Entry<String,Map<String,Object>> mapEntry : serviceDataGen.getServiceData().entrySet()) {
      if (!"String_Node_Str".equals(mapEntry.getValue().get("String_Node_Str"))) {
        RPCResponse r=client.deregisterEntity(mapEntry.getKey(),authString);
        r.waitForResponse();
        responses.add(r);
      }
      registerEntity(mapEntry.getKey(),mapEntry.getValue(),verMap,authString,responses);
      if (Logging.isDebug())       Logging.logMessage(Logging.LEVEL_DEBUG,this,uuid + "String_Node_Str");
    }
    List<Map<String,Object>> endpoints=null;
    if (config.getAddress() == null) {
      endpoints=NetUtils.getReachableEndpoints(uuid.getAddress().getPort(),uuid.getProtocol());
    }
 else {
      endpoints=new ArrayList(1);
      String dottedQuad=config.getAddress().toString();
      if (dottedQuad.startsWith("String_Node_Str"))       dottedQuad=dottedQuad.substring(1);
      Map<String,Object> m=RPCClient.generateMap("String_Node_Str",dottedQuad,"String_Node_Str",uuid.getAddress().getPort(),"String_Node_Str",uuid.getProtocol(),"String_Node_Str",3600,"String_Node_Str","String_Node_Str");
      endpoints.add(m);
    }
    long version=0;
    RPCResponse r2=client.getAddressMapping(uuid.toString(),authString);
    try {
      Map<String,List<Object>> result=(Map<String,List<Object>>)r2.get();
      Collection<Entry<String,List<Object>>> entries=result.entrySet();
      if (entries.size() != 0) {
        List<Object> valueList=entries.iterator().next().getValue();
        version=(Long)valueList.get(0);
      }
    }
  finally {
      responses.add(r2);
    }
    RPCResponse r3=client.registerAddressMapping(uuid.toString(),endpoints,version,authString);
    try {
      r3.waitForResponse();
    }
  finally {
      responses.add(r3);
    }
  }
 catch (  Exception ex) {
    Logging.logMessage(Logging.LEVEL_ERROR,this,"String_Node_Str" + OutputUtils.stackTraceToString(ex));
    notifyCrashed(ex);
  }
 finally {
    for (    RPCResponse resp : responses)     resp.freeBuffers();
  }
  notifyStarted();
  while (!quit) {
    responses.clear();
    try {
      for (      Entry<String,Map<String,Object>> mapEntry : serviceDataGen.getServiceData().entrySet()) {
        registerEntity(mapEntry.getKey(),mapEntry.getValue(),verMap,authString,responses);
        if (Logging.isDebug())         Logging.logMessage(Logging.LEVEL_DEBUG,this,uuid + "String_Node_Str");
      }
    }
 catch (    IOException ex) {
      Logging.logMessage(Logging.LEVEL_ERROR,this,ex);
    }
catch (    JSONException ex) {
      Logging.logMessage(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();
}