Program: 69229
Project: 69229
Buggy source:
/** 
 * Show ProgressMonitorDialog
 */
private void updateResultsProcess(){
  needsUpdateUI=true;
  clearResultSetTable();
  IRunnableWithProgress runnable=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
      if (resultSetTable != null && !resultSetTable.isDisposed()) {
        ClassLoader oldContextLoader=Thread.currentThread().getContextClassLoader();
        ClassLoader parentLoader=oldContextLoader;
        if (parentLoader == null)         parentLoader=this.getClass().getClassLoader();
        ClassLoader newContextLoader=DataSetProvider.getCustomScriptClassLoader(parentLoader,((DataSetEditor)getContainer()).getHandle().getModuleHandle());
        Thread.currentThread().setContextClassLoader(newContextLoader);
        Map dataSetBindingMap=new HashMap();
        Map dataSourceBindingMap=new HashMap();
        ModuleHandle handle;
        DataSetHandle dsHandle=((DataSetEditor)getContainer()).getHandle();
        handle=dsHandle.getModuleHandle();
        try {
          if (handle instanceof ReportDesignHandle) {
            EngineConfig ec=new EngineConfig();
            ec.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,newContextLoader);
            ReportEngine engine=(ReportEngine)new ReportEngineFactory().createReportEngine(ec);
            DataSetUIUtil.clearPropertyBindingMap(dsHandle,dataSetBindingMap,dataSourceBindingMap);
            DummyEngineTask engineTask=new DummyEngineTask(engine,new ReportEngineHelper(engine).openReportDesign((ReportDesignHandle)handle),handle);
            DataRequestSession session=engineTask.getDataSession();
            Map appContext=new HashMap();
            appContext.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(((DataSetHandle)getContainer().getModel()).getRowFetchLimit()));
            engineTask.setAppContext(appContext);
            engineTask.run();
            IQueryResults resultSet=executeProcess(session);
            populateRecords(resultSet);
            engineTask.close();
            engine.destroy();
            monitor.done();
          }
 else {
            DataSessionContext context;
            context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,((DataSetEditor)getContainer()).getHandle().getModuleHandle());
            DataRequestSession session=DataRequestSession.newSession(context);
            Map appContext=new HashMap();
            appContext.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(((DataSetHandle)getContainer().getModel()).getRowFetchLimit()));
            if (context.getAppContext() != null) {
              appContext.putAll(context.getAppContext());
            }
            context.setAppContext(appContext);
            IQueryResults resultSet=executeProcess(session);
            populateRecords(resultSet);
            session.shutdown();
          }
        }
 catch (        BirtException e) {
          ExceptionHandler.handle(e);
        }
 finally {
          try {
            DataSetUIUtil.resetPropertyBinding(dsHandle,dataSetBindingMap,dataSourceBindingMap);
          }
 catch (          SemanticException e) {
          }
        }
        Thread.currentThread().setContextClassLoader(oldContextLoader);
      }
    }
  }
;
  try {
    new ProgressMonitorDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell()){
      protected void cancelPressed(){
        super.cancelPressed();
        needsUpdateUI=false;
      }
    }
.run(true,true,runnable);
  }
 catch (  InvocationTargetException e) {
    ExceptionHandler.handle(e);
  }
catch (  InterruptedException e) {
    ExceptionHandler.handle(e);
  }
  updateResultSetTableUI();
}

Fixed version (ground truth):
/** 
 * Show ProgressMonitorDialog
 */
private void updateResultsProcess(){
  needsUpdateUI=true;
  clearResultSetTable();
  IRunnableWithProgress runnable=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
      if (resultSetTable != null && !resultSetTable.isDisposed()) {
        ClassLoader oldContextLoader=Thread.currentThread().getContextClassLoader();
        ClassLoader parentLoader=oldContextLoader;
        if (parentLoader == null)         parentLoader=this.getClass().getClassLoader();
        ClassLoader newContextLoader=DataSetProvider.getCustomScriptClassLoader(parentLoader,((DataSetEditor)getContainer()).getHandle().getModuleHandle());
        Thread.currentThread().setContextClassLoader(newContextLoader);
        Map dataSetBindingMap=new HashMap();
        Map dataSourceBindingMap=new HashMap();
        ModuleHandle handle;
        DataSetHandle dsHandle=((DataSetEditor)getContainer()).getHandle();
        handle=dsHandle.getModuleHandle();
        try {
          if (handle instanceof ReportDesignHandle) {
            EngineConfig ec=new EngineConfig();
            ec.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,newContextLoader);
            ReportEngine engine=(ReportEngine)new ReportEngineFactory().createReportEngine(ec);
            DataSetUIUtil.clearPropertyBindingMap(dsHandle,dataSetBindingMap,dataSourceBindingMap);
            DummyEngineTask engineTask=new DummyEngineTask(engine,new ReportEngineHelper(engine).openReportDesign((ReportDesignHandle)handle),handle);
            DataRequestSession session=engineTask.getDataSession();
            Map appContext=new HashMap();
            appContext.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(((DataSetHandle)getContainer().getModel()).getRowFetchLimit()));
            engineTask.setAppContext(appContext);
            engineTask.run();
            IQueryResults resultSet=executeProcess(session,engineTask.getExecutionContext());
            populateRecords(resultSet);
            engineTask.close();
            engine.destroy();
            monitor.done();
          }
 else {
            DataSessionContext context;
            context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,((DataSetEditor)getContainer()).getHandle().getModuleHandle());
            DataRequestSession session=DataRequestSession.newSession(context);
            Map appContext=new HashMap();
            appContext.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(((DataSetHandle)getContainer().getModel()).getRowFetchLimit()));
            if (context.getAppContext() != null) {
              appContext.putAll(context.getAppContext());
            }
            context.setAppContext(appContext);
            IQueryResults resultSet=executeProcess(session,null);
            populateRecords(resultSet);
            session.shutdown();
          }
        }
 catch (        BirtException e) {
          ExceptionHandler.handle(e);
        }
 finally {
          try {
            DataSetUIUtil.resetPropertyBinding(dsHandle,dataSetBindingMap,dataSourceBindingMap);
          }
 catch (          SemanticException e) {
          }
        }
        Thread.currentThread().setContextClassLoader(oldContextLoader);
      }
    }
  }
;
  try {
    new ProgressMonitorDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell()){
      protected void cancelPressed(){
        super.cancelPressed();
        needsUpdateUI=false;
      }
    }
.run(true,true,runnable);
  }
 catch (  InvocationTargetException e) {
    ExceptionHandler.handle(e);
  }
catch (  InterruptedException e) {
    ExceptionHandler.handle(e);
  }
  updateResultSetTableUI();
}