Program: 68019
Project: 68019
Buggy source:
public IDataRowExpressionEvaluator prepareRowExpressionEvaluator(Chart cm,List<String> columnExpression,int rowCount,boolean isStringType) throws ChartException {
synchronized (sessionLock) {
    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,columnExpression);
        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);
    }
  }
}

Fixed version (ground truth):
public IDataRowExpressionEvaluator prepareRowExpressionEvaluator(Chart cm,List<String> columnExpression,int rowCount,boolean isStringType) throws ChartException {
synchronized (sessionLock) {
    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,columnExpression);
        dataSetReference=cube;
      }
 else {
        if (isSharedBinding() && !ChartReportItemUtil.isOldChartUsingInternalGroup(itemHandle,cm) || isInheritColumnsGroups()) {
          if (isSharingChart(true)) {
            evaluator=createBaseEvaluator((ExtendedItemHandle)ChartReportItemUtil.getReportItemReference(itemHandle),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);
    }
  }
}