Program: 96458
Project: 96458
Buggy source:
protected void createBundleContent(Composite parent){
  mform=new ManagedForm(parent);
  setManagedForm(mform);
  sform=mform.getForm();
  FormToolkit toolkit=mform.getToolkit();
  sform.setText("String_Node_Str");
  sform.setImage(ServerUICore.getLabelProvider().getImage(getServer()));
  sform.setExpandHorizontal(true);
  sform.setExpandVertical(true);
  toolkit.decorateFormHeading(sform.getForm());
  Composite body=sform.getBody();
  GridLayout layout=new GridLayout(2,false);
  layout.marginHeight=0;
  layout.marginWidth=0;
  body.setLayout(layout);
  Composite configComposite=toolkit.createComposite(body);
  layout.marginLeft=6;
  layout.marginTop=6;
  layout.numColumns=2;
  configComposite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
  configComposite.setLayout(layout);
  Section expandableComposite=toolkit.createSection(configComposite,ExpandableComposite.TITLE_BAR | ExpandableComposite.FOCUS_TITLE);
  layout=new GridLayout();
  expandableComposite.setLayout(layout);
  expandableComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
  expandableComposite.setFont(body.getFont());
  expandableComposite.setBackground(body.getBackground());
  expandableComposite.setText("String_Node_Str");
  Composite composite=toolkit.createComposite(expandableComposite,SWT.NONE);
  layout=new GridLayout();
  layout.numColumns=1;
  layout.marginHeight=0;
  layout.marginRight=0;
  composite.setLayout(layout);
  expandableComposite.setClient(composite);
  final Button servicesButton=toolkit.createButton(composite,"String_Node_Str",SWT.RADIO);
  servicesButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      contentProvider.setShowServices(servicesButton.getSelection());
      new BundleDependencyUpdateJob(false).schedule(200);
    }
  }
);
  final Button packagesButton=toolkit.createButton(composite,"String_Node_Str",SWT.RADIO);
  packagesButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      contentProvider.setShowPackage(packagesButton.getSelection());
      new BundleDependencyUpdateJob(false).schedule(200);
    }
  }
);
  packagesButton.setSelection(true);
  new Label(composite,SWT.NONE);
  Label dependenciesLabel=toolkit.createLabel(composite,"String_Node_Str");
  dependenciesLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
  toolkit.createLabel(composite,"String_Node_Str");
  final Spinner incomingSpinner=new Spinner(composite,SWT.NONE);
  incomingSpinner.setMinimum(0);
  incomingSpinner.setIncrement(1);
  incomingSpinner.setMaximum(20);
  incomingSpinner.setSelection(1);
  GridData data=new GridData(GridData.HORIZONTAL_ALIGN_END);
  incomingSpinner.setLayoutData(data);
  incomingSpinner.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      contentProvider.setIncomingDependencyDegree(incomingSpinner.getSelection());
      new BundleDependencyUpdateJob(false).schedule(200);
    }
  }
);
  toolkit.createLabel(composite,"String_Node_Str");
  final Spinner outgoingSpinner=new Spinner(composite,SWT.NONE);
  outgoingSpinner.setMinimum(0);
  outgoingSpinner.setIncrement(1);
  outgoingSpinner.setMaximum(20);
  outgoingSpinner.setSelection(1);
  data=new GridData(GridData.HORIZONTAL_ALIGN_END);
  outgoingSpinner.setLayoutData(data);
  outgoingSpinner.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      contentProvider.setOutgoingDependencyDegree(outgoingSpinner.getSelection());
      new BundleDependencyUpdateJob(false).schedule(200);
    }
  }
);
  Label separator=new Label(configComposite,SWT.NONE);
  separator.setForeground(toolkit.getColors().getColor(IFormColors.H_BOTTOM_KEYLINE1));
  data=new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.FILL_VERTICAL);
  data.widthHint=1;
  separator.setLayoutData(data);
  toolkit.paintBordersFor(expandableComposite);
  layout=new GridLayout(2,false);
  layout.marginHeight=0;
  layout.marginWidth=0;
  body.setLayout(layout);
  viewer=new GraphViewer(body,SWT.NONE);
  viewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  viewer.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
  CompositeLayoutAlgorithm layoutAlgorithm=new CompositeLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING | LayoutStyles.ENFORCE_BOUNDS,new LayoutAlgorithm[]{new RadialLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING | LayoutStyles.ENFORCE_BOUNDS),new HorizontalShift(LayoutStyles.NO_LAYOUT_NODE_RESIZING | LayoutStyles.ENFORCE_BOUNDS)});
  searchControl=new SearchControl("String_Node_Str",getManagedForm());
  contentProvider=new BundleDependencyContentProvider(viewer,searchControl);
  FocusedBundleDependencyLayoutAlgorithm la=new FocusedBundleDependencyLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING | LayoutStyles.ENFORCE_BOUNDS,layoutAlgorithm,contentProvider);
  viewer.setLayoutAlgorithm(la);
  viewer.setContentProvider(contentProvider);
  viewer.addSelectionChangedListener(contentProvider);
  viewer.setFilters(new ViewerFilter[]{});
  labelProvider=new BundleDependencyLabelProvider(contentProvider,toolkit);
  viewer.setLabelProvider(labelProvider);
  viewer.addDoubleClickListener(new IDoubleClickListener(){
    public void doubleClick(    DoubleClickEvent event){
      Object selection=((IStructuredSelection)event.getSelection()).getFirstElement();
      if (selection instanceof IBundle) {
        IBundle bundle=(IBundle)selection;
        setSelection(bundle);
      }
    }
  }
);
  toolBarManager=sform.getToolBarManager();
  toolBarManager.add(searchControl);
  backAction=new Action("String_Node_Str"){
    @Override public void run(){
      searchControl.getSearchText().setText(history.back());
      setEnabled(history.canBack());
      forwardAction.setEnabled(history.canForward());
      toolBarManager.update(true);
      new BundleDependencyUpdateJob(true).schedule();
    }
  }
;
  backAction.setImageDescriptor(ImageResource.getImageDescriptor(org.eclipse.ui.internal.browser.ImageResource.IMG_ELCL_NAV_BACKWARD));
  backAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_NAV_BACKWARD));
  backAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_NAV_BACKWARD));
  backAction.setEnabled(false);
  toolBarManager.add(backAction);
  forwardAction=new Action("String_Node_Str"){
    @Override public void run(){
      searchControl.getSearchText().setText(history.forward());
      setEnabled(history.canForward());
      backAction.setEnabled(history.canBack());
      toolBarManager.update(true);
      new BundleDependencyUpdateJob(true).schedule();
    }
  }
;
  forwardAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_NAV_FORWARD));
  forwardAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_NAV_FORWARD));
  forwardAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_NAV_FORWARD));
  forwardAction.setEnabled(false);
  toolBarManager.add(forwardAction);
  refreshAction=new Action("String_Node_Str",ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_NAV_REFRESH)){
    @Override public void run(){
      IRunnableWithProgress runnable=new IRunnableWithProgress(){
        public void run(        final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
          monitor.beginTask("String_Node_Str",1);
          Display.getDefault().asyncExec(new Runnable(){
            public void run(){
              clearStatus();
              IOSGiFrameworkAdmin admin=(IOSGiFrameworkAdmin)getServer().getOriginal().loadAdapter(IOSGiFrameworkAdmin.class,monitor);
              if (admin == null) {
                IStatus status=EditorUIPlugin.newErrorStatus("String_Node_Str");
                EditorUIPlugin.log(status);
                setStatus(status);
              }
              try {
                Map<Long,IBundle> allBundles=admin.getBundles(monitor);
                refresh(allBundles);
              }
 catch (              CoreException e) {
                EditorUIPlugin.log(e);
                setStatus(e.getStatus());
              }
            }
          }
);
          monitor.worked(1);
        }
      }
;
      try {
        IRunnableContext context=new ProgressMonitorDialog(Display.getCurrent().getActiveShell());
        context.run(true,true,runnable);
      }
 catch (      InvocationTargetException e1) {
      }
catch (      InterruptedException e2) {
      }
    }
  }
;
  toolBarManager.add(refreshAction);
  sform.updateToolBar();
  initPopupMenu();
  searchControl.getSearchText().addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
      if (e.character == SWT.CR || e.character == SWT.LF) {
        if (!"String_Node_Str".equals(searchControl.getSearchText().getText())) {
          history.add(searchControl.getSearchText().getText());
          forwardAction.setEnabled(history.canForward());
          backAction.setEnabled(history.canBack());
          toolBarManager.update(true);
          new BundleDependencyUpdateJob(true).schedule();
        }
      }
    }
    public void keyReleased(    KeyEvent e){
    }
  }
);
  searchControl.getSearchText().addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if ("String_Node_Str".equals(searchControl.getSearchText().getText())) {
        new BundleDependencyUpdateJob(true).schedule();
      }
    }
  }
);
}

Fixed version (ground truth):
protected void createBundleContent(Composite parent){
  mform=new ManagedForm(parent);
  setManagedForm(mform);
  sform=mform.getForm();
  FormToolkit toolkit=mform.getToolkit();
  sform.setText("String_Node_Str");
  sform.setImage(ServerUICore.getLabelProvider().getImage(getServer()));
  sform.setExpandHorizontal(true);
  sform.setExpandVertical(true);
  toolkit.decorateFormHeading(sform.getForm());
  Composite body=sform.getBody();
  GridLayout layout=new GridLayout(2,false);
  layout.marginHeight=0;
  layout.marginWidth=0;
  body.setLayout(layout);
  Composite configComposite=toolkit.createComposite(body);
  layout.marginLeft=6;
  layout.marginTop=6;
  layout.numColumns=2;
  configComposite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
  configComposite.setLayout(layout);
  Section expandableComposite=toolkit.createSection(configComposite,ExpandableComposite.TITLE_BAR | ExpandableComposite.FOCUS_TITLE);
  layout=new GridLayout();
  expandableComposite.setLayout(layout);
  expandableComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
  expandableComposite.setFont(body.getFont());
  expandableComposite.setBackground(body.getBackground());
  expandableComposite.setText("String_Node_Str");
  Composite composite=toolkit.createComposite(expandableComposite,SWT.NONE);
  layout=new GridLayout();
  layout.numColumns=1;
  layout.marginHeight=0;
  layout.marginRight=0;
  composite.setLayout(layout);
  expandableComposite.setClient(composite);
  final Button servicesButton=toolkit.createButton(composite,"String_Node_Str",SWT.RADIO);
  servicesButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      contentProvider.setShowServices(servicesButton.getSelection());
      new BundleDependencyUpdateJob(false).schedule(200);
    }
  }
);
  final Button packagesButton=toolkit.createButton(composite,"String_Node_Str",SWT.RADIO);
  packagesButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      contentProvider.setShowPackage(packagesButton.getSelection());
      new BundleDependencyUpdateJob(false).schedule(200);
    }
  }
);
  packagesButton.setSelection(true);
  new Label(composite,SWT.NONE);
  Label dependenciesLabel=toolkit.createLabel(composite,"String_Node_Str");
  dependenciesLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
  toolkit.createLabel(composite,"String_Node_Str");
  final Spinner incomingSpinner=new Spinner(composite,SWT.NONE);
  incomingSpinner.setMinimum(0);
  incomingSpinner.setIncrement(1);
  incomingSpinner.setMaximum(20);
  incomingSpinner.setSelection(1);
  GridData data=new GridData(GridData.HORIZONTAL_ALIGN_END);
  incomingSpinner.setLayoutData(data);
  incomingSpinner.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      contentProvider.setIncomingDependencyDegree(incomingSpinner.getSelection());
      new BundleDependencyUpdateJob(false).schedule(200);
    }
  }
);
  toolkit.createLabel(composite,"String_Node_Str");
  final Spinner outgoingSpinner=new Spinner(composite,SWT.NONE);
  outgoingSpinner.setMinimum(0);
  outgoingSpinner.setIncrement(1);
  outgoingSpinner.setMaximum(20);
  outgoingSpinner.setSelection(1);
  data=new GridData(GridData.HORIZONTAL_ALIGN_END);
  outgoingSpinner.setLayoutData(data);
  outgoingSpinner.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      contentProvider.setOutgoingDependencyDegree(outgoingSpinner.getSelection());
      new BundleDependencyUpdateJob(false).schedule(200);
    }
  }
);
  Label separator=new Label(configComposite,SWT.NONE);
  separator.setForeground(toolkit.getColors().getColor(IFormColors.H_BOTTOM_KEYLINE1));
  data=new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.FILL_VERTICAL);
  data.widthHint=1;
  separator.setLayoutData(data);
  toolkit.paintBordersFor(expandableComposite);
  layout=new GridLayout(2,false);
  layout.marginHeight=0;
  layout.marginWidth=0;
  body.setLayout(layout);
  viewer=new GraphViewer(body,SWT.NONE);
  viewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  viewer.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
  CompositeLayoutAlgorithm layoutAlgorithm=new CompositeLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING | LayoutStyles.ENFORCE_BOUNDS,new LayoutAlgorithm[]{new RadialLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING | LayoutStyles.ENFORCE_BOUNDS),new HorizontalShift(LayoutStyles.NO_LAYOUT_NODE_RESIZING | LayoutStyles.ENFORCE_BOUNDS)});
  searchControl=new SearchControl("String_Node_Str",getManagedForm());
  contentProvider=new BundleDependencyContentProvider(viewer,searchControl);
  FocusedBundleDependencyLayoutAlgorithm la=new FocusedBundleDependencyLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING | LayoutStyles.ENFORCE_BOUNDS,layoutAlgorithm,contentProvider);
  viewer.setLayoutAlgorithm(la);
  viewer.setContentProvider(contentProvider);
  viewer.addSelectionChangedListener(contentProvider);
  viewer.setFilters(new ViewerFilter[]{});
  labelProvider=new BundleDependencyLabelProvider(contentProvider,toolkit);
  viewer.setLabelProvider(labelProvider);
  viewer.addDoubleClickListener(new IDoubleClickListener(){
    public void doubleClick(    DoubleClickEvent event){
      Object selection=((IStructuredSelection)event.getSelection()).getFirstElement();
      if (selection instanceof IBundle) {
        IBundle bundle=(IBundle)selection;
        setSelection(bundle);
      }
    }
  }
);
  toolBarManager=sform.getToolBarManager();
  toolBarManager.add(searchControl);
  backAction=new Action("String_Node_Str"){
    @Override public void run(){
      searchControl.getSearchText().setText(history.back());
      setEnabled(history.canBack());
      forwardAction.setEnabled(history.canForward());
      toolBarManager.update(true);
      new BundleDependencyUpdateJob(true).schedule();
    }
  }
;
  backAction.setImageDescriptor(ImageResource.getImageDescriptor(org.eclipse.ui.internal.browser.ImageResource.IMG_ELCL_NAV_BACKWARD));
  backAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_NAV_BACKWARD));
  backAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_NAV_BACKWARD));
  backAction.setEnabled(false);
  toolBarManager.add(backAction);
  forwardAction=new Action("String_Node_Str"){
    @Override public void run(){
      searchControl.getSearchText().setText(history.forward());
      setEnabled(history.canForward());
      backAction.setEnabled(history.canBack());
      toolBarManager.update(true);
      new BundleDependencyUpdateJob(true).schedule();
    }
  }
;
  forwardAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_NAV_FORWARD));
  forwardAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_NAV_FORWARD));
  forwardAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_NAV_FORWARD));
  forwardAction.setEnabled(false);
  toolBarManager.add(forwardAction);
  refreshAction=new Action("String_Node_Str",ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_NAV_REFRESH)){
    @Override public void run(){
      IRunnableWithProgress runnable=new IRunnableWithProgress(){
        public void run(        final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
          monitor.beginTask("String_Node_Str",1);
          Display.getDefault().asyncExec(new Runnable(){
            public void run(){
              clearStatus();
              IOSGiFrameworkAdmin admin=(IOSGiFrameworkAdmin)getServer().getOriginal().loadAdapter(IOSGiFrameworkAdmin.class,monitor);
              if (admin == null) {
                IStatus status=EditorUIPlugin.newErrorStatus("String_Node_Str");
                EditorUIPlugin.log(status);
                setStatus(status);
                return;
              }
              try {
                Map<Long,IBundle> allBundles=admin.getBundles(monitor);
                refresh(allBundles);
              }
 catch (              CoreException e) {
                EditorUIPlugin.log(e);
                setStatus(e.getStatus());
              }
            }
          }
);
          monitor.worked(1);
        }
      }
;
      try {
        IRunnableContext context=new ProgressMonitorDialog(Display.getCurrent().getActiveShell());
        context.run(true,true,runnable);
      }
 catch (      InvocationTargetException e1) {
      }
catch (      InterruptedException e2) {
      }
    }
  }
;
  toolBarManager.add(refreshAction);
  sform.updateToolBar();
  initPopupMenu();
  searchControl.getSearchText().addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
      if (e.character == SWT.CR || e.character == SWT.LF) {
        if (!"String_Node_Str".equals(searchControl.getSearchText().getText())) {
          history.add(searchControl.getSearchText().getText());
          forwardAction.setEnabled(history.canForward());
          backAction.setEnabled(history.canBack());
          toolBarManager.update(true);
          new BundleDependencyUpdateJob(true).schedule();
        }
      }
    }
    public void keyReleased(    KeyEvent e){
    }
  }
);
  searchControl.getSearchText().addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if ("String_Node_Str".equals(searchControl.getSearchText().getText())) {
        new BundleDependencyUpdateJob(true).schedule();
      }
    }
  }
);
}