Program: 51465
Project: 51465
Buggy source:
public void createParameterContent(final OutputStream outputStream,final Serializable fileId,final boolean overrideOutputType,MasterReport report) throws Exception {
  final Object rawSessionId=inputs.get(ParameterXmlContentHandler.SYS_PARAM_SESSION_ID);
  if ((rawSessionId instanceof String) == false || "String_Node_Str".equals(rawSessionId)) {
    inputs.put(ParameterXmlContentHandler.SYS_PARAM_SESSION_ID,UUIDUtil.getUUIDAsString());
  }
  this.fileId=fileId;
  this.document=DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
  final IParameterProvider requestParams=getRequestParameters();
  final boolean subscribe="String_Node_Str".equals(requestParams.getStringParameter("String_Node_Str","String_Node_Str"));
  final SimpleReportingComponent reportComponent=new SimpleReportingComponent();
  reportComponent.setReportFileId(fileId);
  if (report != null) {
    reportComponent.setReport(report);
  }
  reportComponent.setPaginateOutput(true);
  reportComponent.setForceDefaultOutputTarget(overrideOutputType);
  reportComponent.setDefaultOutputTarget(HtmlTableModule.TABLE_HTML_PAGE_EXPORT_TYPE);
  reportComponent.setInputs(inputs);
  report=reportComponent.getReport();
  final DefaultParameterContext parameterContext=new DefaultParameterContext(report);
  final ValidationResult vr;
  final Element parameters;
  try {
    final ValidationResult validationResult=ReportContentUtil.applyInputsToReportParameters(report,parameterContext,null,new ValidationResult());
    final ReportParameterDefinition reportParameterDefinition=report.getParameterDefinition();
    vr=reportParameterDefinition.getValidator().validate(validationResult,reportParameterDefinition,parameterContext);
    parameters=document.createElement(GROUP_PARAMETERS);
    parameters.setAttribute("String_Node_Str",String.valueOf(vr.isEmpty() == false));
    parameters.setAttribute("String_Node_Str",String.valueOf(subscribe));
    parameters.setAttribute("String_Node_Str","String_Node_Str");
    final Boolean autoSubmitFlag=requestFlag("String_Node_Str",report,AttributeNames.Core.NAMESPACE,AttributeNames.Core.AUTO_SUBMIT_PARAMETER,"String_Node_Str");
    if (Boolean.TRUE.equals(autoSubmitFlag)) {
      parameters.setAttribute("String_Node_Str","String_Node_Str");
    }
 else     if (Boolean.FALSE.equals(autoSubmitFlag)) {
      parameters.setAttribute("String_Node_Str","String_Node_Str");
    }
    final Boolean autoSubmitUiFlag=requestFlag("String_Node_Str",report,AttributeNames.Core.NAMESPACE,AttributeNames.Core.AUTO_SUBMIT_DEFAULT,"String_Node_Str");
    if (Boolean.FALSE.equals(autoSubmitUiFlag)) {
      parameters.setAttribute("String_Node_Str","String_Node_Str");
    }
 else {
      parameters.setAttribute("String_Node_Str","String_Node_Str");
    }
    parameters.setAttribute("String_Node_Str",requestConfiguration("String_Node_Str",report,AttributeNames.Core.NAMESPACE,AttributeNames.Core.PARAMETER_UI_LAYOUT,"String_Node_Str"));
    final ParameterDefinitionEntry[] parameterDefinitions=reportParameterDefinition.getParameterDefinitions();
    final LinkedHashMap<String,ParameterDefinitionEntry> reportParameters=new LinkedHashMap<String,ParameterDefinitionEntry>();
    for (    final ParameterDefinitionEntry parameter : parameterDefinitions) {
      reportParameters.put(parameter.getName(),parameter);
    }
    for (    final Map.Entry<String,ParameterDefinitionEntry> entry : getSystemParameter().entrySet()) {
      if (reportParameters.containsKey(entry.getKey()) == false) {
        reportParameters.put(entry.getKey(),entry.getValue());
      }
    }
    if (overrideOutputType) {
      final ParameterDefinitionEntry definitionEntry=reportParameters.get(SimpleReportingComponent.OUTPUT_TARGET);
      if (definitionEntry instanceof AbstractParameter) {
        final AbstractParameter parameter=(AbstractParameter)definitionEntry;
        parameter.setHidden(true);
        parameter.setMandatory(false);
      }
    }
 else {
      hideOutputParameterIfLocked(report,reportParameters);
    }
    hideSubscriptionParameter(subscribe,reportParameters);
    final Map<String,Object> inputs=computeRealInput(parameterContext,reportParameters,reportComponent.getComputedOutputTarget(),vr);
    final Boolean showParameterUI=requestFlag("String_Node_Str",report,AttributeNames.Core.NAMESPACE,AttributeNames.Core.SHOW_PARAMETER_UI,null);
    if (Boolean.FALSE.equals(showParameterUI)) {
      inputs.put("String_Node_Str",Boolean.FALSE);
    }
 else {
      inputs.put("String_Node_Str",Boolean.TRUE);
    }
    String proportionalWidth=report.getReportConfiguration().getConfigProperty(CONFIG_PARAM_HTML_PROPORTIONAL_WIDTH);
    inputs.put(SYS_PARAM_HTML_PROPORTIONAL_WIDTH,Boolean.valueOf(proportionalWidth));
    for (    final ParameterDefinitionEntry parameter : reportParameters.values()) {
      final Object selections=inputs.get(parameter.getName());
      final ParameterContextWrapper wrapper=new ParameterContextWrapper(parameterContext,vr.getParameterValues());
      parameters.appendChild(createParameterElement(parameter,wrapper,selections));
    }
    if (vr.isEmpty() == false) {
      parameters.appendChild(createErrorElements(vr));
    }
    final String[] outputParameter=new OutputParameterCollector().collectParameter(report);
    for (int i=0; i < outputParameter.length; i++) {
      final String outputParameterName=outputParameter[i];
      final Element element=document.createElement("String_Node_Str");
      element.setAttribute("String_Node_Str",outputParameterName);
      element.setAttribute("String_Node_Str",outputParameterName);
      parameters.appendChild(element);
    }
    if (vr.isEmpty() && paginate) {
      appendPageCount(reportComponent,parameters);
    }
    document.appendChild(parameters);
    final DOMSource source=new DOMSource(document);
    final StreamResult result=new StreamResult(outputStream);
    final Transformer transformer=TransformerFactory.newInstance().newTransformer();
    transformer.transform(source,result);
  }
  finally {
    parameterContext.close();
  }
}

Fixed version (ground truth):
public void createParameterContent(final OutputStream outputStream,final Serializable fileId,final boolean overrideOutputType,MasterReport report) throws Exception {
  final Object rawSessionId=inputs.get(ParameterXmlContentHandler.SYS_PARAM_SESSION_ID);
  if ((rawSessionId instanceof String) == false || "String_Node_Str".equals(rawSessionId)) {
    inputs.put(ParameterXmlContentHandler.SYS_PARAM_SESSION_ID,UUIDUtil.getUUIDAsString());
  }
  this.fileId=fileId;
  this.document=DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
  final IParameterProvider requestParams=getRequestParameters();
  final boolean subscribe="String_Node_Str".equals(requestParams.getStringParameter("String_Node_Str","String_Node_Str"));
  final SimpleReportingComponent reportComponent=new SimpleReportingComponent();
  reportComponent.setReportFileId(fileId);
  if (report != null) {
    reportComponent.setReport(report);
  }
  reportComponent.setPaginateOutput(true);
  reportComponent.setForceDefaultOutputTarget(overrideOutputType);
  reportComponent.setDefaultOutputTarget(HtmlTableModule.TABLE_HTML_PAGE_EXPORT_TYPE);
  reportComponent.setInputs(inputs);
  report=reportComponent.getReport();
  final DefaultParameterContext parameterContext=new DefaultParameterContext(report);
  final ValidationResult vr;
  final Element parameters;
  try {
    final ValidationResult validationResult=ReportContentUtil.applyInputsToReportParameters(report,parameterContext,inputs,new ValidationResult());
    final ReportParameterDefinition reportParameterDefinition=report.getParameterDefinition();
    vr=reportParameterDefinition.getValidator().validate(validationResult,reportParameterDefinition,parameterContext);
    parameters=document.createElement(GROUP_PARAMETERS);
    parameters.setAttribute("String_Node_Str",String.valueOf(vr.isEmpty() == false));
    parameters.setAttribute("String_Node_Str",String.valueOf(subscribe));
    parameters.setAttribute("String_Node_Str","String_Node_Str");
    final Boolean autoSubmitFlag=requestFlag("String_Node_Str",report,AttributeNames.Core.NAMESPACE,AttributeNames.Core.AUTO_SUBMIT_PARAMETER,"String_Node_Str");
    if (Boolean.TRUE.equals(autoSubmitFlag)) {
      parameters.setAttribute("String_Node_Str","String_Node_Str");
    }
 else     if (Boolean.FALSE.equals(autoSubmitFlag)) {
      parameters.setAttribute("String_Node_Str","String_Node_Str");
    }
    final Boolean autoSubmitUiFlag=requestFlag("String_Node_Str",report,AttributeNames.Core.NAMESPACE,AttributeNames.Core.AUTO_SUBMIT_DEFAULT,"String_Node_Str");
    if (Boolean.FALSE.equals(autoSubmitUiFlag)) {
      parameters.setAttribute("String_Node_Str","String_Node_Str");
    }
 else {
      parameters.setAttribute("String_Node_Str","String_Node_Str");
    }
    parameters.setAttribute("String_Node_Str",requestConfiguration("String_Node_Str",report,AttributeNames.Core.NAMESPACE,AttributeNames.Core.PARAMETER_UI_LAYOUT,"String_Node_Str"));
    final ParameterDefinitionEntry[] parameterDefinitions=reportParameterDefinition.getParameterDefinitions();
    final LinkedHashMap<String,ParameterDefinitionEntry> reportParameters=new LinkedHashMap<String,ParameterDefinitionEntry>();
    for (    final ParameterDefinitionEntry parameter : parameterDefinitions) {
      reportParameters.put(parameter.getName(),parameter);
    }
    for (    final Map.Entry<String,ParameterDefinitionEntry> entry : getSystemParameter().entrySet()) {
      if (reportParameters.containsKey(entry.getKey()) == false) {
        reportParameters.put(entry.getKey(),entry.getValue());
      }
    }
    if (overrideOutputType) {
      final ParameterDefinitionEntry definitionEntry=reportParameters.get(SimpleReportingComponent.OUTPUT_TARGET);
      if (definitionEntry instanceof AbstractParameter) {
        final AbstractParameter parameter=(AbstractParameter)definitionEntry;
        parameter.setHidden(true);
        parameter.setMandatory(false);
      }
    }
 else {
      hideOutputParameterIfLocked(report,reportParameters);
    }
    hideSubscriptionParameter(subscribe,reportParameters);
    final Map<String,Object> inputs=computeRealInput(parameterContext,reportParameters,reportComponent.getComputedOutputTarget(),vr);
    final Boolean showParameterUI=requestFlag("String_Node_Str",report,AttributeNames.Core.NAMESPACE,AttributeNames.Core.SHOW_PARAMETER_UI,null);
    if (Boolean.FALSE.equals(showParameterUI)) {
      inputs.put("String_Node_Str",Boolean.FALSE);
    }
 else {
      inputs.put("String_Node_Str",Boolean.TRUE);
    }
    String proportionalWidth=report.getReportConfiguration().getConfigProperty(CONFIG_PARAM_HTML_PROPORTIONAL_WIDTH);
    inputs.put(SYS_PARAM_HTML_PROPORTIONAL_WIDTH,Boolean.valueOf(proportionalWidth));
    for (    final ParameterDefinitionEntry parameter : reportParameters.values()) {
      final Object selections=inputs.get(parameter.getName());
      final ParameterContextWrapper wrapper=new ParameterContextWrapper(parameterContext,vr.getParameterValues());
      parameters.appendChild(createParameterElement(parameter,wrapper,selections));
    }
    if (vr.isEmpty() == false) {
      parameters.appendChild(createErrorElements(vr));
    }
    final String[] outputParameter=new OutputParameterCollector().collectParameter(report);
    for (int i=0; i < outputParameter.length; i++) {
      final String outputParameterName=outputParameter[i];
      final Element element=document.createElement("String_Node_Str");
      element.setAttribute("String_Node_Str",outputParameterName);
      element.setAttribute("String_Node_Str",outputParameterName);
      parameters.appendChild(element);
    }
    if (vr.isEmpty() && paginate) {
      appendPageCount(reportComponent,parameters);
    }
    document.appendChild(parameters);
    final DOMSource source=new DOMSource(document);
    final StreamResult result=new StreamResult(outputStream);
    final Transformer transformer=TransformerFactory.newInstance().newTransformer();
    transformer.transform(source,result);
  }
  finally {
    parameterContext.close();
  }
}