Program: 5493
Project: 5493
Buggy source:
private void createLocation(NamespaceMeta namespaceMeta) throws IOException {
  boolean createdHome=false;
  Location namespaceHome;
  if (hasCustomLocation(namespaceMeta)) {
    namespaceHome=validateCustomLocation(namespaceMeta);
  }
 else {
    namespaceHome=namespacedLocationFactory.get(namespaceMeta);
    if (namespaceHome.exists()) {
      throw new FileAlreadyExistsException(namespaceHome.toString());
    }
    if (!namespaceHome.mkdirs()) {
      throw new IOException(String.format("String_Node_Str",namespaceHome,namespaceMeta.getNamespaceId()));
    }
    createdHome=true;
  }
  Location namespaceData=namespaceHome.append(Constants.Dataset.DEFAULT_DATA_DIR);
  String configuredGroupName=namespaceMeta.getConfig().getGroupName();
  boolean createdData=false;
  try {
    if (createdHome) {
      String groupName=configuredGroupName != null ? configuredGroupName : UserGroupInformation.getCurrentUser().getPrimaryGroupName();
      namespaceHome.setGroup(groupName);
    }
    if (!namespaceData.mkdirs()) {
      throw new IOException(String.format("String_Node_Str",namespaceData,namespaceMeta.getNamespaceId()));
    }
    createdData=true;
    String dataGroup=configuredGroupName != null ? configuredGroupName : namespaceHome.getGroup();
    namespaceData.setGroup(dataGroup);
    if (configuredGroupName != null) {
      String permissions=namespaceData.getPermissions();
      namespaceData.setPermissions(permissions.substring(0,3) + "String_Node_Str" + permissions.substring(6));
    }
  }
 catch (  Throwable t) {
    try {
      if (createdHome) {
        namespaceHome.delete(true);
      }
 else       if (createdData) {
        namespaceData.delete(true);
      }
    }
 catch (    Throwable t1) {
      LOG.warn("String_Node_Str",namespaceHome,namespaceMeta.getNamespaceId());
      t.addSuppressed(t1);
    }
    Throwables.propagateIfInstanceOf(t,IOException.class);
    throw Throwables.propagate(t);
  }
}

Fixed version (ground truth):
private void createLocation(NamespaceMeta namespaceMeta) throws IOException {
  boolean createdHome=false;
  Location namespaceHome;
  if (hasCustomLocation(namespaceMeta)) {
    namespaceHome=validateCustomLocation(namespaceMeta);
  }
 else {
    namespaceHome=namespacedLocationFactory.get(namespaceMeta);
    if (namespaceHome.exists()) {
      throw new FileAlreadyExistsException(namespaceHome.toString());
    }
    if (!namespaceHome.mkdirs()) {
      throw new IOException(String.format("String_Node_Str",namespaceHome,namespaceMeta.getNamespaceId()));
    }
    createdHome=true;
  }
  Location namespaceData=namespaceHome.append(Constants.Dataset.DEFAULT_DATA_DIR);
  String configuredGroupName=namespaceMeta.getConfig().getGroupName();
  boolean createdData=false;
  try {
    if (createdHome && SecurityUtil.isKerberosEnabled(cConf)) {
      String groupName=configuredGroupName != null ? configuredGroupName : UserGroupInformation.getCurrentUser().getPrimaryGroupName();
      namespaceHome.setGroup(groupName);
    }
    if (!namespaceData.mkdirs()) {
      throw new IOException(String.format("String_Node_Str",namespaceData,namespaceMeta.getNamespaceId()));
    }
    createdData=true;
    if (SecurityUtil.isKerberosEnabled(cConf)) {
      String dataGroup=configuredGroupName != null ? configuredGroupName : namespaceHome.getGroup();
      namespaceData.setGroup(dataGroup);
      if (configuredGroupName != null) {
        String permissions=namespaceData.getPermissions();
        namespaceData.setPermissions(permissions.substring(0,3) + "String_Node_Str" + permissions.substring(6));
      }
    }
  }
 catch (  Throwable t) {
    try {
      if (createdHome) {
        namespaceHome.delete(true);
      }
 else       if (createdData) {
        namespaceData.delete(true);
      }
    }
 catch (    Throwable t1) {
      LOG.warn("String_Node_Str",namespaceHome,namespaceMeta.getNamespaceId());
      t.addSuppressed(t1);
    }
    Throwables.propagateIfInstanceOf(t,IOException.class);
    throw Throwables.propagate(t);
  }
}