Program: 74790
Project: 74790
Buggy source:
/** 
 * Handle SOAP operation. Parse report parameters and display text
 * @param operation
 * @param bean
 * @param parameterMap
 * @param displayTexts
 * @throws Exception
 */
public static void handleOperation(Operation operation,ViewerAttributeBean bean,Map parameterMap,Map displayTexts) throws Exception {
  if (operation == null || bean == null || parameterMap == null || displayTexts == null)   return;
  List locs=new ArrayList();
  Map params=new HashMap();
  String displayTextParam=null;
  Oprand[] oprands=operation.getOprand();
  for (int i=0; i < oprands.length; i++) {
    String paramName=oprands[i].getName();
    Object paramValue=oprands[i].getValue();
    if (paramName == null || paramValue == null)     continue;
    if (paramName.equalsIgnoreCase(ParameterAccessor.PARAM_ISLOCALE)) {
      locs.add(paramValue);
    }
 else     if ((displayTextParam=ParameterAccessor.isDisplayText(paramName)) != null) {
      ParameterDefinition parameter=bean.findParameterDefinition(displayTextParam);
      if (parameter != null && !parameter.isMultiValue())       displayTexts.put(displayTextParam,paramValue);
      continue;
    }
 else {
      if (ParameterAccessor.PARAM_ISNULL.equalsIgnoreCase(paramName)) {
        paramName=(String)paramValue;
        paramValue=null;
      }
      List list=(List)params.get(paramName);
      if (list == null) {
        list=new ArrayList();
        params.put(paramName,list);
      }
      list.add(paramValue);
    }
  }
  Iterator it=params.keySet().iterator();
  while (it.hasNext()) {
    String paramName=(String)it.next();
    List paramValues=(List)params.get(paramName);
    ParameterDefinition parameter=bean.findParameterDefinition(paramName);
    if (parameter == null)     continue;
    String pattern=parameter.getPattern();
    String dataType=ParameterDataTypeConverter.ConvertDataType(parameter.getDataType());
    boolean isLocale=locs.contains(paramName);
    if (parameter.isMultiValue()) {
      List values=new ArrayList();
      for (int i=0; i < paramValues.size(); i++) {
        Object paramValueObj=DataUtil.validate(dataType,pattern,(String)paramValues.get(i),bean.getLocale(),isLocale);
        values.add(paramValueObj);
      }
      parameterMap.put(paramName,values.toArray());
    }
 else {
      Object paramValueObj=DataUtil.validate(dataType,pattern,(String)paramValues.get(0),bean.getLocale(),isLocale);
      parameterMap.put(paramName,paramValueObj);
    }
  }
}

Fixed version (ground truth):
/** 
 * Handle SOAP operation. Parse report parameters and display text
 * @param operation
 * @param bean
 * @param parameterMap
 * @param displayTexts
 * @throws Exception
 */
public static void handleOperation(Operation operation,ViewerAttributeBean bean,Map parameterMap,Map displayTexts) throws Exception {
  if (operation == null || bean == null || parameterMap == null || displayTexts == null)   return;
  List locs=new ArrayList();
  Map params=new HashMap();
  String displayTextParam=null;
  Oprand[] oprands=operation.getOprand();
  for (int i=0; i < oprands.length; i++) {
    String paramName=oprands[i].getName();
    Object paramValue=oprands[i].getValue();
    if (paramName == null || paramValue == null)     continue;
    if (paramName.equalsIgnoreCase(ParameterAccessor.PARAM_ISLOCALE)) {
      locs.add(paramValue);
    }
 else     if ((displayTextParam=ParameterAccessor.isDisplayText(paramName)) != null) {
      ParameterDefinition parameter=bean.findParameterDefinition(displayTextParam);
      if (parameter != null) {
        if (parameter.isMultiValue())         displayTexts.put(displayTextParam,null);
 else         displayTexts.put(displayTextParam,paramValue);
      }
      continue;
    }
 else {
      if (ParameterAccessor.PARAM_ISNULL.equalsIgnoreCase(paramName)) {
        paramName=(String)paramValue;
        paramValue=null;
      }
      List list=(List)params.get(paramName);
      if (list == null) {
        list=new ArrayList();
        params.put(paramName,list);
      }
      list.add(paramValue);
    }
  }
  Iterator it=params.keySet().iterator();
  while (it.hasNext()) {
    String paramName=(String)it.next();
    List paramValues=(List)params.get(paramName);
    ParameterDefinition parameter=bean.findParameterDefinition(paramName);
    if (parameter == null)     continue;
    String pattern=parameter.getPattern();
    String dataType=ParameterDataTypeConverter.ConvertDataType(parameter.getDataType());
    boolean isLocale=locs.contains(paramName);
    if (parameter.isMultiValue()) {
      List values=new ArrayList();
      for (int i=0; i < paramValues.size(); i++) {
        Object paramValueObj=DataUtil.validate(dataType,pattern,(String)paramValues.get(i),bean.getLocale(),isLocale);
        values.add(paramValueObj);
      }
      parameterMap.put(paramName,values.toArray());
    }
 else {
      Object paramValueObj=DataUtil.validate(dataType,pattern,(String)paramValues.get(0),bean.getLocale(),isLocale);
      parameterMap.put(paramName,paramValueObj);
    }
  }
}