Program: 107976
Project: 107976
Buggy source:
@Override protected void doUpdate(final AnalysisContextClassification context){
  final StatisticsBuilderInterruptible builder=context.handle.getStatistics().getInterruptibleInstance();
  final String[] features=context.model.getSelectedFeatures().toArray(new String[0]);
  final String[] classes=context.model.getSelectedClasses().toArray(new String[0]);
  final double fraction=context.handle.getNumRows() > context.model.getClassificationModel().getMaximalNumberOfRecords() ? (double)context.model.getClassificationModel().getMaximalNumberOfRecords() / (double)context.handle.getNumRows() : 1d;
  final Integer seed=context.model.getClassificationModel().getSeed();
  final Integer numberOfFolds=context.model.getClassificationModel().getNumberOfFolds();
  Analysis analysis=new Analysis(){
    private boolean stopped=false;
    private List<List<Double>> values=new ArrayList<>();
    private List<Integer> numClasses=new ArrayList<>();
    private List<PrecisionRecallMatrix> matrixes=new ArrayList<>();
    private int progress=0;
    @Override public int getProgress(){
      return (int)((double)progress / (double)classes.length * 100d);
    }
    @Override public void onError(){
      setStatusEmpty();
    }
    @Override public void onFinish(){
      if (stopped || !isEnabled()) {
        return;
      }
      for (      final TableItem i : table.getItems()) {
        i.dispose();
      }
      for (int i=0; i < classes.length; i++) {
        TableItem item=new TableItem(table,SWT.NONE);
        item.setText(0,classes[i]);
        item.setText(1,String.valueOf(numClasses.get(i)));
        for (int j=0; j < values.get(i).size(); j++) {
          item.setData(String.valueOf(2 + j),values.get(i).get(j));
        }
        item.setData(matrixes.get(i));
      }
      table.setFocus();
      table.select(0);
      setChartSeries(matrixes.get(0));
      root.layout();
      sash.setWeights(new int[]{2,2});
      setStatusDone();
    }
    @Override public void onInterrupt(){
      if (!isEnabled()) {
        setStatusEmpty();
      }
 else {
        setStatusWorking();
      }
    }
    @Override public void run() throws InterruptedException {
      long time=System.currentTimeMillis();
      for (      String clazz : classes) {
        StatisticsClassification result=builder.getClassificationPerformance(features,clazz,seed,fraction);
        progress++;
        if (stopped) {
          break;
        }
        numClasses.add(result.getNumClasses());
        values.add(getColumnValues(result));
        matrixes.add(result.getPrecisionRecall());
      }
      while (System.currentTimeMillis() - time < MINIMAL_WORKING_TIME && !stopped) {
        Thread.sleep(10);
      }
    }
    @Override public void stop(){
      builder.interrupt();
      this.stopped=true;
    }
  }
;
  this.manager.start(analysis);
}

Fixed version (ground truth):
@Override protected void doUpdate(final AnalysisContextClassification context){
  final StatisticsBuilderInterruptible builder=context.handle.getStatistics().getInterruptibleInstance();
  final String[] features=context.model.getSelectedFeatures().toArray(new String[0]);
  final String[] classes=context.model.getSelectedClasses().toArray(new String[0]);
  final double fraction=context.handle.getNumRows() > context.model.getClassificationModel().getMaximalNumberOfRecords() ? (double)context.model.getClassificationModel().getMaximalNumberOfRecords() / (double)context.handle.getNumRows() : 1d;
  final Integer seed=context.model.getClassificationModel().getSeed();
  final Integer numberOfFolds=context.model.getClassificationModel().getNumberOfFolds();
  if (context.model.getSelectedFeatures().isEmpty() || context.model.getSelectedClasses().isEmpty()) {
    doReset();
    return;
  }
  Analysis analysis=new Analysis(){
    private boolean stopped=false;
    private List<List<Double>> values=new ArrayList<>();
    private List<Integer> numClasses=new ArrayList<>();
    private List<PrecisionRecallMatrix> matrixes=new ArrayList<>();
    private int progress=0;
    @Override public int getProgress(){
      return (int)((double)progress / (double)classes.length * 100d);
    }
    @Override public void onError(){
      setStatusEmpty();
    }
    @Override public void onFinish(){
      if (stopped || !isEnabled() || getModel().getSelectedFeatures().isEmpty()|| getModel().getSelectedClasses().isEmpty()) {
        setStatusEmpty();
        return;
      }
      for (      final TableItem i : table.getItems()) {
        i.dispose();
      }
      for (int i=0; i < classes.length; i++) {
        TableItem item=new TableItem(table,SWT.NONE);
        item.setText(0,classes[i]);
        item.setText(1,String.valueOf(numClasses.get(i)));
        for (int j=0; j < values.get(i).size(); j++) {
          item.setData(String.valueOf(2 + j),values.get(i).get(j));
        }
        item.setData(matrixes.get(i));
      }
      table.setFocus();
      table.select(0);
      setChartSeries(matrixes.get(0));
      root.layout();
      sash.setWeights(new int[]{2,2});
      setStatusDone();
    }
    @Override public void onInterrupt(){
      if (!isEnabled() || getModel().getSelectedFeatures().isEmpty() || getModel().getSelectedClasses().isEmpty()) {
        setStatusEmpty();
      }
 else {
        setStatusWorking();
      }
    }
    @Override public void run() throws InterruptedException {
      long time=System.currentTimeMillis();
      for (      String clazz : classes) {
        StatisticsClassification result=builder.getClassificationPerformance(features,clazz,seed,fraction);
        progress++;
        if (stopped) {
          break;
        }
        numClasses.add(result.getNumClasses());
        values.add(getColumnValues(result));
        matrixes.add(result.getPrecisionRecall());
      }
      while (System.currentTimeMillis() - time < MINIMAL_WORKING_TIME && !stopped) {
        Thread.sleep(10);
      }
    }
    @Override public void stop(){
      builder.interrupt();
      this.stopped=true;
    }
  }
;
  this.manager.start(analysis);
}