Program: 71607
Project: 71607
Buggy source:
/** 
 * Updates values in DynamicValuesQuery to the given report parameter.
 * @param dataAttrs the latest dynamic values
 * @param cachedDataAttrs the cached dynamic values
 * @param reportParam the report parameter
 * @throws SemanticException
 */
private void updateROMDyanmicList(DynamicValuesQuery valueQuery,DynamicValuesQuery cachedValueQuery,ScalarParameterHandle reportParam,OdaDataSetHandle setHandle) throws SemanticException {
  if (valueQuery == null)   return;
  String value=valueQuery.getDataSetDesign().getName();
  String cachedValue=cachedValueQuery == null ? null : cachedValueQuery.getDataSetDesign().getName();
  if (cachedValue == null || !cachedValue.equals(value)) {
    reportParam.setDataSetName(value);
    ModuleHandle module=setHandle.getModuleHandle();
    DataSetHandle target=module.findDataSet(value);
    if (target instanceof OdaDataSetHandle && target != setHandle)     new ModelOdaAdapter().updateDataSetHandle(valueQuery.getDataSetDesign(),(OdaDataSetHandle)target,false);
    if (target == null) {
      OdaDataSetHandle nestedDataSet=new ModelOdaAdapter().createDataSetHandle(valueQuery.getDataSetDesign(),module);
      module.getDataSets().add(nestedDataSet);
    }
  }
  value=valueQuery.getValueColumn();
  cachedValue=cachedValueQuery == null ? null : cachedValueQuery.getValueColumn();
  if (cachedValue == null || !cachedValue.equals(value))   reportParam.setValueExpr(value);
  value=valueQuery.getDisplayNameColumn();
  cachedValue=cachedValueQuery == null ? null : cachedValueQuery.getDisplayNameColumn();
  if (cachedValue == null || !cachedValue.equals(value))   reportParam.setLabelExpr(value);
  boolean isEnabled=valueQuery.isEnabled();
  boolean cachedIsEnabled=cachedValueQuery == null ? false : cachedValueQuery.isEnabled();
  if (cachedValueQuery == null || (cachedIsEnabled != isEnabled && isEnabled))   reportParam.setValueType(DesignChoiceConstants.PARAM_VALUE_TYPE_DYNAMIC);
}

Fixed version (ground truth):
/** 
 * Updates values in DynamicValuesQuery to the given report parameter.
 * @param dataAttrs the latest dynamic values
 * @param cachedDataAttrs the cached dynamic values
 * @param reportParam the report parameter
 * @throws SemanticException
 */
private void updateROMDyanmicList(DynamicValuesQuery valueQuery,DynamicValuesQuery cachedValueQuery,ScalarParameterHandle reportParam,OdaDataSetHandle setHandle) throws SemanticException {
  if (valueQuery == null)   return;
  String value=valueQuery.getDataSetDesign().getName();
  String cachedValue=cachedValueQuery == null ? null : cachedValueQuery.getDataSetDesign().getName();
  if (cachedValue == null || !cachedValue.equals(value)) {
    reportParam.setDataSetName(value);
    ModuleHandle module=setHandle.getModuleHandle();
    DataSetHandle target=module.findDataSet(value);
    if (target instanceof OdaDataSetHandle && target != setHandle)     new ModelOdaAdapter().updateDataSetHandle(valueQuery.getDataSetDesign(),(OdaDataSetHandle)target,false);
    if (target == null) {
      OdaDataSetHandle nestedDataSet=new ModelOdaAdapter().createDataSetHandle(valueQuery.getDataSetDesign(),module);
      module.getDataSets().add(nestedDataSet);
    }
  }
  value=valueQuery.getValueColumn();
  cachedValue=cachedValueQuery == null ? null : cachedValueQuery.getValueColumn();
  if (cachedValue == null || !cachedValue.equals(value))   reportParam.setValueExpr(value);
  value=valueQuery.getDisplayNameColumn();
  cachedValue=cachedValueQuery == null ? null : cachedValueQuery.getDisplayNameColumn();
  if (cachedValue == null || !cachedValue.equals(value))   reportParam.setLabelExpr(value);
}