Program: 89737
Project: 89737
Buggy source:
protected SR getNfsSR(Connection conn,StorageFilerTO pool){
  Map<String,String> deviceConfig=new HashMap<String,String>();
  try {
    String server=pool.getHost();
    String serverpath=pool.getPath();
    serverpath=serverpath.replace("String_Node_Str","String_Node_Str");
    Set<SR> srs=SR.getAll(conn);
    for (    SR sr : srs) {
      if (!SRType.NFS.equals(sr.getType(conn))) {
        continue;
      }
      Set<PBD> pbds=sr.getPBDs(conn);
      if (pbds.isEmpty()) {
        continue;
      }
      PBD pbd=pbds.iterator().next();
      Map<String,String> dc=pbd.getDeviceConfig(conn);
      if (dc == null) {
        continue;
      }
      if (dc.get("String_Node_Str") == null) {
        continue;
      }
      if (dc.get("String_Node_Str") == null) {
        continue;
      }
      if (server.equals(dc.get("String_Node_Str")) && serverpath.equals(dc.get("String_Node_Str"))) {
        if (checkSR(conn,sr)) {
          return sr;
        }
        throw new CloudRuntimeException("String_Node_Str" + pool.getUuid() + "String_Node_Str"+ _host.uuid);
      }
    }
    deviceConfig.put("String_Node_Str",server);
    deviceConfig.put("String_Node_Str",serverpath);
    Host host=Host.getByUuid(conn,_host.uuid);
    SR sr=SR.create(conn,host,deviceConfig,new Long(0),pool.getUuid(),Long.toString(pool.getId()),SRType.NFS.toString(),"String_Node_Str",true,new HashMap<String,String>());
    sr.scan(conn);
    return sr;
  }
 catch (  XenAPIException e) {
    throw new CloudRuntimeException("String_Node_Str" + pool.toString(),e);
  }
catch (  XmlRpcException e) {
    throw new CloudRuntimeException("String_Node_Str" + pool.toString(),e);
  }
}

Fixed version (ground truth):
protected SR getNfsSR(Connection conn,StorageFilerTO pool){
  Map<String,String> deviceConfig=new HashMap<String,String>();
  try {
    String server=pool.getHost();
    String serverpath=pool.getPath();
    serverpath=serverpath.replace("String_Node_Str","String_Node_Str");
    Set<SR> srs=SR.getAll(conn);
    for (    SR sr : srs) {
      if (!SRType.NFS.equals(sr.getType(conn))) {
        continue;
      }
      Set<PBD> pbds=sr.getPBDs(conn);
      if (pbds.isEmpty()) {
        continue;
      }
      PBD pbd=pbds.iterator().next();
      Map<String,String> dc=pbd.getDeviceConfig(conn);
      if (dc == null) {
        continue;
      }
      if (dc.get("String_Node_Str") == null) {
        continue;
      }
      if (dc.get("String_Node_Str") == null) {
        continue;
      }
      if (server.equals(dc.get("String_Node_Str")) && serverpath.equals(dc.get("String_Node_Str"))) {
        throw new CloudRuntimeException("String_Node_Str" + dc.get("String_Node_Str") + "String_Node_Str"+ dc.get("String_Node_Str")+ "String_Node_Str"+ pool.getUuid()+ "String_Node_Str"+ _host.uuid);
      }
    }
    deviceConfig.put("String_Node_Str",server);
    deviceConfig.put("String_Node_Str",serverpath);
    Host host=Host.getByUuid(conn,_host.uuid);
    SR sr=SR.create(conn,host,deviceConfig,new Long(0),pool.getUuid(),Long.toString(pool.getId()),SRType.NFS.toString(),"String_Node_Str",true,new HashMap<String,String>());
    sr.scan(conn);
    return sr;
  }
 catch (  XenAPIException e) {
    throw new CloudRuntimeException("String_Node_Str" + pool.toString(),e);
  }
catch (  XmlRpcException e) {
    throw new CloudRuntimeException("String_Node_Str" + pool.toString(),e);
  }
}