Program: 60499
Project: 60499
Buggy source:
public void export(){
  if (input.parameterNumber() >= 2) {
    final String[] parameters=Arrays.copyOf(input.getParameters(),input.parameterNumber() - 1);
    for (    final String parameter : parameters) {
      try {
        final ReportExecExportFormat format=ReportExecExportFormat.valueOf(input.lastParameter());
        final SequenceInputStream report=(SequenceInputStream)reportSyncopeOperations.exportExecutionResult(parameter,format).getEntity();
switch (format) {
case XML:
          final String xmlFinalName="String_Node_Str" + parameter + "String_Node_Str";
        XMLUtils.createXMLFile(report,xmlFinalName);
      reportResultManager.genericMessage(xmlFinalName + "String_Node_Str");
    break;
case CSV:
  reportResultManager.genericError(format + "String_Node_Str");
break;
case PDF:
reportResultManager.genericError(format + "String_Node_Str");
break;
case HTML:
reportResultManager.genericError(format + "String_Node_Str");
break;
case RTF:
reportResultManager.genericError(format + "String_Node_Str");
break;
default :
reportResultManager.genericError(format + "String_Node_Str");
break;
}
}
 catch (final WebServiceException|SyncopeClientException ex) {
LOG.error("String_Node_Str",ex);
if (ex.getMessage().startsWith("String_Node_Str")) {
reportResultManager.notFoundError("String_Node_Str",parameter);
}
 else {
reportResultManager.genericError(ex.getMessage());
}
}
catch (final NumberFormatException ex) {
LOG.error("String_Node_Str",ex);
reportResultManager.numberFormatException("String_Node_Str",parameter);
}
catch (IOException|ParserConfigurationException|SAXException|TransformerException e) {
LOG.error("String_Node_Str",e);
reportResultManager.genericError("String_Node_Str" + "String_Node_Str" + parameter + "String_Node_Str"+ e.getMessage());
}
catch (final IllegalArgumentException ex) {
LOG.error("String_Node_Str",ex);
reportResultManager.typeNotValidError("String_Node_Str",input.firstParameter(),CommandUtils.fromEnumToArray(ReportExecExportFormat.class));
}
break;
}
}
 else {
reportResultManager.commandOptionError(EXPORT_EXECUTION_HELP_MESSAGE);
}
}

Fixed version (ground truth):
public void export(){
  if (input.parameterNumber() >= 2) {
    final String[] parameters=Arrays.copyOf(input.getParameters(),input.parameterNumber() - 1);
    for (    final String parameter : parameters) {
      try {
        final String result=reportSyncopeOperations.exportExecutionResult(parameter,input.lastParameter());
        reportResultManager.genericMessage(result);
      }
 catch (      final WebServiceException|SyncopeClientException ex) {
        LOG.error("String_Node_Str",ex);
        if (ex.getMessage().startsWith("String_Node_Str")) {
          reportResultManager.notFoundError("String_Node_Str",parameter);
        }
 else {
          reportResultManager.genericError(ex.getMessage());
        }
      }
catch (      final NumberFormatException ex) {
        LOG.error("String_Node_Str",ex);
        reportResultManager.numberFormatException("String_Node_Str",parameter);
      }
catch (      IOException|ParserConfigurationException|SAXException|TransformerException e) {
        LOG.error("String_Node_Str",e);
        reportResultManager.genericError("String_Node_Str" + "String_Node_Str" + parameter + "String_Node_Str"+ e.getMessage());
      }
catch (      final IllegalArgumentException ex) {
        LOG.error("String_Node_Str",ex);
        reportResultManager.typeNotValidError("String_Node_Str",input.firstParameter(),CommandUtils.fromEnumToArray(ReportExecExportFormat.class));
      }
      break;
    }
  }
 else {
    reportResultManager.commandOptionError(EXPORT_EXECUTION_HELP_MESSAGE);
  }
}