Program: 188834
Project: 188834
Buggy source:
private AIP convertResourceToAIP(Resource resource) throws ModelServiceException {
  AIP aip;
  if (resource instanceof DefaultDirectory) {
    StoragePath storagePath=resource.getStoragePath();
    Map<String,Set<String>> metadata=resource.getMetadata();
    String parentId=ModelUtils.getString(metadata,RodaConstants.STORAGE_META_PARENT_ID);
    Boolean active=ModelUtils.getBoolean(metadata,RodaConstants.STORAGE_META_ACTIVE);
    Date dateCreated=ModelUtils.getDate(metadata,RodaConstants.STORAGE_META_DATE_CREATED);
    Date dateModified=ModelUtils.getDate(metadata,RodaConstants.STORAGE_META_DATE_MODIFIED);
    RODAObjectPermissions permissions=getPermissions(metadata);
    if (active == null) {
      active=false;
    }
    try {
      List<String> descriptiveMetadataBinaryIds=ModelUtils.getIds(storage,ModelUtils.getDescriptiveMetadataPath(storagePath.getName()));
      List<String> representationIds=ModelUtils.getIds(storage,ModelUtils.getRepresentationsPath(storagePath.getName()));
      final Map<String,List<String>> preservationRepresentationObjects=new HashMap<String,List<String>>();
      final Map<String,List<String>> preservationFileObjects=new HashMap<String,List<String>>();
      final Map<String,List<String>> preservationEvents=new HashMap<String,List<String>>();
      retrieveAIPPreservationInformation(storagePath,representationIds,preservationRepresentationObjects,preservationFileObjects,preservationEvents);
      aip=new AIP(storagePath.getName(),parentId,active,dateCreated,dateModified,permissions,descriptiveMetadataBinaryIds,representationIds,preservationRepresentationObjects,preservationEvents,preservationFileObjects);
    }
 catch (    StorageServiceException e) {
      throw new ModelServiceException("String_Node_Str",e.getCode(),e);
    }
  }
 else {
    throw new ModelServiceException("String_Node_Str" + resource + "String_Node_Str",ModelServiceException.INTERNAL_SERVER_ERROR);
  }
  return aip;
}

Fixed version (ground truth):
private AIP convertResourceToAIP(Resource resource) throws ModelServiceException {
  AIP aip;
  if (resource instanceof DefaultDirectory) {
    StoragePath storagePath=resource.getStoragePath();
    Map<String,Set<String>> metadata=resource.getMetadata();
    String parentId=ModelUtils.getString(metadata,RodaConstants.STORAGE_META_PARENT_ID);
    Boolean active=ModelUtils.getBoolean(metadata,RodaConstants.STORAGE_META_ACTIVE);
    Date dateCreated=ModelUtils.getDate(metadata,RodaConstants.STORAGE_META_DATE_CREATED);
    Date dateModified=ModelUtils.getDate(metadata,RodaConstants.STORAGE_META_DATE_MODIFIED);
    RODAObjectPermissions permissions=getPermissions(metadata);
    if (active == null) {
      active=false;
    }
    try {
      List<String> descriptiveMetadataBinaryIds=ModelUtils.getChildIds(storage,ModelUtils.getDescriptiveMetadataPath(storagePath.getName()),false);
      List<String> representationIds=ModelUtils.getChildIds(storage,ModelUtils.getRepresentationsPath(storagePath.getName()),false);
      final Map<String,List<String>> preservationRepresentationObjects=new HashMap<String,List<String>>();
      final Map<String,List<String>> preservationFileObjects=new HashMap<String,List<String>>();
      final Map<String,List<String>> preservationEvents=new HashMap<String,List<String>>();
      retrieveAIPPreservationInformation(storagePath,representationIds,preservationRepresentationObjects,preservationFileObjects,preservationEvents);
      aip=new AIP(storagePath.getName(),parentId,active,dateCreated,dateModified,permissions,descriptiveMetadataBinaryIds,representationIds,preservationRepresentationObjects,preservationEvents,preservationFileObjects);
    }
 catch (    StorageServiceException e) {
      throw new ModelServiceException("String_Node_Str",e.getCode(),e);
    }
  }
 else {
    throw new ModelServiceException("String_Node_Str" + resource + "String_Node_Str",ModelServiceException.INTERNAL_SERVER_ERROR);
  }
  return aip;
}