Program: 70899
Project: 70899
Buggy source:
/** 
 * Create controls in the preview editor.
 * @param parent parent composite
 */
public void createPartControl(Composite parent){
  final ScrolledComposite sc=new ScrolledComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL);
  sc.setExpandHorizontal(true);
  sc.setExpandVertical(true);
  mainPane=new Composite(sc,SWT.NONE);
  GridLayout layout=new GridLayout(1,false);
  layout.verticalSpacing=0;
  mainPane.setLayout(layout);
  mainPane.setLayoutData(new GridData(GridData.FILL_BOTH));
  final Composite buttonTray=new Composite(mainPane,SWT.NONE);
  GridData gData=new GridData(GridData.FILL_BOTH);
  gData.grabExcessHorizontalSpace=true;
  gData.grabExcessVerticalSpace=false;
  buttonTray.setLayoutData(gData);
  layout=new GridLayout(2,false);
  layout.marginWidth=5;
  layout.horizontalSpacing=0;
  buttonTray.setLayout(layout);
  bParameter=new Button(buttonTray,SWT.PUSH);
  bParameter.setToolTipText(Messages.getString("String_Node_Str"));
  bParameter.setText(Messages.getString("String_Node_Str"));
  GridData gd=new GridData();
  bParameter.setLayoutData(gd);
  final FormText note=new FormText(buttonTray,SWT.NONE);
  note.setText(getDisplayInfoText(ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXROW)),true,true);
  note.setSize(SWT.DEFAULT - 10,SWT.DEFAULT);
  gd=new GridData();
  gd.horizontalIndent=20;
  note.setLayoutData(gd);
  note.addHyperlinkListener(new HyperlinkAdapter(){
    public void linkActivated(    HyperlinkEvent e){
      if (PreferencesUtil.createPreferenceDialogOn(UIUtil.getDefaultShell(),"String_Node_Str",new String[]{"String_Node_Str"},null).open() == Window.OK) {
        boolean ret=MessageDialog.openQuestion(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
        if (ret == true) {
          refresh();
        }
      }
    }
  }
);
  ViewerPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(new IPropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent event){
      if (note == null || note.isDisposed()) {
        ViewerPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(this);
        return;
      }
      if (WebViewer.PREVIEW_MAXROW.equals(event.getProperty())) {
        note.setText(getDisplayInfoText(ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXROW)),true,true);
        buttonTray.layout();
      }
    }
  }
);
  progressBar=new ProgressBar(mainPane,SWT.INDETERMINATE);
  gd=new GridData(GridData.END,GridData.CENTER,false,false);
  gd.heightHint=10;
  gd.widthHint=100;
  progressBar.setLayoutData(gd);
  progressBar.setVisible(true);
  createMainBrowser();
  parameterDialog=new InputParameterHtmlDialog(Display.getCurrent().getActiveShell(),InputParameterHtmlDialog.TITLE,getFileUri(),browser);
  if (bParameter != null) {
    final IWebAppInfo webapp=WebViewer.getCurrentWebApp();
    bParameter.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        if (webapp != null && webapp.useCustomParamHandling()) {
          refresh();
        }
 else {
          parameterDialog.open();
          if (parameterDialog.getReturnCode() == InputParameterHtmlDialog.RETURN_CODE_BROWSER_CLOSED) {
            refresh();
          }
        }
      }
    }
);
  }
  sc.addControlListener(new ControlAdapter(){
    public void controlResized(    ControlEvent e){
      sc.setMinSize(buttonTray.computeSize(SWT.DEFAULT,SWT.DEFAULT));
      mainPane.layout();
    }
  }
);
  sc.setContent(mainPane);
}

Fixed version (ground truth):
/** 
 * Create controls in the preview editor.
 * @param parent parent composite
 */
public void createPartControl(Composite parent){
  final ScrolledComposite sc=new ScrolledComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL);
  sc.setExpandHorizontal(true);
  sc.setExpandVertical(true);
  mainPane=new Composite(sc,SWT.NONE);
  GridLayout layout=new GridLayout(1,false);
  layout.verticalSpacing=0;
  mainPane.setLayout(layout);
  mainPane.setLayoutData(new GridData(GridData.FILL_BOTH));
  final Composite buttonTray=new Composite(mainPane,SWT.NONE);
  GridData gData=new GridData(GridData.FILL_BOTH);
  gData.grabExcessHorizontalSpace=true;
  gData.grabExcessVerticalSpace=false;
  buttonTray.setLayoutData(gData);
  layout=new GridLayout(2,false);
  layout.marginWidth=5;
  layout.horizontalSpacing=0;
  buttonTray.setLayout(layout);
  bParameter=new Button(buttonTray,SWT.PUSH);
  bParameter.setToolTipText(Messages.getString("String_Node_Str"));
  bParameter.setText(Messages.getString("String_Node_Str"));
  GridData gd=new GridData();
  bParameter.setLayoutData(gd);
  final FormText note=new FormText(buttonTray,SWT.NONE);
  note.setText(getDisplayInfoText(ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXROW)),true,true);
  note.setSize(SWT.DEFAULT - 10,SWT.DEFAULT);
  gd=new GridData();
  gd.horizontalIndent=20;
  note.setLayoutData(gd);
  note.addHyperlinkListener(new HyperlinkAdapter(){
    public void linkActivated(    HyperlinkEvent e){
      if (PreferencesUtil.createPreferenceDialogOn(UIUtil.getDefaultShell(),"String_Node_Str",new String[]{"String_Node_Str"},null).open() == Window.OK) {
        boolean ret=MessageDialog.openQuestion(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
        if (ret == true) {
          refresh();
        }
      }
    }
  }
);
  ViewerPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(new IPropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent event){
      if (note == null || note.isDisposed()) {
        ViewerPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(this);
        return;
      }
      if (WebViewer.PREVIEW_MAXROW.equals(event.getProperty())) {
        note.setText(getDisplayInfoText(ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXROW)),true,true);
        buttonTray.layout();
      }
    }
  }
);
  progressBar=new ProgressBar(mainPane,SWT.INDETERMINATE);
  gd=new GridData(GridData.END,GridData.CENTER,false,false);
  gd.heightHint=10;
  gd.widthHint=100;
  progressBar.setLayoutData(gd);
  progressBar.setVisible(true);
  createMainBrowser();
  parameterDialog=new InputParameterHtmlDialog(Display.getCurrent().getActiveShell(),InputParameterHtmlDialog.TITLE,getFileUri(),browser);
  if (bParameter != null) {
    final IWebAppInfo webapp=WebViewer.getCurrentWebApp();
    bParameter.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        if (webapp != null && webapp.useCustomParamHandling()) {
          suggestShowParameterPage=true;
          refresh();
          suggestShowParameterPage=false;
        }
 else {
          parameterDialog.open();
          if (parameterDialog.getReturnCode() == InputParameterHtmlDialog.RETURN_CODE_BROWSER_CLOSED) {
            refresh();
          }
        }
      }
    }
);
  }
  sc.addControlListener(new ControlAdapter(){
    public void controlResized(    ControlEvent e){
      sc.setMinSize(buttonTray.computeSize(SWT.DEFAULT,SWT.DEFAULT));
      mainPane.layout();
    }
  }
);
  sc.setContent(mainPane);
}