Program: 107202
Project: 107202
Buggy source:
protected Map<? extends ServerResource,Map<String,String>> createNfsSecondaryStorageResource(long dcId,Long podId,URI uri){
  String mountStr=NfsUtils.uri2Mount(uri);
  Script script=new Script(true,"String_Node_Str",_timeout,s_logger);
  String mntPoint=null;
  File file=null;
  do {
    mntPoint=_mountParent + File.separator + Integer.toHexString(_random.nextInt(Integer.MAX_VALUE));
    file=new File(mntPoint);
  }
 while (file.exists());
  if (!file.mkdirs()) {
    s_logger.warn("String_Node_Str" + mntPoint);
    return null;
  }
  script.add(mountStr,mntPoint);
  String result=script.execute();
  if (result != null && !result.contains("String_Node_Str")) {
    s_logger.warn("String_Node_Str" + uri.toString() + "String_Node_Str"+ result);
    file.delete();
    return null;
  }
  script=new Script(true,"String_Node_Str",0,s_logger);
  script.add(mntPoint);
  script.execute();
  file.delete();
  if (_useServiceVM) {
    return createDummySecondaryStorageResource(dcId,podId,uri);
  }
  Map<NfsSecondaryStorageResource,Map<String,String>> srs=new HashMap<NfsSecondaryStorageResource,Map<String,String>>();
  NfsSecondaryStorageResource storage=new NfsSecondaryStorageResource();
  Map<String,String> details=new HashMap<String,String>();
  details.put("String_Node_Str",mountStr);
  details.put("String_Node_Str",uri.toString());
  details.put("String_Node_Str",_mountParent);
  Map<String,Object> params=new HashMap<String,Object>();
  params.putAll(details);
  params.put("String_Node_Str",Long.toString(dcId));
  if (podId != null) {
    params.put("String_Node_Str",podId.toString());
  }
  params.put("String_Node_Str",uri.toString());
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str",_configDao.getValue("String_Node_Str"));
  try {
    storage.configure("String_Node_Str",params);
  }
 catch (  ConfigurationException e) {
    s_logger.warn("String_Node_Str",e);
    return null;
  }
  srs.put(storage,details);
  return srs;
}

Fixed version (ground truth):
protected Map<? extends ServerResource,Map<String,String>> createNfsSecondaryStorageResource(long dcId,Long podId,URI uri){
  if (_useServiceVM) {
    return createDummySecondaryStorageResource(dcId,podId,uri);
  }
  String mountStr=NfsUtils.uri2Mount(uri);
  Script script=new Script(true,"String_Node_Str",_timeout,s_logger);
  String mntPoint=null;
  File file=null;
  do {
    mntPoint=_mountParent + File.separator + Integer.toHexString(_random.nextInt(Integer.MAX_VALUE));
    file=new File(mntPoint);
  }
 while (file.exists());
  if (!file.mkdirs()) {
    s_logger.warn("String_Node_Str" + mntPoint);
    return null;
  }
  script.add(mountStr,mntPoint);
  String result=script.execute();
  if (result != null && !result.contains("String_Node_Str")) {
    s_logger.warn("String_Node_Str" + uri.toString() + "String_Node_Str"+ result);
    file.delete();
    return null;
  }
  script=new Script(true,"String_Node_Str",0,s_logger);
  script.add(mntPoint);
  script.execute();
  file.delete();
  Map<NfsSecondaryStorageResource,Map<String,String>> srs=new HashMap<NfsSecondaryStorageResource,Map<String,String>>();
  NfsSecondaryStorageResource storage=new NfsSecondaryStorageResource();
  Map<String,String> details=new HashMap<String,String>();
  details.put("String_Node_Str",mountStr);
  details.put("String_Node_Str",uri.toString());
  details.put("String_Node_Str",_mountParent);
  Map<String,Object> params=new HashMap<String,Object>();
  params.putAll(details);
  params.put("String_Node_Str",Long.toString(dcId));
  if (podId != null) {
    params.put("String_Node_Str",podId.toString());
  }
  params.put("String_Node_Str",uri.toString());
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str",_configDao.getValue("String_Node_Str"));
  try {
    storage.configure("String_Node_Str",params);
  }
 catch (  ConfigurationException e) {
    s_logger.warn("String_Node_Str",e);
    return null;
  }
  srs.put(storage,details);
  return srs;
}