Program: 107931
Project: 107931
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 ARXLogisticRegressionConfiguration config=context.model.getClassificationModel().getARXLogisticRegressionConfiguration();
  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(){
      double result=0d;
      double perBatch=100d / (double)classes.length;
      if (progress >= 1) {
        result+=(double)(progress - 1) * perBatch;
      }
      result+=(double)builder.getProgress() / 100d * perBatch;
      result=result <= 100d ? result : 100d;
      return (int)result;
    }
    @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,config);
        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 ARXLogisticRegressionConfiguration config=context.model.getClassificationModel().getARXLogisticRegressionConfiguration();
  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(){
      double result=0d;
      double perBatch=100d / (double)classes.length;
      result+=(double)progress * perBatch;
      result+=(double)builder.getProgress() / 100d * perBatch;
      result=result <= 100d ? result : 100d;
      return (int)result;
    }
    @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,config);
        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);
}