Program: 137812
Project: 137812
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));
  Composite actionBarComp=toolkit.createComposite(sectionClient);
  GridLayout gdLayout=new GridLayout();
  gdLayout.numColumns=2;
  actionBarComp.setLayout(gdLayout);
  ImageHyperlink collapseAllImageLink=toolkit.createImageHyperlink(actionBarComp,SWT.NONE);
  collapseAllImageLink.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  collapseAllImageLink.setImage(ImageLib.getImage(ImageLib.COLLAPSE_ALL));
  collapseAllImageLink.addHyperlinkListener(new HyperlinkAdapter(){
    @Override public void linkActivated(    HyperlinkEvent e){
      if (previewChartList != null && !previewChartList.isEmpty()) {
        for (        ExpandableComposite comp : previewChartList) {
          comp.setExpanded(false);
          comp.getParent().pack();
        }
      }
    }
  }
);
  ImageHyperlink expandAllImageLink=toolkit.createImageHyperlink(actionBarComp,SWT.NONE);
  expandAllImageLink.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  expandAllImageLink.setImage(ImageLib.getImage(ImageLib.EXPAND_ALL));
  expandAllImageLink.addHyperlinkListener(new HyperlinkAdapter(){
    @Override public void linkActivated(    HyperlinkEvent e){
      if (previewChartList != null && !previewChartList.isEmpty()) {
        for (        ExpandableComposite comp : previewChartList) {
          comp.setExpanded(true);
          comp.getParent().pack();
        }
      }
    }
  }
);
  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=analysisHandler.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);
}

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));
  Composite actionBarComp=toolkit.createComposite(sectionClient);
  GridLayout gdLayout=new GridLayout();
  gdLayout.numColumns=2;
  actionBarComp.setLayout(gdLayout);
  ImageHyperlink collapseAllImageLink=toolkit.createImageHyperlink(actionBarComp,SWT.NONE);
  collapseAllImageLink.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  collapseAllImageLink.setImage(ImageLib.getImage(ImageLib.COLLAPSE_ALL));
  collapseAllImageLink.addHyperlinkListener(new HyperlinkAdapter(){
    @Override public void linkActivated(    HyperlinkEvent e){
      if (previewChartList != null && !previewChartList.isEmpty()) {
        for (        ExpandableComposite comp : previewChartList) {
          comp.setExpanded(false);
          comp.getParent().pack();
        }
      }
    }
  }
);
  ImageHyperlink expandAllImageLink=toolkit.createImageHyperlink(actionBarComp,SWT.NONE);
  expandAllImageLink.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str"));
  expandAllImageLink.setImage(ImageLib.getImage(ImageLib.EXPAND_ALL));
  expandAllImageLink.addHyperlinkListener(new HyperlinkAdapter(){
    @Override public void linkActivated(    HyperlinkEvent e){
      if (previewChartList != null && !previewChartList.isEmpty()) {
        for (        ExpandableComposite comp : previewChartList) {
          comp.setExpanded(true);
          comp.getParent().pack();
        }
      }
    }
  }
);
  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=analysisHandler.getAnalysis();
  refreshBtn.addHyperlinkListener(new HyperlinkAdapter(){
    @Override public void linkActivated(    HyperlinkEvent e){
      disposeChartComposite();
      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);
}