Program: 73771
Project: 73771
Buggy source:
/** 
 * Adapts a model oda data set handle
 * @param modelDataSet model handle
 * @param propBindingScope Javascript scope in which to evaluate property binding expressions.If null, property binding is not resolved
 * @throws BirtException
 */
public OdaDataSetAdapter(OdaDataSetHandle modelDataSet,Scriptable propBindingScope) throws BirtException {
  super(modelDataSet.getQualifiedName());
  DataAdapterUtil.adaptBaseDataSet(modelDataSet,this);
  String queryTextBinding=modelDataSet.getPropertyBinding(OdaDataSet.QUERY_TEXT_PROP);
  if (propBindingScope != null && queryTextBinding != null && queryTextBinding.length() > 0) {
    String queryText=JavascriptEvalUtil.evaluateScript(null,propBindingScope,queryTextBinding,"String_Node_Str",0).toString();
    setQueryText(queryText);
  }
 else {
    setQueryText(modelDataSet.getQueryText());
  }
  setExtensionID(modelDataSet.getExtensionID());
  setPrimaryResultSetName(modelDataSet.getResultSetName());
  Map staticProps=DataAdapterUtil.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 (propBindingScope != null && bindingExpr != null && bindingExpr.length() > 0) {
        propValue=JavascriptEvalUtil.evaluateScript(null,propBindingScope,bindingExpr,"String_Node_Str",0).toString();
      }
 else {
        propValue=(String)staticProps.get(propName);
      }
      addPublicProperty((String)propName,propValue);
    }
  }
  Iterator elmtIter=modelDataSet.privateDriverPropertiesIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ExtendedPropertyHandle modelProp=(ExtendedPropertyHandle)elmtIter.next();
      addPrivateProperty(modelProp.getName(),modelProp.getValue());
    }
  }
}

Fixed version (ground truth):
/** 
 * Adapts a model oda data set handle
 * @param modelDataSet model handle
 * @param propBindingScope Javascript scope in which to evaluate property binding expressions.If null, property binding is not resolved
 * @throws BirtException
 */
public OdaDataSetAdapter(OdaDataSetHandle modelDataSet,Scriptable propBindingScope) throws BirtException {
  super(modelDataSet.getQualifiedName());
  DataAdapterUtil.adaptBaseDataSet(modelDataSet,this);
  String queryTextBinding=modelDataSet.getPropertyBinding(OdaDataSet.QUERY_TEXT_PROP);
  if (propBindingScope != null && queryTextBinding != null && queryTextBinding.length() > 0) {
    String queryText=JavascriptEvalUtil.evaluateScript(null,propBindingScope,queryTextBinding,ScriptExpression.defaultID,0).toString();
    setQueryText(queryText);
  }
 else {
    setQueryText(modelDataSet.getQueryText());
  }
  setExtensionID(modelDataSet.getExtensionID());
  setPrimaryResultSetName(modelDataSet.getResultSetName());
  Map staticProps=DataAdapterUtil.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 (propBindingScope != null && bindingExpr != null && bindingExpr.length() > 0) {
        propValue=JavascriptEvalUtil.evaluateScript(null,propBindingScope,bindingExpr,ScriptExpression.defaultID,0).toString();
      }
 else {
        propValue=(String)staticProps.get(propName);
      }
      addPublicProperty((String)propName,propValue);
    }
  }
  Iterator elmtIter=modelDataSet.privateDriverPropertiesIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ExtendedPropertyHandle modelProp=(ExtendedPropertyHandle)elmtIter.next();
      addPrivateProperty(modelProp.getName(),modelProp.getValue());
    }
  }
}