Program: 72328
Project: 72328
Buggy source:
private static void updateParameterDesign(DataSetDesign dataSetDesign,final QueryStatement queryStmt){
  if (dataSetDesign == null || queryStmt == null)   return;
  List paramVars=StatementHelper.getAllVariablesInQueryStatement(queryStmt,false);
  if (paramVars.isEmpty()) {
    dataSetDesign.setParameters(null);
    return;
  }
  DataSetParameters dataSetParams=DesignFactory.eINSTANCE.createDataSetParameters();
  dataSetDesign.setParameters(dataSetParams);
  Iterator paramVarsIter=paramVars.iterator();
  int index=0;
  while (paramVarsIter.hasNext()) {
    ValueExpressionVariable var=(ValueExpressionVariable)paramVarsIter.next();
    index++;
    ParameterDefinition paramDefn=DesignFactory.eINSTANCE.createParameterDefinition();
    paramDefn.setInOutMode(ParameterMode.IN_LITERAL);
    DataElementAttributes paramAttrs=DesignFactory.eINSTANCE.createDataElementAttributes();
    paramDefn.setAttributes(paramAttrs);
    paramAttrs.setPosition(index);
    paramAttrs.setName(var.getName());
    convertToDataElementAttributes(var,paramAttrs);
    adjustParameterDefinition(paramDefn);
    dataSetParams.getParameterDefinitions().add(paramDefn);
  }
}

Fixed version (ground truth):
private static void updateParameterDesign(DataSetDesign dataSetDesign,final QueryStatement queryStmt){
  if (dataSetDesign == null || queryStmt == null)   return;
  List paramVars=StatementHelper.getAllVariablesInQueryStatement(queryStmt,false);
  if (paramVars.isEmpty()) {
    dataSetDesign.setParameters(null);
    if (dataSetDesign.getPrivateProperties() != null) {
      dataSetDesign.getPrivateProperties().setProperty(PRIVATE_PRO_PARAMETERMETADATA,EMPTY_STRING);
    }
    return;
  }
  DataSetParameters dataSetParams=DesignFactory.eINSTANCE.createDataSetParameters();
  dataSetDesign.setParameters(dataSetParams);
  Iterator paramVarsIter=paramVars.iterator();
  int index=0;
  StringBuffer buf=new StringBuffer();
  while (paramVarsIter.hasNext()) {
    ValueExpressionVariable var=(ValueExpressionVariable)paramVarsIter.next();
    index++;
    ParameterDefinition paramDefn=DesignFactory.eINSTANCE.createParameterDefinition();
    paramDefn.setInOutMode(ParameterMode.IN_LITERAL);
    DataElementAttributes paramAttrs=DesignFactory.eINSTANCE.createDataElementAttributes();
    paramDefn.setAttributes(paramAttrs);
    paramAttrs.setPosition(index);
    paramAttrs.setName(var.getName());
    convertToDataElementAttributes(var,paramAttrs);
    adjustParameterDefinition(paramDefn);
    dataSetParams.getParameterDefinitions().add(paramDefn);
    if (var.getName() != null && var.getName().trim().length() > 0) {
      if (buf.toString().length() > 0) {
        buf.append(CONST_PARAMS_DELIMITER + index + CONST_PARAM_NAME_DELIMITER+ var.getName());
      }
 else {
        buf.append(index + CONST_PARAM_NAME_DELIMITER + var.getName());
      }
    }
  }
  if (dataSetDesign.getPrivateProperties() == null) {
    try {
      Properties props=new Properties();
      props.setProperty(PRIVATE_PRO_PARAMETERMETADATA,EMPTY_STRING);
      dataSetDesign.setPrivateProperties(DesignSessionUtil.createDataSetNonPublicProperties(dataSetDesign.getOdaExtensionDataSourceId(),dataSetDesign.getOdaExtensionDataSetId(),props));
    }
 catch (    OdaException e) {
      return;
    }
  }
  dataSetDesign.getPrivateProperties().setProperty(PRIVATE_PRO_PARAMETERMETADATA,buf.toString());
}