Program: 76087
Project: 76087
Buggy source:
/** 
 * process tag function
 * @throws Exception
 */
protected void __process() throws Exception {
  if (viewer == null)   return;
  HttpServletRequest request=(HttpServletRequest)pageContext.getRequest();
  this.locale=BirtTagUtil.getLocale(request,viewer.getLocale());
  this.options=new InputOptions();
  options.setOption(InputOptions.OPT_REQUEST,request);
  options.setOption(InputOptions.OPT_LOCALE,this.locale);
  options.setOption(InputOptions.OPT_RTL,Boolean.valueOf(viewer.getRtl()));
  Collection paramDefList=viewer.getParameterDefList();
  if (paramDefList == null) {
    BirtReportServiceFactory.getReportService().setContext(pageContext.getServletContext(),options);
    IViewerReportDesignHandle designHandle=BirtTagUtil.getDesignHandle(request,viewer);
    viewer.setReportDesignHandle(designHandle);
    paramDefList=BirtReportServiceFactory.getReportService().getParameterDefinitions(designHandle,options,false);
    viewer.setParameterDefList(paramDefList);
  }
  this.paramDef=BirtUtility.findParameterDefinition(paramDefList,param.getName());
  if (paramDef == null)   return;
  String dataType=ParameterDataTypeConverter.ConvertDataType(paramDef.getDataType());
  this.pattern=param.getPattern();
  if (this.pattern == null)   this.pattern=paramDef.getPattern();
  boolean isLocale=false;
  if ("String_Node_Str".equalsIgnoreCase(param.getIsLocale()))   isLocale=true;
  if (param.getValue() != null && param.getValue() instanceof String) {
    Object valueObj=DataUtil.validate(dataType,this.pattern,(String)param.getValue(),locale,isLocale);
    param.setValue(valueObj);
  }
  if (param.getValue() == null) {
    Object defaultValue=BirtReportServiceFactory.getReportService().getParameterDefaultValue(viewer.getReportDesignHandle(),param.getName(),options);
    param.setValue(defaultValue);
  }
  this.valueString=DataUtil.getDisplayValue(param.getValue());
  if (this.valueString == null)   this.valueString="String_Node_Str";
  this.displayTextString=param.getDisplayText();
  if (this.displayTextString == null)   this.displayTextString=ParameterValidationUtil.getDisplayValue(dataType,this.pattern,param.getValue(),locale);
  if (this.displayTextString == null)   this.displayTextString="String_Node_Str";
  if (param.getTitle() == null)   param.setTitle(this.displayTextString);
  requesterTag.addParameter(param.getName(),param.getValue());
  if (paramDef.isHidden()) {
    __handleHidden();
  }
 else {
switch (paramDef.getControlType()) {
case IScalarParameterDefn.TEXT_BOX:
      __handleTextBox();
    break;
case IScalarParameterDefn.LIST_BOX:
  __handleListBox();
break;
case IScalarParameterDefn.RADIO_BUTTON:
__handleRadioButton();
break;
case IScalarParameterDefn.CHECK_BOX:
__handleCheckBox();
break;
default :
break;
}
}
}

Fixed version (ground truth):
/** 
 * process tag function
 * @throws Exception
 */
protected void __process() throws Exception {
  if (viewer == null)   return;
  HttpServletRequest request=(HttpServletRequest)pageContext.getRequest();
  this.locale=BirtTagUtil.getLocale(request,viewer.getLocale());
  this.options=new InputOptions();
  options.setOption(InputOptions.OPT_REQUEST,request);
  options.setOption(InputOptions.OPT_LOCALE,this.locale);
  options.setOption(InputOptions.OPT_RTL,Boolean.valueOf(viewer.getRtl()));
  Collection paramDefList=viewer.getParameterDefList();
  if (paramDefList == null) {
    BirtReportServiceFactory.getReportService().setContext(pageContext.getServletContext(),options);
    IViewerReportDesignHandle designHandle=BirtTagUtil.getDesignHandle(request,viewer);
    viewer.setReportDesignHandle(designHandle);
    paramDefList=BirtReportServiceFactory.getReportService().getParameterDefinitions(designHandle,options,false);
    viewer.setParameterDefList(paramDefList);
  }
  this.paramDef=BirtUtility.findParameterDefinition(paramDefList,param.getName());
  if (paramDef == null)   return;
  String dataType=ParameterDataTypeConverter.ConvertDataType(paramDef.getDataType());
  this.pattern=param.getPattern();
  if (this.pattern == null)   this.pattern=paramDef.getPattern();
  boolean isLocale=false;
  if ("String_Node_Str".equalsIgnoreCase(param.getIsLocale()))   isLocale=true;
  if (param.getValue() != null && param.getValue() instanceof String) {
    Object valueObj=DataUtil.validateWithPattern(dataType,this.pattern,(String)param.getValue(),locale,isLocale);
    param.setValue(valueObj);
  }
  if (param.getValue() == null) {
    Object defaultValue=BirtReportServiceFactory.getReportService().getParameterDefaultValue(viewer.getReportDesignHandle(),param.getName(),options);
    param.setValue(defaultValue);
  }
  this.valueString=DataUtil.getDisplayValue(param.getValue());
  if (this.valueString == null)   this.valueString="String_Node_Str";
  this.displayTextString=param.getDisplayText();
  if (this.displayTextString == null)   this.displayTextString=ParameterValidationUtil.getDisplayValue(dataType,this.pattern,param.getValue(),locale);
  if (this.displayTextString == null)   this.displayTextString="String_Node_Str";
  if (param.getTitle() == null)   param.setTitle(this.displayTextString);
  requesterTag.addParameter(param.getName(),param.getValue());
  if (paramDef.isHidden()) {
    __handleHidden();
  }
 else {
switch (paramDef.getControlType()) {
case IScalarParameterDefn.TEXT_BOX:
      __handleTextBox();
    break;
case IScalarParameterDefn.LIST_BOX:
  __handleListBox();
break;
case IScalarParameterDefn.RADIO_BUTTON:
__handleRadioButton();
break;
case IScalarParameterDefn.CHECK_BOX:
__handleCheckBox();
break;
default :
break;
}
}
}