Program: 72276
Project: 72276
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);
  String queryTextBinding=modelDataSet.getPropertyBinding(OdaDataSet.QUERY_TEXT_PROP);
  if (needPropertyBinding() && queryTextBinding != null && queryTextBinding.length() > 0) {
    dteDataSet.setQueryText(evaluatePropertyBindingExpr(queryTextBinding));
  }
 else {
    dteDataSet.setQueryText(modelDataSet.getQueryText());
  }
  dteDataSet.setExtensionID(modelDataSet.getExtensionID());
  dteDataSet.setPrimaryResultSetName(modelDataSet.getResultSetName());
  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);
      String propValue;
      String bindingExpr=modelDataSet.getPropertyBinding(propName);
      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,ExecutionContext context) throws BirtException {
  OdaDataSetDesign dteDataSet=new OdaDataSetDesign(modelDataSet.getQualifiedName());
  IBaseDataSetEventHandler eventHandler=new DataSetScriptExecutor(modelDataSet,context);
  dteDataSet.setEventHandler(eventHandler);
  adaptBaseDataSet(modelDataSet,dteDataSet);
  String queryTextBinding=modelDataSet.getPropertyBinding(OdaDataSet.QUERY_TEXT_PROP);
  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());
  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);
      String propValue;
      String bindingExpr=modelDataSet.getPropertyBinding(propName);
      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;
}