Program: 188489
Project: 188489
Buggy source:
@Override public Report execute(IndexService index,ModelService model,StorageService storage,List<LiteOptionalWithCause> liteList) throws PluginException {
  boolean validateDescriptiveMetadata=PluginHelper.getBooleanFromParameters(this,PARAMETER_VALIDATE_DESCRIPTIVE_METADATA);
  boolean validatePremis=PluginHelper.getBooleanFromParameters(this,PARAMETER_VALIDATE_PREMIS);
  boolean forceDescriptiveMetadataType=PluginHelper.getBooleanFromParameters(this,PARAMETER_FORCE_DESCRIPTIVE_METADATA_TYPE);
  String metadataType=PluginHelper.getStringFromParameters(this,PARAMETER_METADATA_TYPE);
  String metadataVersion=PluginHelper.getStringFromParameters(this,PARAMETER_METADATA_VERSION);
  Report pluginReport=PluginHelper.initPluginReport(this);
  List<ValidationReport> reports=new ArrayList<ValidationReport>();
  try {
    SimpleJobPluginInfo jobPluginInfo=PluginHelper.getInitialJobInformation(this,liteList.size());
    PluginHelper.updateJobInformation(this,jobPluginInfo);
    List<AIP> list=PluginHelper.transformLitesIntoObjects(model,index,this,pluginReport,jobPluginInfo,liteList);
    try {
      for (      AIP aip : list) {
        Report reportItem=PluginHelper.initPluginReportItem(this,aip.getId(),AIP.class,AIPState.INGEST_PROCESSING);
        PluginHelper.updatePartialJobReport(this,model,index,reportItem,false);
        PluginState state=PluginState.SUCCESS;
        try {
          LOGGER.debug("String_Node_Str",aip.getId());
          ValidationReport report=ValidationUtils.isAIPMetadataValid(forceDescriptiveMetadataType,validateDescriptiveMetadata,metadataType,metadataVersion,validatePremis,model,aip.getId());
          reports.add(report);
          if (report.isValid()) {
            reportItem.setPluginState(state);
          }
 else {
            state=PluginState.FAILURE;
            reportItem.setPluginState(state).setHtmlPluginDetails(true).setPluginDetails(report.toHtml(false,false));
          }
        }
 catch (        RODAException mse) {
          state=PluginState.FAILURE;
          LOGGER.error("String_Node_Str" + aip.getId() + "String_Node_Str"+ mse.getMessage(),mse);
        }
        try {
          boolean notify=true;
          createEvent(aip,model,index,reportItem.getPluginState(),notify);
          jobPluginInfo.incrementObjectsProcessed(state);
          pluginReport.addReport(reportItem);
          PluginHelper.updatePartialJobReport(this,model,index,reportItem,true);
        }
 catch (        PluginException|RuntimeException e) {
          LOGGER.error("String_Node_Str",e);
        }
      }
    }
 catch (    ClassCastException e) {
      LOGGER.error("String_Node_Str");
      jobPluginInfo.incrementObjectsProcessedWithFailure(list.size());
    }
    jobPluginInfo.finalizeInfo();
    PluginHelper.updateJobInformation(this,jobPluginInfo);
  }
 catch (  JobException e) {
    throw new PluginException("String_Node_Str",e);
  }
  return pluginReport;
}

Fixed version (ground truth):
@Override public Report execute(IndexService index,ModelService model,StorageService storage,List<LiteOptionalWithCause> liteList) throws PluginException {
  boolean validateDescriptiveMetadata=PluginHelper.getBooleanFromParameters(this,PARAMETER_VALIDATE_DESCRIPTIVE_METADATA);
  boolean validatePremis=PluginHelper.getBooleanFromParameters(this,PARAMETER_VALIDATE_PREMIS);
  boolean forceDescriptiveMetadataType=PluginHelper.getBooleanFromParameters(this,PARAMETER_FORCE_DESCRIPTIVE_METADATA_TYPE);
  String metadataType=PluginHelper.getStringFromParameters(this,PARAMETER_METADATA_TYPE);
  String metadataVersion=PluginHelper.getStringFromParameters(this,PARAMETER_METADATA_VERSION);
  Report pluginReport=PluginHelper.initPluginReport(this);
  List<ValidationReport> reports=new ArrayList<ValidationReport>();
  try {
    SimpleJobPluginInfo jobPluginInfo=PluginHelper.getInitialJobInformation(this,liteList.size());
    PluginHelper.updateJobInformation(this,jobPluginInfo);
    Job job=PluginHelper.getJob(this,model);
    List<AIP> list=PluginHelper.transformLitesIntoObjects(model,index,this,pluginReport,jobPluginInfo,liteList,job);
    try {
      for (      AIP aip : list) {
        Report reportItem=PluginHelper.initPluginReportItem(this,aip.getId(),AIP.class,AIPState.INGEST_PROCESSING);
        PluginHelper.updatePartialJobReport(this,model,index,reportItem,false,job);
        PluginState state=PluginState.SUCCESS;
        try {
          LOGGER.debug("String_Node_Str",aip.getId());
          ValidationReport report=ValidationUtils.isAIPMetadataValid(forceDescriptiveMetadataType,validateDescriptiveMetadata,metadataType,metadataVersion,validatePremis,model,aip.getId());
          reports.add(report);
          if (report.isValid()) {
            reportItem.setPluginState(state);
          }
 else {
            state=PluginState.FAILURE;
            reportItem.setPluginState(state).setHtmlPluginDetails(true).setPluginDetails(report.toHtml(false,false));
          }
        }
 catch (        RODAException mse) {
          state=PluginState.FAILURE;
          LOGGER.error("String_Node_Str" + aip.getId() + "String_Node_Str"+ mse.getMessage(),mse);
        }
        try {
          boolean notify=true;
          createEvent(aip,model,index,reportItem.getPluginState(),notify);
          jobPluginInfo.incrementObjectsProcessed(state);
          pluginReport.addReport(reportItem);
          PluginHelper.updatePartialJobReport(this,model,index,reportItem,true,job);
        }
 catch (        PluginException|RuntimeException e) {
          LOGGER.error("String_Node_Str",e);
        }
      }
    }
 catch (    ClassCastException e) {
      LOGGER.error("String_Node_Str");
      jobPluginInfo.incrementObjectsProcessedWithFailure(list.size());
    }
    jobPluginInfo.finalizeInfo();
    PluginHelper.updateJobInformation(this,jobPluginInfo);
  }
 catch (  JobException|AuthorizationDeniedException|NotFoundException|GenericException|RequestNotValidException e) {
    throw new PluginException("String_Node_Str",e);
  }
  return pluginReport;
}