Program: 69760
Project: 69760
Buggy source:
/** 
 * @param modelDataSet
 * @param dteDataSet
 * @return
 */
private Iterator populateParameter(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet) throws BirtException {
  HashMap paramBindingCandidates=new HashMap();
  Iterator elmtIter=modelDataSet.parametersIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      DataSetParameterHandle modelParam=(DataSetParameterHandle)elmtIter.next();
      if (modelParam.isInput()) {
        String defaultValueExpr=null;
        if (modelParam instanceof OdaDataSetParameterHandle) {
          String linkedReportParam=((OdaDataSetParameterHandle)modelParam).getParamName();
          if (linkedReportParam != null) {
            ParameterHandle ph=modelDataSet.getModuleHandle().findParameter(linkedReportParam);
            if (ph instanceof ScalarParameterHandle) {
              if (((ScalarParameterHandle)ph).getParamType().equals(DesignChoiceConstants.SCALAR_PARAM_TYPE_MULTI_VALUE)) {
                throw new DataException(ResourceConstants.Linked_REPORT_PARAM_ALLOW_MULTI_VALUES,new String[]{linkedReportParam,modelParam.getName()});
              }
            }
            defaultValueExpr=ExpressionUtil.createJSParameterExpression(((OdaDataSetParameterHandle)modelParam).getParamName());
          }
 else {
            if (ExpressionType.CONSTANT.equals(modelParam.getExpressionProperty(DataSetParameter.DEFAULT_VALUE_MEMBER).getType())) {
              defaultValueExpr="String_Node_Str" + JavascriptEvalUtil.transformToJsConstants(modelParam.getDefaultValue()) + "String_Node_Str";
            }
 else {
              defaultValueExpr=modelParam.getDefaultValue();
            }
          }
        }
 else {
          if (ExpressionType.CONSTANT.equals(modelParam.getExpressionProperty(DataSetParameter.DEFAULT_VALUE_MEMBER).getType())) {
            defaultValueExpr="String_Node_Str" + JavascriptEvalUtil.transformToJsConstants(modelParam.getDefaultValue()) + "String_Node_Str";
          }
 else {
            defaultValueExpr=modelParam.getDefaultValue();
          }
        }
        dteDataSet.addParameter(newParam(modelParam));
        paramBindingCandidates.put(modelParam.getName(),new ScriptExpression(defaultValueExpr,DataAdapterUtil.modelDataTypeToCoreDataType(modelParam.getDataType())));
      }
 else {
        dteDataSet.addParameter(newParam(modelParam));
      }
    }
  }
  elmtIter=modelDataSet.paramBindingsIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ParamBindingHandle modelParamBinding=(ParamBindingHandle)elmtIter.next();
      paramBindingCandidates.put(modelParamBinding.getParamName(),new ScriptExpression(modelParamBinding.getExpression()));
    }
  }
  if (paramBindingCandidates.size() > 0) {
    elmtIter=paramBindingCandidates.keySet().iterator();
    while (elmtIter.hasNext()) {
      Object paramName=elmtIter.next();
      assert(paramName != null && paramName instanceof String);
      ScriptExpression expression=(ScriptExpression)paramBindingCandidates.get(paramName);
      dteDataSet.addInputParamBinding(newInputParamBinding((String)paramName,expression));
    }
  }
  return elmtIter;
}

Fixed version (ground truth):
/** 
 * @param modelDataSet
 * @param dteDataSet
 * @return
 */
private Iterator populateParameter(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet) throws BirtException {
  HashMap paramBindingCandidates=new HashMap();
  Iterator elmtIter=modelDataSet.parametersIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      DataSetParameterHandle modelParam=(DataSetParameterHandle)elmtIter.next();
      if (modelParam.isInput()) {
        String defaultValueExpr=null;
        if (modelParam instanceof OdaDataSetParameterHandle) {
          String linkedReportParam=((OdaDataSetParameterHandle)modelParam).getParamName();
          if (linkedReportParam != null) {
            ParameterHandle ph=modelDataSet.getModuleHandle().findParameter(linkedReportParam);
            if (ph instanceof ScalarParameterHandle) {
              if (((ScalarParameterHandle)ph).getParamType().equals(DesignChoiceConstants.SCALAR_PARAM_TYPE_MULTI_VALUE)) {
                throw new DataException(ResourceConstants.Linked_REPORT_PARAM_ALLOW_MULTI_VALUES,new String[]{linkedReportParam,modelParam.getName()});
              }
            }
            defaultValueExpr=ExpressionUtil.createJSParameterExpression(((OdaDataSetParameterHandle)modelParam).getParamName());
          }
 else {
            defaultValueExpr=getExpressionDefaultValue(modelParam);
          }
        }
 else {
          defaultValueExpr=getExpressionDefaultValue(modelParam);
        }
        dteDataSet.addParameter(newParam(modelParam));
        paramBindingCandidates.put(modelParam.getName(),new ScriptExpression(defaultValueExpr,DataAdapterUtil.modelDataTypeToCoreDataType(modelParam.getDataType())));
      }
 else {
        dteDataSet.addParameter(newParam(modelParam));
      }
    }
  }
  elmtIter=modelDataSet.paramBindingsIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ParamBindingHandle modelParamBinding=(ParamBindingHandle)elmtIter.next();
      paramBindingCandidates.put(modelParamBinding.getParamName(),new ScriptExpression(modelParamBinding.getExpression()));
    }
  }
  if (paramBindingCandidates.size() > 0) {
    elmtIter=paramBindingCandidates.keySet().iterator();
    while (elmtIter.hasNext()) {
      Object paramName=elmtIter.next();
      assert(paramName != null && paramName instanceof String);
      ScriptExpression expression=(ScriptExpression)paramBindingCandidates.get(paramName);
      dteDataSet.addInputParamBinding(newInputParamBinding((String)paramName,expression));
    }
  }
  return elmtIter;
}