Program: 118907
Project: 118907
Buggy source:
private void createReportField(Composite parent){
  reportComposite=createFlatFormComposite(parent,new FormToolkit(Display.getDefault()));
  FormLayout reportLayout=new FormLayout();
  reportComposite.setLayout(reportLayout);
  FormData reportData=new FormData();
  reportData.left=new FormAttachment(65,5);
  reportData.right=new FormAttachment(100,-5);
  reportData.top=new FormAttachment(0,0);
  reportData.bottom=new FormAttachment(100,-5);
  reportComposite.setLayoutData(reportData);
  Group group=new Group(reportComposite,SWT.NULL);
  FormLayout groupLayout=new FormLayout();
  group.setLayout(groupLayout);
  FormData groupData=new FormData();
  groupData.left=new FormAttachment(0,0);
  groupData.right=new FormAttachment(100,0);
  groupData.top=new FormAttachment(0,0);
  groupData.bottom=new FormAttachment(100,0);
  group.setLayoutData(groupData);
  group.setText("String_Node_Str");
  reportField=new StyledText(group,SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY);
  reportField.setBackground(getDisplay().getSystemColor(SWT.COLOR_WHITE));
  FormData data;
  data=new FormData();
  data.left=new FormAttachment(0,0);
  data.right=new FormAttachment(100,0);
  data.top=new FormAttachment(0,0);
  data.bottom=new FormAttachment(93,0);
  reportField.setLayoutData(data);
  displayReportField();
  Button exportButton=new Button(group,SWT.PUSH);
  exportButton.setText("String_Node_Str");
  FormData exportData=new FormData();
  exportData.left=new FormAttachment(100,-70);
  exportData.right=new FormAttachment(100,0);
  exportData.bottom=new FormAttachment(100,-1);
  exportButton.setLayoutData(exportData);
  exportButton.setEnabled(true);
  exportButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      if (messageManager == null || messageManager.getMessages().size() < 1) {
        MessageDialog.openWarning(getShell(),"String_Node_Str","String_Node_Str");
        return;
      }
      UnboundedFifoBuffer messages=messageManager.getMessages();
      Iterator iterator=messages.iterator();
      StringBuilder content=new StringBuilder();
      while (iterator.hasNext()) {
        ReportMessage message=(ReportMessage)iterator.next();
        content.append(message.getContent());
      }
      String[] msg=content.toString().split("String_Node_Str");
      if (!msg[msg.length - 1].startsWith("String_Node_Str")) {
        MessageDialog.openWarning(getShell(),"String_Node_Str","String_Node_Str");
        return;
      }
      FileDialog dialog=new FileDialog(getShell(),SWT.SAVE);
      dialog.setFilterPath("String_Node_Str");
      String fileName=dialog.open();
      if (fileName != null) {
        FileWriter writer=null;
        try {
          writer=new FileWriter(fileName);
          writer.write(content.toString());
        }
 catch (        IOException e1) {
          e1.printStackTrace();
        }
 finally {
          try {
            if (writer != null) {
              writer.close();
            }
          }
 catch (          IOException e1) {
            e1.printStackTrace();
          }
        }
      }
    }
  }
);
}

Fixed version (ground truth):
private void createReportField(Composite parent){
  reportComposite=createFlatFormComposite(parent,new FormToolkit(Display.getDefault()));
  FormLayout reportLayout=new FormLayout();
  reportComposite.setLayout(reportLayout);
  FormData reportData=new FormData();
  reportData.left=new FormAttachment(65,5);
  reportData.right=new FormAttachment(100,-5);
  reportData.top=new FormAttachment(0,0);
  reportData.bottom=new FormAttachment(100,-5);
  reportComposite.setLayoutData(reportData);
  Group group=new Group(reportComposite,SWT.NULL);
  FormLayout groupLayout=new FormLayout();
  group.setLayout(groupLayout);
  FormData groupData=new FormData();
  groupData.left=new FormAttachment(0,0);
  groupData.right=new FormAttachment(100,0);
  groupData.top=new FormAttachment(0,0);
  groupData.bottom=new FormAttachment(100,0);
  group.setLayoutData(groupData);
  group.setText("String_Node_Str");
  reportField=new StyledText(group,SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY);
  reportField.setBackground(getDisplay().getSystemColor(SWT.COLOR_WHITE));
  FormData data;
  data=new FormData();
  data.left=new FormAttachment(0,0);
  data.right=new FormAttachment(100,0);
  data.top=new FormAttachment(0,0);
  data.bottom=new FormAttachment(93,0);
  reportField.setLayoutData(data);
  displayReportField();
  Button exportButton=new Button(group,SWT.PUSH);
  exportButton.setText("String_Node_Str");
  FormData exportData=new FormData();
  exportData.left=new FormAttachment(100,-70);
  exportData.right=new FormAttachment(100,0);
  exportData.bottom=new FormAttachment(100,-1);
  exportButton.setLayoutData(exportData);
  exportButton.setEnabled(true);
  exportButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      if (messageManager == null || messageManager.getMessages().size() < 1) {
        MessageDialog.openWarning(getShell(),"String_Node_Str","String_Node_Str");
        return;
      }
      UnboundedFifoBuffer messages=messageManager.getMessages();
      Iterator iterator=messages.iterator();
      StringBuilder content=new StringBuilder();
      while (iterator.hasNext()) {
        ReportMessage message=(ReportMessage)iterator.next();
        content.append(message.getContent());
      }
      if (isMonitoring) {
        MessageDialog.openWarning(getShell(),"String_Node_Str","String_Node_Str");
        return;
      }
      FileDialog dialog=new FileDialog(getShell(),SWT.SAVE);
      dialog.setFilterPath("String_Node_Str");
      String fileName=dialog.open();
      if (fileName != null) {
        FileWriter writer=null;
        try {
          writer=new FileWriter(fileName);
          writer.write(content.toString());
        }
 catch (        IOException e1) {
          e1.printStackTrace();
        }
 finally {
          try {
            if (writer != null) {
              writer.close();
            }
          }
 catch (          IOException e1) {
            e1.printStackTrace();
          }
        }
      }
    }
  }
);
}