Program: 67148
Project: 67148
Buggy source:
/** 
 * Returns preview row data for table shared binding, it will share table's bindings and get them data.
 * @param headers
 * @param rowCount
 * @param isStringType
 * @return
 * @throws ChartException
 * @since 2.3
 */
private List<Object[]> getPreviewRowData(ColumnBindingInfo[] headers,int rowCount,boolean isStringType) throws ChartException {
  List<Object[]> dataList=new ArrayList<Object[]>();
  ClassLoader oldContextLoader=Thread.currentThread().getContextClassLoader();
  ClassLoader parentLoader=oldContextLoader;
  if (parentLoader == null)   parentLoader=this.getClass().getClassLoader();
  ClassLoader newContextLoader=DataSetProvider.getCustomScriptClassLoader(parentLoader,itemHandle.getModuleHandle());
  Thread.currentThread().setContextClassLoader(newContextLoader);
  try {
    QueryDefinition queryDefn=new QueryDefinition();
    queryDefn.setMaxRows(getMaxRow());
    List<String> columns=generateShareBindingsWithTable(headers,queryDefn,session,new HashMap<String,String>());
    Iterator<?> filtersIterator=getPropertyIterator(itemHandle.getPropertyHandle(IExtendedItemModel.FILTER_PROP));
    if (filtersIterator != null) {
      while (filtersIterator.hasNext()) {
        IFilterDefinition filter=session.getModelAdaptor().adaptFilter((FilterConditionHandle)filtersIterator.next());
        queryDefn.addFilter(filter);
      }
    }
    IQueryResults actualResultSet=executeSharedQuery(queryDefn);
    if (actualResultSet != null) {
      int columnCount=columns.size();
      IResultIterator iter=actualResultSet.getResultIterator();
      while (iter.next()) {
        if (isStringType) {
          String[] record=new String[columnCount];
          for (int n=0; n < columnCount; n++) {
            record[n]=DataTypeUtil.toString(iter.getValue(columns.get(n)));
          }
          dataList.add(record);
        }
 else {
          Object[] record=new Object[columnCount];
          for (int n=0; n < columnCount; n++) {
            record[n]=iter.getValue(columns.get(n));
          }
          dataList.add(record);
        }
      }
      actualResultSet.close();
    }
  }
 catch (  BirtException e) {
    throw new ChartException(ChartReportItemUIActivator.ID,ChartException.DATA_BINDING,e);
  }
 finally {
    Thread.currentThread().setContextClassLoader(oldContextLoader);
  }
  return dataList;
}

Fixed version (ground truth):
/** 
 * Returns preview row data for table shared binding, it will share table's bindings and get them data.
 * @param headers
 * @param rowCount
 * @param isStringType
 * @return
 * @throws ChartException
 * @since 2.3
 */
private List<Object[]> getPreviewRowData(ColumnBindingInfo[] headers,int rowCount,boolean isStringType) throws ChartException {
  List<Object[]> dataList=new ArrayList<Object[]>();
  ClassLoader oldContextLoader=Thread.currentThread().getContextClassLoader();
  ClassLoader parentLoader=oldContextLoader;
  if (parentLoader == null)   parentLoader=this.getClass().getClassLoader();
  ClassLoader newContextLoader=DataSetProvider.getCustomScriptClassLoader(parentLoader,itemHandle.getModuleHandle());
  Thread.currentThread().setContextClassLoader(newContextLoader);
  try {
    QueryDefinition queryDefn=new QueryDefinition();
    queryDefn.setMaxRows(getMaxRow());
    List<String> columns=generateShareBindingsWithTable(headers,queryDefn,session,new HashMap<String,String>());
    Iterator<?> filtersIterator=getPropertyIterator(itemHandle.getPropertyHandle(IExtendedItemModel.FILTER_PROP));
    if (filtersIterator != null) {
      while (filtersIterator.hasNext()) {
        IFilterDefinition filter=session.getModelAdaptor().adaptFilter((FilterConditionHandle)filtersIterator.next());
        queryDefn.addFilter(filter);
      }
    }
    IQueryResults actualResultSet=executeSharedQuery(queryDefn);
    if (actualResultSet != null) {
      int columnCount=columns.size();
      IResultIterator iter=actualResultSet.getResultIterator();
      while (iter.next()) {
        if (isStringType) {
          String[] record=new String[columnCount];
          for (int n=0; n < columnCount; n++) {
            record[n]=valueAsString(iter.getValue(columns.get(n)));
          }
          dataList.add(record);
        }
 else {
          Object[] record=new Object[columnCount];
          for (int n=0; n < columnCount; n++) {
            record[n]=iter.getValue(columns.get(n));
          }
          dataList.add(record);
        }
      }
      actualResultSet.close();
    }
  }
 catch (  BirtException e) {
    throw new ChartException(ChartReportItemUIActivator.ID,ChartException.DATA_BINDING,e);
  }
 finally {
    Thread.currentThread().setContextClassLoader(oldContextLoader);
  }
  return dataList;
}