Program: 137804
Project: 137804
Buggy source:
void createPreviewSection(final ScrolledForm form,Composite parent){
  previewSection=createSection(form,parent,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
  previewSection.setLayoutData(new GridData(GridData.FILL_BOTH));
  Composite sectionClient=toolkit.createComposite(previewSection);
  sectionClient.setLayout(new GridLayout());
  sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
  ImageHyperlink refreshBtn=toolkit.createImageHyperlink(sectionClient,SWT.NONE);
  refreshBtn.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  refreshBtn.setImage(ImageLib.getImage(ImageLib.SECTION_PREVIEW));
  final Label message=toolkit.createLabel(sectionClient,DefaultMessagesImpl.getString("String_Node_Str"));
  message.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
  message.setVisible(false);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.TOP).applyTo(sectionClient);
  chartComposite=toolkit.createComposite(sectionClient);
  chartComposite.setLayout(new GridLayout());
  chartComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  final Analysis analysis=correlationAnalysisHandler.getAnalysis();
  refreshBtn.addHyperlinkListener(new HyperlinkAdapter(){
    public void linkActivated(    HyperlinkEvent e){
      for (      Control control : chartComposite.getChildren()) {
        control.dispose();
      }
      boolean analysisStatue=analysis.getResults().getResultMetadata() != null && analysis.getResults().getResultMetadata().getExecutionDate() != null;
      if (!analysisStatue) {
        boolean returnCode=MessageDialog.openConfirm(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
        if (returnCode) {
          new RunAnalysisAction().run();
          message.setVisible(false);
        }
 else {
          createPreviewCharts(form,chartComposite,false);
          message.setText(DefaultMessagesImpl.getString("String_Node_Str"));
          message.setVisible(true);
        }
      }
 else {
        createPreviewCharts(form,chartComposite,true);
      }
      chartComposite.layout();
      form.reflow(true);
    }
  }
);
  previewSection.setClient(sectionClient);
}

Fixed version (ground truth):
void createPreviewSection(final ScrolledForm form,Composite parent){
  previewSection=createSection(form,parent,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
  previewSection.setLayoutData(new GridData(GridData.FILL_BOTH));
  Composite sectionClient=toolkit.createComposite(previewSection);
  sectionClient.setLayout(new GridLayout());
  sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
  ImageHyperlink refreshBtn=toolkit.createImageHyperlink(sectionClient,SWT.NONE);
  refreshBtn.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  refreshBtn.setImage(ImageLib.getImage(ImageLib.SECTION_PREVIEW));
  final Label message=toolkit.createLabel(sectionClient,DefaultMessagesImpl.getString("String_Node_Str"));
  message.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
  message.setVisible(false);
  GridDataFactory.fillDefaults().align(SWT.FILL,SWT.TOP).applyTo(sectionClient);
  chartComposite=toolkit.createComposite(sectionClient);
  chartComposite.setLayout(new GridLayout());
  chartComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  final Analysis analysis=correlationAnalysisHandler.getAnalysis();
  refreshBtn.addHyperlinkListener(new HyperlinkAdapter(){
    @Override public void linkActivated(    HyperlinkEvent e){
      for (      Control control : chartComposite.getChildren()) {
        control.dispose();
      }
      boolean analysisStatue=analysis.getResults().getResultMetadata() != null && analysis.getResults().getResultMetadata().getExecutionDate() != null;
      if (!analysisStatue) {
        boolean returnCode=MessageDialog.openConfirm(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
        if (returnCode) {
          new RunAnalysisAction().run();
          message.setVisible(false);
        }
 else {
          createPreviewCharts(form,chartComposite,false);
          message.setText(DefaultMessagesImpl.getString("String_Node_Str"));
          message.setVisible(true);
        }
      }
 else {
        createPreviewCharts(form,chartComposite,true);
      }
      chartComposite.layout();
      form.reflow(true);
    }
  }
);
  previewSection.setClient(sectionClient);
}