Program: 4728
Project: 4728
Buggy source:
/** 
 * @param truncating whether this call to create() is part of a truncate() operation. The effect is:If possessExisting is true, then the truncate() has just dropped this dataset and that deleted the base directory: we must recreate it.
 */
private void create(boolean truncating) throws IOException {
  if (isExternal) {
    validateExists(FileSetProperties.DATA_EXTERNAL);
  }
 else   if (useExisting) {
    validateExists(FileSetProperties.DATA_USE_EXISTING);
  }
 else   if (!truncating && possessExisting) {
    validateExists(FileSetProperties.DATA_POSSESS_EXISTING);
  }
 else {
    if (exists()) {
      throw new IOException(String.format("String_Node_Str",spec.getName(),baseLocation));
    }
    String permissions=FileSetProperties.getFilePermissions(spec.getProperties());
    String group=FileSetProperties.getFileGroup(spec.getProperties());
    if (group == null) {
      String[] groups=UserGroupInformation.getCurrentUser().getGroupNames();
      if (groups.length > 0) {
        group=groups[0];
      }
    }
    Location ancestor=baseLocation;
    Location firstDirToCreate=null;
    while (ancestor != null && !ancestor.exists()) {
      firstDirToCreate=ancestor;
      ancestor=Locations.getParent(ancestor);
    }
    if (firstDirToCreate != null) {
      if (null == permissions) {
        firstDirToCreate.mkdirs();
      }
 else {
        firstDirToCreate.mkdirs(permissions);
      }
      if (group != null) {
        try {
          firstDirToCreate.setGroup(group);
        }
 catch (        Exception e) {
          LOG.warn("String_Node_Str",group,firstDirToCreate.toURI().toString(),spec.getName(),e.getMessage());
        }
      }
      if (null == permissions) {
        baseLocation.mkdirs();
      }
 else {
        baseLocation.mkdirs(permissions);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void create() throws IOException {
  if (isExternal) {
    validateExists(FileSetProperties.DATA_EXTERNAL);
  }
 else   if (useExisting) {
    validateExists(FileSetProperties.DATA_USE_EXISTING);
  }
 else   if (possessExisting) {
    validateExists(FileSetProperties.DATA_POSSESS_EXISTING);
  }
 else {
    if (exists()) {
      throw new IOException(String.format("String_Node_Str",spec.getName(),baseLocation));
    }
    String permissions=FileSetProperties.getFilePermissions(spec.getProperties());
    String group=FileSetProperties.getFileGroup(spec.getProperties());
    if (group == null) {
      String[] groups=UserGroupInformation.getCurrentUser().getGroupNames();
      if (groups.length > 0) {
        group=groups[0];
      }
    }
    Location ancestor=baseLocation;
    Location firstDirToCreate=null;
    while (ancestor != null && !ancestor.exists()) {
      firstDirToCreate=ancestor;
      ancestor=Locations.getParent(ancestor);
    }
    if (firstDirToCreate != null) {
      if (null == permissions) {
        firstDirToCreate.mkdirs();
      }
 else {
        firstDirToCreate.mkdirs(permissions);
      }
      if (group != null) {
        try {
          firstDirToCreate.setGroup(group);
        }
 catch (        Exception e) {
          LOG.warn("String_Node_Str",group,firstDirToCreate.toURI().toString(),spec.getName(),e.getMessage());
        }
      }
      if (null == permissions) {
        baseLocation.mkdirs();
      }
 else {
        baseLocation.mkdirs(permissions);
      }
    }
  }
}