Program: 119235
Project: 119235
Buggy source:
/** 
 * DOC Administrator DebugProcessComposite constructor comment.
 * @param parent
 * @param style
 */
public DebugProcessTosComposite(Composite parent,int style){
  super(parent,style);
  setExpandHorizontal(true);
  setExpandVertical(true);
  this.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
  FormData layouData=new FormData();
  layouData.left=new FormAttachment(0,0);
  layouData.right=new FormAttachment(100,0);
  layouData.top=new FormAttachment(0,0);
  layouData.bottom=new FormAttachment(100,0);
  setLayoutData(layouData);
  this.setLayout(new FormLayout());
  final Composite panel=new Composite(this,SWT.NONE);
  setContent(panel);
  FormLayout layout=new FormLayout();
  layout.marginWidth=5 + 2;
  layout.marginHeight=4;
  layout.spacing=6 + 1;
  panel.setLayout(layout);
  Group execGroup=new Group(panel,SWT.NONE);
  execGroup.setText("String_Node_Str");
  GridLayout layout5=new GridLayout();
  layout5.marginHeight=0;
  layout5.marginWidth=0;
  execGroup.setLayout(layout5);
  FormData layouDatag=new FormData();
  layouDatag.left=new FormAttachment(0,0);
  layouDatag.right=new FormAttachment(100,0);
  layouDatag.top=new FormAttachment(0,0);
  layouDatag.bottom=new FormAttachment(100,0);
  execGroup.setLayoutData(layouDatag);
  ScrolledComposite execScroll=new ScrolledComposite(execGroup,SWT.V_SCROLL | SWT.H_SCROLL);
  execScroll.setExpandHorizontal(true);
  execScroll.setExpandVertical(true);
  execScroll.setLayoutData(new GridData(GridData.FILL_BOTH));
  Composite execContent=new Composite(execScroll,SWT.NONE);
  GridLayout glayout=new GridLayout();
  execContent.setLayout(new FormLayout());
  execScroll.setContent(execContent);
  Composite execHeader=new Composite(execContent,SWT.NONE);
  FormLayout formLayout=new FormLayout();
  formLayout.marginWidth=7;
  formLayout.marginHeight=4;
  formLayout.spacing=7;
  execHeader.setLayout(formLayout);
  FormData layoutData=new FormData();
  layoutData.left=new FormAttachment(0,0);
  layoutData.right=new FormAttachment(100,0);
  layoutData.top=new FormAttachment(0,0);
  layoutData.bottom=new FormAttachment(0,50);
  execHeader.setLayoutData(layoutData);
  FormData formData=new FormData();
  toolBar=new ToolBar(execHeader,SWT.FLAT | SWT.RIGHT);
  itemDropDown=new ToolItem(toolBar,SWT.ARROW);
  itemDropDown.setText(Messages.getString("String_Node_Str"));
  itemDropDown.setData(ProcessView.TRACEDEBUG_ID);
  itemDropDown.setToolTipText(Messages.getString("String_Node_Str"));
  itemDropDown.setImage(ImageProvider.getImage(ERunprocessImages.DEBUG_TRACE_ACTION));
  menu=new Menu(execHeader);
  itemDropDown.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent event){
      if (event.detail == SWT.ARROW) {
        Rectangle bounds=itemDropDown.getBounds();
        Point point=toolBar.toDisplay(bounds.x,bounds.y + bounds.height);
        menu.setLocation(point);
        menu.setVisible(true);
      }
 else {
        ToolItem item=(ToolItem)event.widget;
        errorMessMap.clear();
        if (item.getData().equals(ProcessView.DEBUG_ID)) {
          debug();
        }
 else {
          execButtonPressed();
        }
      }
    }
  }
);
  final MenuItem menuItem1=new MenuItem(menu,SWT.PUSH);
  menuItem1.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
  menuItem1.setImage(ImageProvider.getImage(ERunprocessImages.DEBUG_PROCESS_ACTION));
  menuItem1.setData(ProcessView.DEBUG_ID);
  menuItem1.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent event){
      if (!itemDropDown.getData().equals(ProcessView.PAUSE_ID) && !itemDropDown.getData().equals(ProcessView.RESUME_ID)) {
        itemDropDown.setText(menuItem1.getText());
        itemDropDown.setData(ProcessView.DEBUG_ID);
        itemDropDown.setImage(ImageProvider.getImage(ERunprocessImages.DEBUG_PROCESS_ACTION));
        itemDropDown.setToolTipText(Messages.getString("String_Node_Str"));
        toolBar.getParent().layout();
        manager.setBooleanTrace(false);
        addTrace(ProcessView.DEBUG_ID);
      }
    }
  }
);
  IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
  if (brandingService.getBrandingConfiguration().isAllowDebugMode()) {
    debugMenuItem=new MenuItem(menu,SWT.PUSH);
    debugMenuItem.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    debugMenuItem.setData(ProcessView.TRACEDEBUG_ID);
    debugMenuItem.setImage(ImageProvider.getImage(ERunprocessImages.DEBUG_TRACE_ACTION));
    debugMenuItem.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent event){
        if (!itemDropDown.getData().equals(ProcessView.PAUSE_ID) && !itemDropDown.getData().equals(ProcessView.RESUME_ID)) {
          itemDropDown.setText(debugMenuItem.getText());
          itemDropDown.setData(ProcessView.TRACEDEBUG_ID);
          itemDropDown.setImage(ImageProvider.getImage(ERunprocessImages.DEBUG_TRACE_ACTION));
          itemDropDown.setToolTipText(Messages.getString("String_Node_Str"));
          toolBar.getParent().layout();
          manager.setBooleanTrace(true);
          addTrace(ProcessView.TRACEDEBUG_ID);
        }
      }
    }
);
  }
  toolBar.setEnabled(false);
  Point debugSize=null;
  Point execSize=null;
  FormData formDatat=new FormData();
  formDatat.left=new FormAttachment(0);
  if (brandingService.getBrandingConfiguration().isAllowDebugMode()) {
    itemDropDown.setText(debugMenuItem.getText());
    debugSize=computeSize(itemDropDown.getText());
    execSize=computeSize(menuItem1.getText());
    if (debugSize.x > execSize.x) {
      formDatat.right=new FormAttachment(0,debugSize.x + 60);
    }
 else {
      formDatat.right=new FormAttachment(0,execSize.x + 50);
    }
  }
 else {
    itemDropDown.setText(menuItem1.getText());
    execSize=computeSize(itemDropDown.getText());
    formDatat.right=new FormAttachment(0,execSize.x + 50);
  }
  toolBar.setLayoutData(formDatat);
  killBtn=new Button(execHeader,SWT.PUSH);
  killBtn.setText(Messages.getString("String_Node_Str"));
  killBtn.setToolTipText(Messages.getString("String_Node_Str"));
  killBtn.setImage(ImageProvider.getImage(ERunprocessImages.KILL_PROCESS_ACTION));
  killBtn.setEnabled(false);
  FormData formDatap=new FormData();
  formDatap.left=new FormAttachment(toolBar,0,SWT.RIGHT);
  formDatap.width=80;
  formDatap.top=new FormAttachment(0,0);
  formDatap.bottom=new FormAttachment(0,30);
  killBtn.setLayoutData(formDatap);
  clearTracePerfBtn=new Button(execHeader,SWT.PUSH);
  clearTracePerfBtn.setText(Messages.getString("String_Node_Str"));
  clearTracePerfBtn.setToolTipText(Messages.getString("String_Node_Str"));
  clearTracePerfBtn.setImage(ImageProvider.getImage(RunProcessPlugin.imageDescriptorFromPlugin(RunProcessPlugin.PLUGIN_ID,"String_Node_Str")));
  clearTracePerfBtn.setEnabled(false);
  formDatap=new FormData();
  formDatap.left=new FormAttachment(killBtn,0,SWT.RIGHT);
  formDatap.width=80;
  formDatap.top=new FormAttachment(0,0);
  formDatap.bottom=new FormAttachment(0,30);
  clearTracePerfBtn.setLayoutData(formDatap);
  consoleText=new StyledText(execContent,SWT.BORDER | SWT.WRAP | SWT.V_SCROLL| SWT.READ_ONLY);
  FormData formDataco=new FormData();
  formDataco.top=new FormAttachment(0,50);
  formDataco.left=new FormAttachment(0,0);
  formDataco.right=new FormAttachment(100,0);
  formDataco.bottom=new FormAttachment(100,-30);
  consoleText.setLayoutData(formDataco);
  consoleText.addKeyListener(new KeyListener(){
    @Override public void keyPressed(    KeyEvent evt){
      if ((evt.stateMask == SWT.CTRL) && (evt.keyCode == 'a')) {
        if (consoleText.getText().length() > 0) {
          consoleText.setSelection(0,(consoleText.getText().length() - 1));
        }
      }
 else       if ((evt.stateMask == SWT.CTRL) && (evt.keyCode == 'f')) {
        FindDialog td=new FindDialog(Display.getCurrent().getActiveShell());
        td.setConsoleText(consoleText);
        td.setBlockOnOpen(true);
        td.open();
      }
    }
    @Override public void keyReleased(    KeyEvent arg0){
    }
  }
);
  if (!setConsoleFont()) {
    Font font=new Font(parent.getDisplay(),"String_Node_Str",8,SWT.NONE);
    consoleText.setFont(font);
  }
  pcl=new PropertyChangeListener(){
    @Override public void propertyChange(    PropertyChangeEvent evt){
      runProcessContextChanged(evt);
    }
  }
;
  streamListener=new IStreamListener(){
    @Override public void streamAppended(    String text,    IStreamMonitor monitor){
      IProcessMessage message=new ProcessMessage(ProcessMessage.MsgType.STD_OUT,text);
      processContext.addDebugResultToConsole(message);
    }
  }
;
  addListeners();
  createLineLimitedControl(execContent);
}

Fixed version (ground truth):
/** 
 * DOC Administrator DebugProcessComposite constructor comment.
 * @param parent
 * @param style
 */
public DebugProcessTosComposite(Composite parent,int style){
  super(parent,style);
  setExpandHorizontal(true);
  setExpandVertical(true);
  this.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
  FormData layouData=new FormData();
  layouData.left=new FormAttachment(0,0);
  layouData.right=new FormAttachment(100,0);
  layouData.top=new FormAttachment(0,0);
  layouData.bottom=new FormAttachment(100,0);
  setLayoutData(layouData);
  this.setLayout(new FormLayout());
  final Composite panel=new Composite(this,SWT.NONE);
  setContent(panel);
  FormLayout layout=new FormLayout();
  layout.marginWidth=5 + 2;
  layout.marginHeight=4;
  layout.spacing=6 + 1;
  panel.setLayout(layout);
  Group execGroup=new Group(panel,SWT.NONE);
  execGroup.setText("String_Node_Str");
  GridLayout layout5=new GridLayout();
  layout5.marginHeight=0;
  layout5.marginWidth=0;
  execGroup.setLayout(layout5);
  FormData layouDatag=new FormData();
  layouDatag.left=new FormAttachment(0,0);
  layouDatag.right=new FormAttachment(100,0);
  layouDatag.top=new FormAttachment(0,0);
  layouDatag.bottom=new FormAttachment(100,0);
  execGroup.setLayoutData(layouDatag);
  ScrolledComposite execScroll=new ScrolledComposite(execGroup,SWT.V_SCROLL | SWT.H_SCROLL);
  execScroll.setExpandHorizontal(true);
  execScroll.setExpandVertical(true);
  execScroll.setLayoutData(new GridData(GridData.FILL_BOTH));
  Composite execContent=new Composite(execScroll,SWT.NONE);
  execContent.setLayout(new FormLayout());
  execScroll.setContent(execContent);
  Composite execHeader=new Composite(execContent,SWT.NONE);
  FormLayout formLayout=new FormLayout();
  formLayout.marginWidth=7;
  formLayout.marginHeight=4;
  formLayout.spacing=7;
  execHeader.setLayout(formLayout);
  FormData layoutData=new FormData();
  layoutData.left=new FormAttachment(0,0);
  layoutData.right=new FormAttachment(100,0);
  layoutData.top=new FormAttachment(0,0);
  layoutData.bottom=new FormAttachment(0,50);
  execHeader.setLayoutData(layoutData);
  Composite toolBarComposite=new Composite(execHeader,SWT.NONE);
  toolBarComposite.setLayout(new FillLayout());
  toolBar=new ToolBar(toolBarComposite,SWT.FLAT | SWT.RIGHT);
  itemDropDown=new ToolItem(toolBar,SWT.ARROW);
  itemDropDown.setText(Messages.getString("String_Node_Str"));
  itemDropDown.setData(ProcessView.TRACEDEBUG_ID);
  itemDropDown.setToolTipText(Messages.getString("String_Node_Str"));
  itemDropDown.setImage(ImageProvider.getImage(ERunprocessImages.DEBUG_TRACE_ACTION));
  menu=new Menu(execHeader);
  itemDropDown.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent event){
      if (event.detail == SWT.ARROW) {
        Rectangle bounds=itemDropDown.getBounds();
        Point point=toolBar.toDisplay(bounds.x,bounds.y + bounds.height);
        menu.setLocation(point);
        menu.setVisible(true);
      }
 else {
        ToolItem item=(ToolItem)event.widget;
        errorMessMap.clear();
        if (item.getData().equals(ProcessView.DEBUG_ID)) {
          debug();
        }
 else {
          execButtonPressed();
        }
      }
    }
  }
);
  final MenuItem menuItem1=new MenuItem(menu,SWT.PUSH);
  menuItem1.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
  menuItem1.setImage(ImageProvider.getImage(ERunprocessImages.DEBUG_PROCESS_ACTION));
  menuItem1.setData(ProcessView.DEBUG_ID);
  menuItem1.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent event){
      if (!itemDropDown.getData().equals(ProcessView.PAUSE_ID) && !itemDropDown.getData().equals(ProcessView.RESUME_ID)) {
        itemDropDown.setText(menuItem1.getText());
        itemDropDown.setData(ProcessView.DEBUG_ID);
        itemDropDown.setImage(ImageProvider.getImage(ERunprocessImages.DEBUG_PROCESS_ACTION));
        itemDropDown.setToolTipText(Messages.getString("String_Node_Str"));
        toolBar.getParent().getParent().layout();
        manager.setBooleanTrace(false);
        addTrace(ProcessView.DEBUG_ID);
      }
    }
  }
);
  IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
  if (brandingService.getBrandingConfiguration().isAllowDebugMode()) {
    debugMenuItem=new MenuItem(menu,SWT.PUSH);
    debugMenuItem.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    debugMenuItem.setData(ProcessView.TRACEDEBUG_ID);
    debugMenuItem.setImage(ImageProvider.getImage(ERunprocessImages.DEBUG_TRACE_ACTION));
    debugMenuItem.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent event){
        if (!itemDropDown.getData().equals(ProcessView.PAUSE_ID) && !itemDropDown.getData().equals(ProcessView.RESUME_ID)) {
          itemDropDown.setText(debugMenuItem.getText());
          itemDropDown.setData(ProcessView.TRACEDEBUG_ID);
          itemDropDown.setImage(ImageProvider.getImage(ERunprocessImages.DEBUG_TRACE_ACTION));
          itemDropDown.setToolTipText(Messages.getString("String_Node_Str"));
          toolBar.getParent().getParent().layout();
          manager.setBooleanTrace(true);
          addTrace(ProcessView.TRACEDEBUG_ID);
        }
      }
    }
);
  }
  toolBar.setEnabled(false);
  if (brandingService.getBrandingConfiguration().isAllowDebugMode()) {
    itemDropDown.setText(debugMenuItem.getText());
  }
 else {
    itemDropDown.setText(menuItem1.getText());
  }
  killBtn=new Button(execHeader,SWT.PUSH);
  killBtn.setText(Messages.getString("String_Node_Str"));
  killBtn.setToolTipText(Messages.getString("String_Node_Str"));
  killBtn.setImage(ImageProvider.getImage(ERunprocessImages.KILL_PROCESS_ACTION));
  killBtn.setEnabled(false);
  FormData formDatap=new FormData();
  formDatap.left=new FormAttachment(toolBarComposite,0,SWT.RIGHT);
  formDatap.width=80;
  formDatap.top=new FormAttachment(toolBarComposite,0,SWT.CENTER);
  formDatap.height=30;
  killBtn.setLayoutData(formDatap);
  clearTracePerfBtn=new Button(execHeader,SWT.PUSH);
  clearTracePerfBtn.setText(Messages.getString("String_Node_Str"));
  clearTracePerfBtn.setToolTipText(Messages.getString("String_Node_Str"));
  clearTracePerfBtn.setImage(ImageProvider.getImage(RunProcessPlugin.imageDescriptorFromPlugin(RunProcessPlugin.PLUGIN_ID,"String_Node_Str")));
  clearTracePerfBtn.setEnabled(false);
  formDatap=new FormData();
  formDatap.left=new FormAttachment(killBtn,0,SWT.RIGHT);
  formDatap.width=80;
  formDatap.top=new FormAttachment(toolBarComposite,0,SWT.CENTER);
  formDatap.height=30;
  clearTracePerfBtn.setLayoutData(formDatap);
  consoleText=new StyledText(execContent,SWT.BORDER | SWT.WRAP | SWT.V_SCROLL| SWT.READ_ONLY);
  FormData formDataco=new FormData();
  formDataco.top=new FormAttachment(0,50);
  formDataco.left=new FormAttachment(0,10);
  formDataco.right=new FormAttachment(100,0);
  formDataco.bottom=new FormAttachment(100,-30);
  consoleText.setLayoutData(formDataco);
  consoleText.addKeyListener(new KeyListener(){
    @Override public void keyPressed(    KeyEvent evt){
      if ((evt.stateMask == SWT.CTRL) && (evt.keyCode == 'a')) {
        if (consoleText.getText().length() > 0) {
          consoleText.setSelection(0,(consoleText.getText().length() - 1));
        }
      }
 else       if ((evt.stateMask == SWT.CTRL) && (evt.keyCode == 'f')) {
        FindDialog td=new FindDialog(Display.getCurrent().getActiveShell());
        td.setConsoleText(consoleText);
        td.setBlockOnOpen(true);
        td.open();
      }
    }
    @Override public void keyReleased(    KeyEvent arg0){
    }
  }
);
  if (!setConsoleFont()) {
    Font font=new Font(parent.getDisplay(),"String_Node_Str",8,SWT.NONE);
    consoleText.setFont(font);
  }
  pcl=new PropertyChangeListener(){
    @Override public void propertyChange(    PropertyChangeEvent evt){
      runProcessContextChanged(evt);
    }
  }
;
  streamListener=new IStreamListener(){
    @Override public void streamAppended(    String text,    IStreamMonitor monitor){
      IProcessMessage message=new ProcessMessage(ProcessMessage.MsgType.STD_OUT,text);
      processContext.addDebugResultToConsole(message);
    }
  }
;
  addListeners();
  createLineLimitedControl(execContent);
}