Program: 113480
Project: 113480
Buggy source:
public void initialize() throws IOException {
  try {
    for (; ; ) {
      try {
        registerServices(-1);
        break;
      }
 catch (      PBRPCException ex) {
        if (ex.getPOSIXErrno() == POSIXErrno.POSIX_ERROR_EAGAIN) {
          if (Logging.isInfo())           Logging.logMessage(Logging.LEVEL_INFO,Category.misc,this,"String_Node_Str",CONCURRENT_RETRY_INTERVALL);
        }
 else         throw ex;
      }
    }
    List<AddressMapping.Builder> endpoints=null;
    if ("String_Node_Str".equals(config.getHostName()) && config.getAddress() == null) {
      endpoints=NetUtils.getReachableEndpoints(config.getPort(),proto);
      if (endpoints.size() > 0)       advertisedHostName=endpoints.get(0).getAddress();
      if (advertiseUDPEndpoints) {
        endpoints.addAll(NetUtils.getReachableEndpoints(config.getPort(),Schemes.SCHEME_PBRPCU));
      }
      for (      AddressMapping.Builder endpoint : endpoints) {
        endpoint.setUuid(uuid.toString());
      }
    }
 else {
      endpoints=new ArrayList(10);
      String host="String_Node_Str".equals(config.getHostName()) ? config.getAddress().getHostName() : config.getHostName();
      if (host.startsWith("String_Node_Str")) {
        host=host.substring(1);
      }
      try {
        InetAddress ia=InetAddress.getByName(host);
      }
 catch (      Exception ex) {
        Logging.logMessage(Logging.LEVEL_WARN,this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",host);
      }
      AddressMapping.Builder tmp=AddressMapping.newBuilder().setUuid(uuid.toString()).setVersion(0).setProtocol(proto).setAddress(host).setPort(config.getPort()).setMatchNetwork("String_Node_Str").setTtlS(3600).setUri(proto + "String_Node_Str" + host+ "String_Node_Str"+ config.getPort());
      endpoints.add(tmp);
      advertisedHostName=host;
      if (advertiseUDPEndpoints) {
        tmp=AddressMapping.newBuilder().setUuid(uuid.toString()).setVersion(0).setProtocol(Schemes.SCHEME_PBRPCU).setAddress(host).setPort(config.getPort()).setMatchNetwork("String_Node_Str").setTtlS(3600).setUri(Schemes.SCHEME_PBRPCU + "String_Node_Str" + host+ "String_Node_Str"+ config.getPort());
        endpoints.add(tmp);
      }
    }
    if (Logging.isInfo()) {
      Logging.logMessage(Logging.LEVEL_INFO,Category.net,this,"String_Node_Str");
      for (      AddressMapping.Builder mapping : endpoints) {
        Logging.logMessage(Logging.LEVEL_INFO,Category.net,this,OutputUtils.addressMappingToString(mapping));
      }
    }
    long version=0;
    AddressMappingSet ams=client.xtreemfs_address_mappings_get(null,authNone,uc,uuid.toString());
    if (ams.getMappingsCount() > 0) {
      version=ams.getMappings(0).getVersion();
    }
    if (endpoints.size() > 0) {
      endpoints.get(0).setVersion(version);
    }
    AddressMappingSet.Builder amsb=AddressMappingSet.newBuilder();
    for (    AddressMapping.Builder mapping : endpoints) {
      amsb.addMappings(mapping);
    }
    client.xtreemfs_address_mappings_set(null,authNone,uc,amsb.build());
  }
 catch (  InterruptedException ex) {
  }
catch (  Exception ex) {
    Logging.logMessage(Logging.LEVEL_ERROR,this,"String_Node_Str" + ex);
    throw new IOException("String_Node_Str" + ex,ex);
  }
  try {
    this.setServiceConfiguration();
  }
 catch (  Exception e) {
    Logging.logError(Logging.LEVEL_ERROR,this,e);
  }
}

Fixed version (ground truth):
public void initialize() throws IOException {
  try {
    for (; ; ) {
      try {
        registerServices(-1);
        break;
      }
 catch (      PBRPCException ex) {
        if (ex.getPOSIXErrno() == POSIXErrno.POSIX_ERROR_EAGAIN) {
          if (Logging.isInfo())           Logging.logMessage(Logging.LEVEL_INFO,Category.misc,this,"String_Node_Str",CONCURRENT_RETRY_INTERVALL);
        }
 else         throw ex;
      }
    }
    List<AddressMapping.Builder> endpoints=null;
    if ("String_Node_Str".equals(config.getHostName()) && config.getAddress() == null) {
      endpoints=NetUtils.getReachableEndpoints(config.getPort(),proto);
      if (endpoints.size() > 0)       advertisedHostName=endpoints.get(0).getAddress();
      if (advertiseUDPEndpoints) {
        endpoints.addAll(NetUtils.getReachableEndpoints(config.getPort(),Schemes.SCHEME_PBRPCU));
      }
      for (      AddressMapping.Builder endpoint : endpoints) {
        endpoint.setUuid(uuid.toString());
      }
    }
 else {
      endpoints=new ArrayList(10);
      String host="String_Node_Str".equals(config.getHostName()) ? config.getAddress().getHostName() : config.getHostName();
      if (host.startsWith("String_Node_Str")) {
        host=host.substring(1);
      }
      try {
        InetAddress ia=InetAddress.getByName(host);
      }
 catch (      Exception ex) {
        Logging.logMessage(Logging.LEVEL_WARN,this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",host);
      }
      AddressMapping.Builder tmp=AddressMapping.newBuilder().setUuid(uuid.toString()).setVersion(0).setProtocol(proto).setAddress(host).setPort(config.getPort()).setMatchNetwork("String_Node_Str").setTtlS(3600).setUri(proto + "String_Node_Str" + host+ "String_Node_Str"+ config.getPort());
      endpoints.add(tmp);
      advertisedHostName=host;
      if (advertiseUDPEndpoints) {
        tmp=AddressMapping.newBuilder().setUuid(uuid.toString()).setVersion(0).setProtocol(Schemes.SCHEME_PBRPCU).setAddress(host).setPort(config.getPort()).setMatchNetwork("String_Node_Str").setTtlS(3600).setUri(Schemes.SCHEME_PBRPCU + "String_Node_Str" + host+ "String_Node_Str"+ config.getPort());
        endpoints.add(tmp);
      }
    }
    if (Logging.isInfo()) {
      Logging.logMessage(Logging.LEVEL_INFO,Category.net,this,"String_Node_Str");
      for (      AddressMapping.Builder mapping : endpoints) {
        Logging.logMessage(Logging.LEVEL_INFO,Category.net,this,"String_Node_Str",mapping.getUuid(),mapping.getUri());
      }
    }
    long version=0;
    AddressMappingSet ams=client.xtreemfs_address_mappings_get(null,authNone,uc,uuid.toString());
    if (ams.getMappingsCount() > 0) {
      version=ams.getMappings(0).getVersion();
    }
    if (endpoints.size() > 0) {
      endpoints.get(0).setVersion(version);
    }
    AddressMappingSet.Builder amsb=AddressMappingSet.newBuilder();
    for (    AddressMapping.Builder mapping : endpoints) {
      amsb.addMappings(mapping);
    }
    client.xtreemfs_address_mappings_set(null,authNone,uc,amsb.build());
  }
 catch (  InterruptedException ex) {
  }
catch (  Exception ex) {
    Logging.logMessage(Logging.LEVEL_ERROR,this,"String_Node_Str" + ex);
    throw new IOException("String_Node_Str" + ex,ex);
  }
  try {
    this.setServiceConfiguration();
  }
 catch (  Exception e) {
    Logging.logError(Logging.LEVEL_ERROR,this,e);
  }
}