Program: 71955
Project: 71955
Buggy source:
/** 
 * Create controls in the preview editor.
 * @param parent parent composite
 */
public void createPartControl(Composite parent){
  Composite mainPane=new Composite(parent,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);
  buttonTray.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
  layout=new GridLayout();
  layout.marginWidth=5;
  layout.numColumns=7;
  layout.horizontalSpacing=0;
  buttonTray.setLayout(layout);
  IWebAppInfo webapp=WebViewer.getCurrentWebApp();
  if (webapp == null || !webapp.useCustomParamHandling()) {
    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);
  }
  FormText note=new FormText(buttonTray,SWT.NONE);
  note.setText("String_Node_Str" + Messages.getString("String_Node_Str") + "String_Node_Str",true,false);
  GridData gd=new GridData();
  gd.horizontalIndent=20;
  note.setLayoutData(gd);
  new Label(buttonTray,SWT.NONE).setText("String_Node_Str" + Messages.getString("String_Node_Str") + "String_Node_Str");
  final Label maxRoxLabel=new Label(buttonTray,SWT.NONE);
  maxRoxLabel.setText(ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXROW));
  ViewerPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(new IPropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent event){
      if (maxRoxLabel == null || maxRoxLabel.isDisposed()) {
        ViewerPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(this);
        return;
      }
      if (WebViewer.PREVIEW_MAXROW.equals(event.getProperty())) {
        if (!maxRoxLabel.getText().equals(event.getNewValue())) {
          maxRoxLabel.setText(ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXROW));
          buttonTray.layout();
        }
      }
    }
  }
);
  new Label(buttonTray,SWT.NONE).setText("String_Node_Str");
  Hyperlink changeLink=new Hyperlink(buttonTray,SWT.NONE);
  changeLink.setForeground(JFaceColors.getHyperlinkText(Display.getDefault()));
  changeLink.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();
        }
      }
    }
  }
);
  changeLink.setText(Messages.getString("String_Node_Str"));
  new Label(buttonTray,SWT.NONE).setText("String_Node_Str");
  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);
  browser=new Browser(mainPane,SWT.NONE);
  gd=new GridData(GridData.FILL_BOTH);
  gd.horizontalSpan=1;
  browser.setLayoutData(gd);
  browser.addProgressListener(new ProgressListener(){
    public void changed(    ProgressEvent event){
    }
    public void completed(    ProgressEvent event){
      progressBar.setVisible(false);
    }
  }
);
  parameterDialog=new InputParameterHtmlDialog(Display.getCurrent().getActiveShell(),InputParameterHtmlDialog.TITLE,getFileUri(),browser);
  if (bParameter != null) {
    bParameter.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        parameterDialog.open();
        if (parameterDialog.getReturnCode() == InputParameterHtmlDialog.RETURN_CODE_BROWSER_CLOSED) {
          refresh();
        }
      }
    }
);
  }
  browser.addOpenWindowListener(new OpenWindowListener(){
    public void open(    final WindowEvent event){
      final Shell shell=new Shell();
      shell.setLayout(new FillLayout());
      Browser browser=new Browser(shell,SWT.NONE);
      initialize(Display.getCurrent(),browser);
      event.browser=browser;
      shell.open();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Create controls in the preview editor.
 * @param parent parent composite
 */
public void createPartControl(Composite parent){
  mainPane=new Composite(parent,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);
  buttonTray.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
  layout=new GridLayout();
  layout.marginWidth=5;
  layout.numColumns=7;
  layout.horizontalSpacing=0;
  buttonTray.setLayout(layout);
  IWebAppInfo webapp=WebViewer.getCurrentWebApp();
  if (webapp == null || !webapp.useCustomParamHandling()) {
    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);
  }
  FormText note=new FormText(buttonTray,SWT.NONE);
  note.setText("String_Node_Str" + Messages.getString("String_Node_Str") + "String_Node_Str",true,false);
  GridData gd=new GridData();
  gd.horizontalIndent=20;
  note.setLayoutData(gd);
  new Label(buttonTray,SWT.NONE).setText("String_Node_Str" + Messages.getString("String_Node_Str") + "String_Node_Str");
  final Label maxRoxLabel=new Label(buttonTray,SWT.NONE);
  maxRoxLabel.setText(ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXROW));
  ViewerPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(new IPropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent event){
      if (maxRoxLabel == null || maxRoxLabel.isDisposed()) {
        ViewerPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(this);
        return;
      }
      if (WebViewer.PREVIEW_MAXROW.equals(event.getProperty())) {
        if (!maxRoxLabel.getText().equals(event.getNewValue())) {
          maxRoxLabel.setText(ViewerPlugin.getDefault().getPluginPreferences().getString(WebViewer.PREVIEW_MAXROW));
          buttonTray.layout();
        }
      }
    }
  }
);
  new Label(buttonTray,SWT.NONE).setText("String_Node_Str");
  Hyperlink changeLink=new Hyperlink(buttonTray,SWT.NONE);
  changeLink.setForeground(JFaceColors.getHyperlinkText(Display.getDefault()));
  changeLink.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();
        }
      }
    }
  }
);
  changeLink.setText(Messages.getString("String_Node_Str"));
  new Label(buttonTray,SWT.NONE).setText("String_Node_Str");
  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) {
    bParameter.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        parameterDialog.open();
        if (parameterDialog.getReturnCode() == InputParameterHtmlDialog.RETURN_CODE_BROWSER_CLOSED) {
          refresh();
        }
      }
    }
);
  }
}