Program: 69540
Project: 69540
Buggy source:
IOdaDataSetDesign newOdaDataSet(OdaDataSetHandle modelDataSet,ExecutionContext context) throws BirtException {
  OdaDataSetDesign dteDataSet=new OdaDataSetDesign(modelDataSet.getQualifiedName());
  IBaseDataSetEventHandler eventHandler=new DataSetScriptExecutor(modelDataSet,context);
  dteDataSet.setEventHandler(eventHandler);
  adaptBaseDataSet(modelDataSet,dteDataSet);
  Expression expression=modelDataSet.getPropertyBindingExpression(OdaDataSet.QUERY_TEXT_PROP);
  String queryTextBinding=getExpressionValue(expression);
  if (needPropertyBinding() && queryTextBinding != null && queryTextBinding.length() > 0 && context.getDataEngine() instanceof DteDataEngine) {
    dteDataSet.setQueryText(evaluatePropertyBindingExpr(queryTextBinding));
  }
 else {
    dteDataSet.setQueryText(modelDataSet.getQueryText());
  }
  dteDataSet.setExtensionID(modelDataSet.getExtensionID());
  dteDataSet.setPrimaryResultSetName(modelDataSet.getResultSetName());
  if (modelDataSet.getPropertyHandle(IOdaDataSetModel.RESULT_SET_NUMBER_PROP).isSet())   dteDataSet.setPrimaryResultSetNumber(modelDataSet.getResultSetNumber());
  Map staticProps=getExtensionProperties(modelDataSet,modelDataSet.getExtensionPropertyDefinitionList());
  if (staticProps != null && !staticProps.isEmpty()) {
    Iterator propNamesItr=staticProps.keySet().iterator();
    while (propNamesItr.hasNext()) {
      String propName=(String)propNamesItr.next();
      assert(propName != null);
      Expression expr=modelDataSet.getPropertyBindingExpression(propName);
      String bindingExpr=getExpressionValue(expr);
      String propValue;
      if (needPropertyBinding() && bindingExpr != null && bindingExpr.length() > 0) {
        propValue=this.evaluatePropertyBindingExpr(bindingExpr);
      }
 else {
        propValue=(String)staticProps.get(propName);
      }
      dteDataSet.addPublicProperty((String)propName,propValue);
    }
  }
  Iterator elmtIter=modelDataSet.privateDriverPropertiesIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ExtendedPropertyHandle modelProp=(ExtendedPropertyHandle)elmtIter.next();
      dteDataSet.addPrivateProperty(modelProp.getName(),modelProp.getValue());
    }
  }
  return dteDataSet;
}

Fixed version (ground truth):
IOdaDataSetDesign newOdaDataSet(OdaDataSetHandle modelDataSet,OdaDataSetDesign dteDataSet,ExecutionContext context) throws BirtException {
  IBaseDataSetEventHandler eventHandler=new DataSetScriptExecutor(modelDataSet,context);
  dteDataSet.setEventHandler(eventHandler);
  Expression expression=modelDataSet.getPropertyBindingExpression(OdaDataSet.QUERY_TEXT_PROP);
  String queryTextBinding=getExpressionValue(expression);
  if (needPropertyBinding() && queryTextBinding != null && queryTextBinding.length() > 0 && context.getDataEngine() instanceof DteDataEngine) {
    dteDataSet.setQueryText(evaluatePropertyBindingExpr(queryTextBinding));
  }
  Map staticProps=getExtensionProperties(modelDataSet,modelDataSet.getExtensionPropertyDefinitionList());
  if (staticProps != null && !staticProps.isEmpty()) {
    Iterator propNamesItr=staticProps.keySet().iterator();
    while (propNamesItr.hasNext()) {
      String propName=(String)propNamesItr.next();
      assert(propName != null);
      Expression expr=modelDataSet.getPropertyBindingExpression(propName);
      String bindingExpr=getExpressionValue(expr);
      if (needPropertyBinding() && bindingExpr != null && bindingExpr.length() > 0) {
        String propValue=this.evaluatePropertyBindingExpr(bindingExpr);
        dteDataSet.addPublicProperty((String)propName,propValue);
      }
    }
  }
  return dteDataSet;
}