Program: 68300
Project: 68300
Buggy source:
public IDataRowExpressionEvaluator prepareRowExpressionEvaluator(Chart cm,List<String> columnExpression,int rowCount,boolean isStringType) throws ChartException {
  if (engineTask != null) {
    try {
      engineTask.run();
    }
 catch (    EngineException e) {
      throw new ChartException(ChartReportItemUIActivator.ID,ChartException.DATA_BINDING,e);
    }
  }
  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);
  IDataRowExpressionEvaluator evaluator=null;
  try {
    CubeHandle cube=ChartCubeUtil.getBindingCube(itemHandle);
    if (cube != null) {
      evaluator=createCubeEvaluator(cube,cm);
      cubeReference=cube;
    }
 else {
      cubeReference=null;
      if (isSharedBinding() && !ChartReportItemUtil.isOldChartUsingInternalGroup(itemHandle,cm) || isInheritColumnsGroups()) {
        if (isSharingChart(true)) {
          evaluator=createBaseEvaluator((ExtendedItemHandle)itemHandle.getDataBindingReference(),cm,columnExpression);
        }
 else {
          evaluator=fShareBindingQueryHelper.createShareBindingEvaluator(cm,columnExpression);
        }
      }
 else {
        evaluator=createBaseEvaluator(itemHandle,cm,columnExpression);
      }
    }
    return evaluator;
  }
 catch (  BirtException e) {
    throw new ChartException(ChartReportItemUIActivator.ID,ChartException.DATA_BINDING,e);
  }
catch (  RuntimeException e) {
    throw new ChartException(ChartReportItemUIActivator.ID,ChartException.DATA_BINDING,e);
  }
 finally {
    Thread.currentThread().setContextClassLoader(oldContextLoader);
  }
}

Fixed version (ground truth):
public IDataRowExpressionEvaluator prepareRowExpressionEvaluator(Chart cm,List<String> columnExpression,int rowCount,boolean isStringType) throws ChartException {
  if (engineTask != null) {
    try {
      engineTask.run();
    }
 catch (    EngineException e) {
      throw new ChartException(ChartReportItemUIActivator.ID,ChartException.DATA_BINDING,e);
    }
  }
  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);
  IDataRowExpressionEvaluator evaluator=null;
  try {
    CubeHandle cube=ChartCubeUtil.getBindingCube(itemHandle);
    if (cube != null) {
      evaluator=createCubeEvaluator(cube,cm);
      dataSetReference=cube;
    }
 else {
      if (isSharedBinding() && !ChartReportItemUtil.isOldChartUsingInternalGroup(itemHandle,cm) || isInheritColumnsGroups()) {
        if (isSharingChart(true)) {
          evaluator=createBaseEvaluator((ExtendedItemHandle)itemHandle.getDataBindingReference(),cm,columnExpression);
        }
 else {
          evaluator=fShareBindingQueryHelper.createShareBindingEvaluator(cm,columnExpression);
        }
      }
 else {
        evaluator=createBaseEvaluator(itemHandle,cm,columnExpression);
      }
      dataSetReference=ChartItemUtil.getBindingDataSet(itemHandle);
    }
    return evaluator;
  }
 catch (  BirtException e) {
    throw new ChartException(ChartReportItemUIActivator.ID,ChartException.DATA_BINDING,e);
  }
catch (  RuntimeException e) {
    throw new ChartException(ChartReportItemUIActivator.ID,ChartException.DATA_BINDING,e);
  }
 finally {
    Thread.currentThread().setContextClassLoader(oldContextLoader);
  }
}