Program: 17572
Project: 17572
Buggy source:
/** 
 * Creates an instance of a ControlExample embedded inside the supplied parent Composite.
 * @param parent the container of the example
 */
public CFBrowser(Composite parent,ViewPart viewer){
  this.viewer=viewer;
  final Display display=parent.getDisplay();
  FormLayout layout=new FormLayout();
  parent.setLayout(layout);
  ToolBar toolbar=new ToolBar(parent,SWT.NONE);
  final ToolItem itemBack=new ToolItem(toolbar,SWT.PUSH);
  itemBack.setImage(CFPluginImages.get(CFPluginImages.ICON_BACK));
  itemBack.setToolTipText(getResourceString("String_Node_Str"));
  final ToolItem itemForward=new ToolItem(toolbar,SWT.PUSH);
  itemForward.setImage(CFPluginImages.get(CFPluginImages.ICON_FORWARD));
  itemForward.setToolTipText(getResourceString("String_Node_Str"));
  final ToolItem itemStop=new ToolItem(toolbar,SWT.PUSH);
  itemStop.setImage(CFPluginImages.get(CFPluginImages.ICON_STOP));
  itemStop.setToolTipText(getResourceString("String_Node_Str"));
  final ToolItem itemRefresh=new ToolItem(toolbar,SWT.PUSH);
  itemRefresh.setImage(CFPluginImages.get(CFPluginImages.ICON_REFRESH));
  itemRefresh.setToolTipText(getResourceString("String_Node_Str"));
  final ToolItem itemHome=new ToolItem(toolbar,SWT.PUSH);
  itemHome.setImage(CFPluginImages.get(CFPluginImages.ICON_HOME));
  itemHome.setToolTipText(getResourceString("String_Node_Str"));
  final ToolItem itemGo=new ToolItem(toolbar,SWT.PUSH);
  itemGo.setImage(CFPluginImages.get(CFPluginImages.ICON_PROCESS));
  itemGo.setToolTipText(getResourceString("String_Node_Str"));
  location=new Text(parent,SWT.BORDER);
  final Canvas canvas=new Canvas(parent,SWT.ICON_INFORMATION);
  display.asyncExec(new Runnable(){
    public void run(){
      if (canvas.isDisposed())       return;
      if (busy) {
        index++;
        if (index == images.length)         index=0;
        canvas.redraw();
      }
      display.timerExec(150,this);
    }
  }
);
  final Label status=new Label(parent,SWT.NONE);
  final ProgressBar progressBar=new ProgressBar(parent,SWT.NONE);
  FormData data=new FormData();
  data.top=new FormAttachment(0,5);
  toolbar.setLayoutData(data);
  data=new FormData();
  data.left=new FormAttachment(0,0);
  data.right=new FormAttachment(100,0);
  data.top=new FormAttachment(canvas,5,SWT.DEFAULT);
  data.bottom=new FormAttachment(status,-5,SWT.DEFAULT);
  try {
    browser=new Browser(parent,SWT.NONE);
    browser.setLayoutData(data);
  }
 catch (  SWTError e) {
    Label label=new Label(parent,SWT.CENTER | SWT.WRAP);
    label.setText(getResourceString("String_Node_Str"));
    label.setLayoutData(data);
  }
  data=new FormData();
  data.width=24;
  data.height=24;
  data.top=new FormAttachment(0,5);
  data.right=new FormAttachment(100,-5);
  canvas.setLayoutData(data);
  data=new FormData();
  data.top=new FormAttachment(toolbar,0,SWT.TOP);
  data.left=new FormAttachment(toolbar,5,SWT.RIGHT);
  data.right=new FormAttachment(canvas,-5,SWT.DEFAULT);
  location.setLayoutData(data);
  data=new FormData();
  data.left=new FormAttachment(0,5);
  data.right=new FormAttachment(progressBar,0,SWT.DEFAULT);
  data.bottom=new FormAttachment(100,-5);
  status.setLayoutData(data);
  data=new FormData();
  data.right=new FormAttachment(100,-5);
  data.bottom=new FormAttachment(100,-5);
  progressBar.setLayoutData(data);
  if (browser != null) {
    itemBack.setEnabled(browser.isBackEnabled());
    itemForward.setEnabled(browser.isForwardEnabled());
    Listener listener=new Listener(){
      public void handleEvent(      Event event){
        System.out.println("String_Node_Str");
        ToolItem item=(ToolItem)event.widget;
        if (item == itemBack) {
          System.out.println("String_Node_Str");
          browser.back();
        }
 else         if (item == itemForward) {
          System.out.println("String_Node_Str");
          browser.forward();
        }
 else         if (item == itemStop) {
          System.out.println("String_Node_Str");
          browser.stop();
        }
 else         if (item == itemRefresh) {
          System.out.println("String_Node_Str");
          browser.refresh();
        }
 else         if (item == itemGo) {
          System.out.println("String_Node_Str");
          browser.setUrl(location.getText());
        }
 else         if (item == itemHome) {
          System.out.println("String_Node_Str");
          browser.setUrl(getProjectURL());
        }
      }
    }
;
    browser.addLocationListener(new LocationListener(){
      public void changed(      LocationEvent event){
        busy=true;
        if (event.top)         location.setText(event.location);
      }
      public void changing(      LocationEvent event){
      }
    }
);
    browser.addProgressListener(new ProgressListener(){
      public void changed(      ProgressEvent event){
        if (event.total == 0)         return;
        int ratio=event.current * 100 / event.total;
        progressBar.setSelection(ratio);
        busy=event.current != event.total;
        if (!busy) {
          index=0;
          canvas.redraw();
        }
      }
      public void completed(      ProgressEvent event){
        itemBack.setEnabled(browser.isBackEnabled());
        itemForward.setEnabled(browser.isForwardEnabled());
        progressBar.setSelection(0);
        busy=false;
        index=0;
        canvas.redraw();
      }
    }
);
    browser.addStatusTextListener(new StatusTextListener(){
      public void changed(      StatusTextEvent event){
        status.setText(event.text);
      }
    }
);
    if (parent instanceof Shell) {
      final Shell shell=(Shell)parent;
      browser.addTitleListener(new TitleListener(){
        public void changed(        TitleEvent event){
          shell.setText(event.title + "String_Node_Str" + getResourceString("String_Node_Str"));
        }
      }
);
    }
    itemBack.addListener(SWT.Selection,listener);
    itemForward.addListener(SWT.Selection,listener);
    itemStop.addListener(SWT.Selection,listener);
    itemRefresh.addListener(SWT.Selection,listener);
    itemGo.addListener(SWT.Selection,listener);
    itemHome.addListener(SWT.Selection,listener);
    location.addListener(SWT.DefaultSelection,new Listener(){
      public void handleEvent(      Event e){
        browser.setUrl(location.getText());
      }
    }
);
    initialize(display,browser);
    browser.setUrl(getProjectURL());
  }
}

Fixed version (ground truth):
/** 
 * Creates an instance of a ControlExample embedded inside the supplied parent Composite.
 * @param parent the container of the example
 */
public CFBrowser(Composite parent,ViewPart viewer){
  this.viewer=viewer;
  final Display display=parent.getDisplay();
  FormLayout layout=new FormLayout();
  parent.setLayout(layout);
  ToolBar toolbar=new ToolBar(parent,SWT.NONE);
  final ToolItem itemBack=new ToolItem(toolbar,SWT.PUSH);
  itemBack.setImage(CFPluginImages.get(CFPluginImages.ICON_BACK));
  itemBack.setToolTipText(getResourceString("String_Node_Str"));
  final ToolItem itemForward=new ToolItem(toolbar,SWT.PUSH);
  itemForward.setImage(CFPluginImages.get(CFPluginImages.ICON_FORWARD));
  itemForward.setToolTipText(getResourceString("String_Node_Str"));
  final ToolItem itemStop=new ToolItem(toolbar,SWT.PUSH);
  itemStop.setImage(CFPluginImages.get(CFPluginImages.ICON_STOP));
  itemStop.setToolTipText(getResourceString("String_Node_Str"));
  final ToolItem itemRefresh=new ToolItem(toolbar,SWT.PUSH);
  itemRefresh.setImage(CFPluginImages.get(CFPluginImages.ICON_REFRESH));
  itemRefresh.setToolTipText(getResourceString("String_Node_Str"));
  final ToolItem itemHome=new ToolItem(toolbar,SWT.PUSH);
  itemHome.setImage(CFPluginImages.get(CFPluginImages.ICON_HOME));
  itemHome.setToolTipText(getResourceString("String_Node_Str"));
  final ToolItem itemGo=new ToolItem(toolbar,SWT.PUSH);
  itemGo.setImage(CFPluginImages.get(CFPluginImages.ICON_PROCESS));
  itemGo.setToolTipText(getResourceString("String_Node_Str"));
  location=new Text(parent,SWT.BORDER);
  final Canvas canvas=new Canvas(parent,SWT.ICON_INFORMATION);
  display.asyncExec(new Runnable(){
    public void run(){
      if (canvas.isDisposed())       return;
      if (busy) {
      }
      display.timerExec(150,this);
    }
  }
);
  final Label status=new Label(parent,SWT.NONE);
  final ProgressBar progressBar=new ProgressBar(parent,SWT.NONE);
  FormData data=new FormData();
  data.top=new FormAttachment(0,5);
  toolbar.setLayoutData(data);
  data=new FormData();
  data.left=new FormAttachment(0,0);
  data.right=new FormAttachment(100,0);
  data.top=new FormAttachment(canvas,5,SWT.DEFAULT);
  data.bottom=new FormAttachment(status,-5,SWT.DEFAULT);
  try {
    browser=new Browser(parent,SWT.NONE);
    browser.setLayoutData(data);
  }
 catch (  SWTError e) {
    Label label=new Label(parent,SWT.CENTER | SWT.WRAP);
    label.setText(getResourceString("String_Node_Str"));
    label.setLayoutData(data);
  }
  data=new FormData();
  data.width=24;
  data.height=24;
  data.top=new FormAttachment(0,5);
  data.right=new FormAttachment(100,-5);
  canvas.setLayoutData(data);
  data=new FormData();
  data.top=new FormAttachment(toolbar,0,SWT.TOP);
  data.left=new FormAttachment(toolbar,5,SWT.RIGHT);
  data.right=new FormAttachment(canvas,-5,SWT.DEFAULT);
  location.setLayoutData(data);
  data=new FormData();
  data.left=new FormAttachment(0,5);
  data.right=new FormAttachment(progressBar,0,SWT.DEFAULT);
  data.bottom=new FormAttachment(100,-5);
  status.setLayoutData(data);
  data=new FormData();
  data.right=new FormAttachment(100,-5);
  data.bottom=new FormAttachment(100,-5);
  progressBar.setLayoutData(data);
  if (browser != null) {
    itemBack.setEnabled(browser.isBackEnabled());
    itemForward.setEnabled(browser.isForwardEnabled());
    Listener listener=new Listener(){
      public void handleEvent(      Event event){
        System.out.println("String_Node_Str");
        ToolItem item=(ToolItem)event.widget;
        if (item == itemBack) {
          System.out.println("String_Node_Str");
          browser.back();
        }
 else         if (item == itemForward) {
          System.out.println("String_Node_Str");
          browser.forward();
        }
 else         if (item == itemStop) {
          System.out.println("String_Node_Str");
          browser.stop();
        }
 else         if (item == itemRefresh) {
          System.out.println("String_Node_Str");
          browser.refresh();
        }
 else         if (item == itemGo) {
          System.out.println("String_Node_Str");
          browser.setUrl(location.getText());
        }
 else         if (item == itemHome) {
          System.out.println("String_Node_Str");
          browser.setUrl(getProjectURL());
        }
      }
    }
;
    browser.addLocationListener(new LocationListener(){
      public void changed(      LocationEvent event){
        busy=true;
        if (event.top)         location.setText(event.location);
      }
      public void changing(      LocationEvent event){
      }
    }
);
    browser.addProgressListener(new ProgressListener(){
      public void changed(      ProgressEvent event){
        if (event.total == 0)         return;
        int ratio=event.current * 100 / event.total;
        progressBar.setSelection(ratio);
        busy=event.current != event.total;
        if (!busy) {
          index=0;
          canvas.redraw();
        }
      }
      public void completed(      ProgressEvent event){
        itemBack.setEnabled(browser.isBackEnabled());
        itemForward.setEnabled(browser.isForwardEnabled());
        progressBar.setSelection(0);
        busy=false;
        index=0;
        canvas.redraw();
      }
    }
);
    browser.addStatusTextListener(new StatusTextListener(){
      public void changed(      StatusTextEvent event){
        status.setText(event.text);
      }
    }
);
    if (parent instanceof Shell) {
      final Shell shell=(Shell)parent;
      browser.addTitleListener(new TitleListener(){
        public void changed(        TitleEvent event){
          shell.setText(event.title + "String_Node_Str" + getResourceString("String_Node_Str"));
        }
      }
);
    }
    itemBack.addListener(SWT.Selection,listener);
    itemForward.addListener(SWT.Selection,listener);
    itemStop.addListener(SWT.Selection,listener);
    itemRefresh.addListener(SWT.Selection,listener);
    itemGo.addListener(SWT.Selection,listener);
    itemHome.addListener(SWT.Selection,listener);
    location.addListener(SWT.DefaultSelection,new Listener(){
      public void handleEvent(      Event e){
        browser.setUrl(location.getText());
      }
    }
);
    initialize(display,browser);
    String url=getProjectURL();
    if (url == null || url.equals("String_Node_Str")) {
      browser.setUrl(DEFAULURL);
    }
 else {
      browser.setUrl(url);
    }
  }
}