Program: 135979
Project: 135979
Buggy source:
/** 
 * Draw the fields Its helpful to know what the standard SWT widgets look like. Pictures can be found at http://www.eclipse.org/swt/widgets/ Layouts are used throughout this method. A good explanation of layouts is given in the article http://www.eclipse.org/articles/article.php?file=Article-Understanding-Layouts/index.html
 */
protected void createBodyContent(IManagedForm managedForm){
  int sectionFlags=Section.TITLE_BAR | Section.DESCRIPTION | Section.TREE_NODE| Section.EXPANDED| SWT.WRAP;
  int textFieldFlags=SWT.MULTI | SWT.V_SCROLL | SWT.READ_ONLY| SWT.FULL_SELECTION| SWT.WRAP;
  FormToolkit toolkit=managedForm.getToolkit();
  Composite body=managedForm.getForm().getBody();
  TableWrapLayout layout=new TableWrapLayout();
  layout.numColumns=1;
  body.setLayout(layout);
  TableWrapData twd;
  Section section;
  GridData gd;
  section=FormHelper.createSectionComposite(body,"String_Node_Str","String_Node_Str",toolkit,sectionFlags & ~Section.DESCRIPTION,getExpansionListener());
  twd=new TableWrapData(TableWrapData.FILL);
  twd.colspan=1;
  section.setLayoutData(twd);
  Composite generalArea=(Composite)section.getClient();
  generalArea.setLayout(new GridLayout());
  Composite statusComposite=toolkit.createComposite(generalArea);
  statusComposite.setLayout(new GridLayout(2,false));
  this.startTimestampText=FormHelper.createTextLeft("String_Node_Str",statusComposite,toolkit);
  this.startTimestampText.setEditable(false);
  this.finishTimestampText=FormHelper.createTextLeft("String_Node_Str",statusComposite,toolkit);
  this.finishTimestampText.setEditable(false);
  this.lastCheckpointTimeText=FormHelper.createTextLeft("String_Node_Str",statusComposite,toolkit);
  this.lastCheckpointTimeText.setEditable(false);
  this.currentStatusText=FormHelper.createTextLeft("String_Node_Str",statusComposite,toolkit);
  this.currentStatusText.setEditable(false);
  this.currentStatusText.setText(TLCModelLaunchDataProvider.NOT_RUNNING);
  this.errorStatusHyperLink=FormHelper.createHyperlinkLeft("String_Node_Str",statusComposite,toolkit);
  section=FormHelper.createSectionComposite(body,"String_Node_Str","String_Node_Str",toolkit,(sectionFlags | Section.COMPACT) & ~Section.DESCRIPTION,getExpansionListener());
  twd=new TableWrapData(TableWrapData.FILL);
  twd.colspan=1;
  section.setLayoutData(twd);
  Composite statArea=(Composite)section.getClient();
  RowLayout rowLayout=new RowLayout(SWT.HORIZONTAL);
  statArea.setLayout(rowLayout);
  createAndSetupStateSpace("String_Node_Str",statArea,toolkit);
  createAndSetupCoverage("String_Node_Str",statArea,toolkit);
  section=FormHelper.createSectionComposite(body,"String_Node_Str","String_Node_Str",toolkit,sectionFlags & ~Section.DESCRIPTION,getExpansionListener());
  Composite resultArea=(Composite)section.getClient();
  GridLayout gLayout=new GridLayout(2,false);
  gLayout.marginHeight=0;
  resultArea.setLayout(gLayout);
  Composite expressionComposite=toolkit.createComposite(resultArea);
  expressionComposite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,false));
  gLayout=new GridLayout(1,false);
  gLayout.marginHeight=0;
  gLayout.marginBottom=5;
  expressionComposite.setLayout(gLayout);
  toolkit.createLabel(expressionComposite,"String_Node_Str");
  expressionEvalInput=FormHelper.createFormsSourceViewer(toolkit,expressionComposite,textFieldFlags);
  Composite valueComposite=toolkit.createComposite(resultArea);
  valueComposite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false));
  valueComposite.setLayout(gLayout);
  toolkit.createLabel(valueComposite,"String_Node_Str");
  expressionEvalResult=FormHelper.createFormsOutputViewer(toolkit,valueComposite,textFieldFlags);
  gd=new GridData(SWT.FILL,SWT.FILL,true,false);
  gd.minimumWidth=500;
  gd.heightHint=80;
  expressionEvalResult.getTextWidget().setLayoutData(gd);
  gd=new GridData(SWT.FILL,SWT.FILL,false,false);
  gd.widthHint=500;
  gd.heightHint=80;
  expressionEvalInput.getTextWidget().setLayoutData(gd);
  expressionEvalResult.getTextWidget().setFont(JFaceResources.getTextFont());
  expressionEvalInput.getTextWidget().setFont(JFaceResources.getTextFont());
  toolkit.paintBordersFor(expressionComposite);
  toolkit.paintBordersFor(valueComposite);
  ValidateableSectionPart calculatorSectionPart=new ValidateableSectionPart(section,this,SEC_EXPRESSION);
  managedForm.addPart(calculatorSectionPart);
  expressionEvalInput.getTextWidget().addModifyListener(new DirtyMarkingListener(calculatorSectionPart,false));
  getDataBindingManager().bindAttribute(MODEL_EXPRESSION_EVAL,expressionEvalInput,calculatorSectionPart);
  section=FormHelper.createSectionComposite(body,"String_Node_Str","String_Node_Str",toolkit,sectionFlags,getExpansionListener());
  Composite outputArea=(Composite)section.getClient();
  outputArea.setLayout(new GridLayout());
  userOutput=FormHelper.createFormsOutputViewer(toolkit,outputArea,textFieldFlags);
  gd=new GridData(SWT.FILL,SWT.LEFT,true,false);
  gd.heightHint=300;
  gd.minimumWidth=300;
  userOutput.getControl().setLayoutData(gd);
  userOutput.getControl().setFont(JFaceResources.getFont(ITLCPreferenceConstants.I_TLC_OUTPUT_FONT));
  section=FormHelper.createSectionComposite(body,"String_Node_Str","String_Node_Str",toolkit,sectionFlags & ~Section.DESCRIPTION,getExpansionListener());
  section.setExpanded(false);
  Composite progressArea=(Composite)section.getClient();
  progressArea=(Composite)section.getClient();
  progressArea.setLayout(new GridLayout());
  progressOutput=FormHelper.createFormsOutputViewer(toolkit,progressArea,textFieldFlags);
  gd=new GridData(SWT.FILL,SWT.LEFT,true,false);
  gd.heightHint=300;
  gd.minimumWidth=300;
  progressOutput.getControl().setLayoutData(gd);
  progressOutput.getControl().setFont(JFaceResources.getFont(ITLCPreferenceConstants.I_TLC_OUTPUT_FONT));
  Vector controls=new Vector();
  controls.add(userOutput.getControl());
  controls.add(progressOutput.getControl());
  fontChangeListener=new FontPreferenceChangeListener(controls,ITLCPreferenceConstants.I_TLC_OUTPUT_FONT);
  JFaceResources.getFontRegistry().addListener(fontChangeListener);
}

Fixed version (ground truth):
/** 
 * Draw the fields Its helpful to know what the standard SWT widgets look like. Pictures can be found at http://www.eclipse.org/swt/widgets/ Layouts are used throughout this method. A good explanation of layouts is given in the article http://www.eclipse.org/articles/article.php?file=Article-Understanding-Layouts/index.html
 */
protected void createBodyContent(IManagedForm managedForm){
  int sectionFlags=Section.TITLE_BAR | Section.DESCRIPTION | Section.TREE_NODE| Section.EXPANDED| SWT.WRAP;
  int textFieldFlags=SWT.MULTI | SWT.V_SCROLL | SWT.READ_ONLY| SWT.FULL_SELECTION| SWT.WRAP;
  FormToolkit toolkit=managedForm.getToolkit();
  Composite body=managedForm.getForm().getBody();
  TableWrapLayout layout=new TableWrapLayout();
  layout.numColumns=1;
  body.setLayout(layout);
  TableWrapData twd;
  Section section;
  GridData gd;
  section=FormHelper.createSectionComposite(body,"String_Node_Str","String_Node_Str",toolkit,sectionFlags & ~Section.DESCRIPTION,getExpansionListener());
  twd=new TableWrapData(TableWrapData.FILL);
  twd.colspan=1;
  section.setLayoutData(twd);
  Composite generalArea=(Composite)section.getClient();
  generalArea.setLayout(new GridLayout());
  Composite statusComposite=toolkit.createComposite(generalArea);
  statusComposite.setLayout(new GridLayout(2,false));
  this.startTimestampText=FormHelper.createTextLeft("String_Node_Str",statusComposite,toolkit);
  this.startTimestampText.setEditable(false);
  this.finishTimestampText=FormHelper.createTextLeft("String_Node_Str",statusComposite,toolkit);
  this.finishTimestampText.setEditable(false);
  this.lastCheckpointTimeText=FormHelper.createTextLeft("String_Node_Str",statusComposite,toolkit);
  this.lastCheckpointTimeText.setEditable(false);
  this.currentStatusText=FormHelper.createTextLeft("String_Node_Str",statusComposite,toolkit);
  this.currentStatusText.setEditable(false);
  this.currentStatusText.setText(TLCModelLaunchDataProvider.NOT_RUNNING);
  this.errorStatusHyperLink=FormHelper.createHyperlinkLeft("String_Node_Str",statusComposite,toolkit);
  section=FormHelper.createSectionComposite(body,"String_Node_Str","String_Node_Str",toolkit,(sectionFlags | Section.COMPACT) & ~Section.DESCRIPTION,getExpansionListener());
  twd=new TableWrapData(TableWrapData.FILL);
  twd.colspan=1;
  section.setLayoutData(twd);
  Composite statArea=(Composite)section.getClient();
  RowLayout rowLayout=new RowLayout(SWT.HORIZONTAL);
  statArea.setLayout(rowLayout);
  createAndSetupStateSpace("String_Node_Str",statArea,toolkit);
  createAndSetupCoverage("String_Node_Str",statArea,toolkit);
  section=FormHelper.createSectionComposite(body,"String_Node_Str","String_Node_Str",toolkit,sectionFlags & ~Section.DESCRIPTION,getExpansionListener());
  Composite resultArea=(Composite)section.getClient();
  GridLayout gLayout=new GridLayout(2,false);
  gLayout.marginHeight=0;
  resultArea.setLayout(gLayout);
  Composite expressionComposite=toolkit.createComposite(resultArea);
  expressionComposite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,false));
  gLayout=new GridLayout(1,false);
  gLayout.marginHeight=0;
  gLayout.marginBottom=5;
  expressionComposite.setLayout(gLayout);
  toolkit.createLabel(expressionComposite,"String_Node_Str");
  expressionEvalInput=FormHelper.createFormsSourceViewer(toolkit,expressionComposite,textFieldFlags);
  Composite valueComposite=toolkit.createComposite(resultArea);
  valueComposite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false));
  valueComposite.setLayout(gLayout);
  toolkit.createLabel(valueComposite,"String_Node_Str");
  expressionEvalResult=FormHelper.createFormsOutputViewer(toolkit,valueComposite,textFieldFlags);
  gd=new GridData(SWT.FILL,SWT.FILL,true,false);
  gd.minimumWidth=500;
  gd.heightHint=80;
  expressionEvalResult.getTextWidget().setLayoutData(gd);
  gd=new GridData(SWT.FILL,SWT.FILL,false,false);
  gd.widthHint=500;
  gd.heightHint=80;
  expressionEvalInput.getTextWidget().setLayoutData(gd);
  expressionEvalResult.getTextWidget().setFont(JFaceResources.getTextFont());
  expressionEvalInput.getTextWidget().setFont(JFaceResources.getTextFont());
  toolkit.paintBordersFor(expressionComposite);
  toolkit.paintBordersFor(valueComposite);
  ValidateableSectionPart calculatorSectionPart=new ValidateableSectionPart(section,this,SEC_EXPRESSION);
  managedForm.addPart(calculatorSectionPart);
  expressionEvalInput.getTextWidget().addModifyListener(new DirtyMarkingListener(calculatorSectionPart,false));
  getDataBindingManager().bindAttribute(MODEL_EXPRESSION_EVAL,expressionEvalInput,calculatorSectionPart);
  getDataBindingManager().bindSection(calculatorSectionPart,SEC_EXPRESSION,getId());
  section=FormHelper.createSectionComposite(body,"String_Node_Str","String_Node_Str",toolkit,sectionFlags,getExpansionListener());
  Composite outputArea=(Composite)section.getClient();
  outputArea.setLayout(new GridLayout());
  userOutput=FormHelper.createFormsOutputViewer(toolkit,outputArea,textFieldFlags);
  gd=new GridData(SWT.FILL,SWT.LEFT,true,false);
  gd.heightHint=300;
  gd.minimumWidth=300;
  userOutput.getControl().setLayoutData(gd);
  userOutput.getControl().setFont(JFaceResources.getFont(ITLCPreferenceConstants.I_TLC_OUTPUT_FONT));
  section=FormHelper.createSectionComposite(body,"String_Node_Str","String_Node_Str",toolkit,sectionFlags & ~Section.DESCRIPTION,getExpansionListener());
  section.setExpanded(false);
  Composite progressArea=(Composite)section.getClient();
  progressArea=(Composite)section.getClient();
  progressArea.setLayout(new GridLayout());
  progressOutput=FormHelper.createFormsOutputViewer(toolkit,progressArea,textFieldFlags);
  gd=new GridData(SWT.FILL,SWT.LEFT,true,false);
  gd.heightHint=300;
  gd.minimumWidth=300;
  progressOutput.getControl().setLayoutData(gd);
  progressOutput.getControl().setFont(JFaceResources.getFont(ITLCPreferenceConstants.I_TLC_OUTPUT_FONT));
  Vector controls=new Vector();
  controls.add(userOutput.getControl());
  controls.add(progressOutput.getControl());
  fontChangeListener=new FontPreferenceChangeListener(controls,ITLCPreferenceConstants.I_TLC_OUTPUT_FONT);
  JFaceResources.getFontRegistry().addListener(fontChangeListener);
}