Program: 69761
Project: 69761
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=null;
  if (expression != null && (expression.getExpression() instanceof String)) {
    queryTextBinding=(String)expression.getExpression();
    if (ExpressionType.CONSTANT.equals(expression.getType())) {
      queryTextBinding="String_Node_Str" + JavascriptEvalUtil.transformToJsConstants(queryTextBinding) + "String_Node_Str";
    }
  }
  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);
      String propValue;
      String bindingExpr=null;
      Expression expr=modelDataSet.getPropertyBindingExpression(propName);
      if (expr != null && (expr.getExpression() instanceof String)) {
        bindingExpr=(String)expr.getExpression();
        if (ExpressionType.CONSTANT.equals(expr.getType())) {
          bindingExpr="String_Node_Str" + JavascriptEvalUtil.transformToJsConstants(bindingExpr) + "String_Node_Str";
        }
      }
      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);
  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;
}