Program: 107844
Project: 107844
Buggy source:
@Override protected void doUpdate(AnalysisContextQuality context){
  final StatisticsBuilderInterruptible builder=context.handle.getStatistics().getInterruptibleInstance();
  Analysis analysis=new Analysis(){
    private boolean stopped=false;
    private StatisticsQuality quality;
    @Override public int getProgress(){
      return 0;
    }
    @Override public void onError(){
      setStatusEmpty();
    }
    @Override public void onFinish(){
      if (stopped || !isEnabled()) {
        return;
      }
      table.setRedraw(false);
      for (      final TableItem i : table.getItems()) {
        i.dispose();
      }
      for (      String attribute : quality.getAttributes()) {
        createItem(attribute,quality);
      }
      table.setRedraw(true);
      table.layout();
      if (table2 != null) {
        table2.setRedraw(false);
        for (        final TableItem i : table2.getItems()) {
          i.dispose();
        }
        TableItem item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getGeneralizationIntensity().getArithmeticMean(false));
        item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getGranularity().getArithmeticMean(false));
        item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getGranularity().getArithmeticMean(false));
        item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getDiscernibility().getValue());
        item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getAverageClassSize().getValue());
        item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getKullbackLeiblerDivergence().getValue());
        item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getSumOfSquaredErrors().getValue());
        table2.setRedraw(true);
        table2.layout();
      }
      setStatusDone();
    }
    @Override public void onInterrupt(){
      if (!isEnabled()) {
        setStatusEmpty();
      }
 else {
        setStatusWorking();
      }
    }
    @Override public void run() throws InterruptedException {
      long time=System.currentTimeMillis();
      this.quality=builder.getQualityStatistics();
      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(AnalysisContextQuality context){
  final StatisticsBuilderInterruptible builder=context.handle.getStatistics().getInterruptibleInstance();
  Analysis analysis=new Analysis(){
    private boolean stopped=false;
    private StatisticsQuality quality;
    @Override public int getProgress(){
      return 0;
    }
    @Override public void onError(){
      setStatusEmpty();
    }
    @Override public void onFinish(){
      if (stopped || !isEnabled()) {
        return;
      }
      table.setRedraw(false);
      for (      final TableItem i : table.getItems()) {
        i.dispose();
      }
      for (      String attribute : quality.getAttributes()) {
        createItem(attribute,quality);
      }
      table.setRedraw(true);
      table.layout();
      if (table2 != null) {
        table2.setRedraw(false);
        for (        final TableItem i : table2.getItems()) {
          i.dispose();
        }
        TableItem item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getGeneralizationIntensity().getArithmeticMean(false));
        item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getGranularity().getArithmeticMean(false));
        item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getNonUniformEntropy().getArithmeticMean(false));
        item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getDiscernibility().getValue());
        item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getAverageClassSize().getValue());
        item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getKullbackLeiblerDivergence().getValue());
        item=new TableItem(table2,SWT.NONE);
        item.setText(0,"String_Node_Str");
        setNumericValueAtIndex(item,1,quality.getSumOfSquaredErrors().getValue());
        table2.setRedraw(true);
        table2.layout();
      }
      setStatusDone();
    }
    @Override public void onInterrupt(){
      if (!isEnabled()) {
        setStatusEmpty();
      }
 else {
        setStatusWorking();
      }
    }
    @Override public void run() throws InterruptedException {
      long time=System.currentTimeMillis();
      this.quality=builder.getQualityStatistics();
      while (System.currentTimeMillis() - time < MINIMAL_WORKING_TIME && !stopped) {
        Thread.sleep(10);
      }
    }
    @Override public void stop(){
      builder.interrupt();
      this.stopped=true;
    }
  }
;
  this.manager.start(analysis);
}