Program: 71822
Project: 71822
Buggy source:
/** 
 * Prepare data expression evaluator for query share with table.
 * @param cm
 * @param session
 * @return
 * @throws BirtException
 * @throws AdapterException
 * @throws DataException
 * @throws ChartException
 */
private IDataRowExpressionEvaluator createShareBindingEvaluator(Chart cm,DataRequestSession session) throws BirtException, AdapterException, DataException, ChartException {
  IQueryResults actualResultSet;
  QueryDefinition queryDefn=new QueryDefinition();
  int maxRow=getMaxRow();
  queryDefn.setMaxRows(maxRow);
  final Map bindingExprsMap=new HashMap();
  Iterator iterator=ChartReportItemUtil.getColumnDataBindings(itemHandle);
  ArrayList columnList=new ArrayList();
  while (iterator.hasNext()) {
    columnList.add(iterator.next());
  }
  generateShareBindingsWithTable(getPreviewHeadersInfo(columnList),queryDefn,session,bindingExprsMap);
  addCustomExpressions(queryDefn,cm,bindingExprsMap);
  actualResultSet=session.executeQuery(queryDefn,null,getPropertyIterator(itemHandle.getPropertyHandle(ExtendedItemHandle.FILTER_PROP)),null);
  if (actualResultSet != null) {
    return new BaseGroupedQueryResultSetEvaluator(actualResultSet.getResultIterator(),ChartReportItemUtil.hasAggregation(cm),cm){
      public Object evaluate(      String expression){
        try {
          String newExpr=(String)bindingExprsMap.get(expression);
          if (newExpr != null) {
            return fResultIterator.getValue(newExpr);
          }
 else {
            return fResultIterator.getValue(expression);
          }
        }
 catch (        BirtException e) {
          sLogger.log(e);
        }
        return null;
      }
    }
;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Prepare data expression evaluator for query share with table.
 * @param cm
 * @param session
 * @return
 * @throws BirtException
 * @throws AdapterException
 * @throws DataException
 * @throws ChartException
 */
private IDataRowExpressionEvaluator createShareBindingEvaluator(Chart cm,final DataRequestSession session) throws BirtException, AdapterException, DataException, ChartException {
  IQueryResults actualResultSet;
  QueryDefinition queryDefn=new QueryDefinition();
  int maxRow=getMaxRow();
  queryDefn.setMaxRows(maxRow);
  final Map bindingExprsMap=new HashMap();
  Iterator iterator=ChartReportItemUtil.getColumnDataBindings(itemHandle);
  ArrayList columnList=new ArrayList();
  while (iterator.hasNext()) {
    columnList.add(iterator.next());
  }
  generateShareBindingsWithTable(getPreviewHeadersInfo(columnList),queryDefn,session,bindingExprsMap);
  addCustomExpressions(queryDefn,cm,bindingExprsMap);
  actualResultSet=session.executeQuery(queryDefn,null,getPropertyIterator(itemHandle.getPropertyHandle(ExtendedItemHandle.FILTER_PROP)),null);
  if (actualResultSet != null) {
    return new BaseGroupedQueryResultSetEvaluator(actualResultSet.getResultIterator(),ChartReportItemUtil.hasAggregation(cm),cm){
      public Object evaluate(      String expression){
        try {
          String newExpr=(String)bindingExprsMap.get(expression);
          if (newExpr != null) {
            return fResultIterator.getValue(newExpr);
          }
 else {
            return fResultIterator.getValue(expression);
          }
        }
 catch (        BirtException e) {
          sLogger.log(e);
        }
        return null;
      }
      @Override public void close(){
        super.close();
        session.shutdown();
      }
    }
;
  }
  return null;
}