nus-yam/ex-repair huggingface dataset:
Program: 148287
Project: 148287
Buggy source:
private void create(){
  GridData gd=new GridData(SWT.LEFT,SWT.TOP,false,true,1,1);
  if (label.length() > 0) {
    Label label=factory.createLabel(parent,this.label);
    label.setText(this.label);
    label.setLayoutData(gd);
  }
  text=factory.createText(parent,"String_Node_Str",SWT.SINGLE | SWT.BORDER);
  gd=new GridData(SWT.FILL,SWT.FILL,true,false,1,1);
  text.setLayoutData(gd);
  text.setText(filename);
  button=new Button(parent,SWT.PUSH);
  button.setText("String_Node_Str");
  button.setImage(ImageCache.getCreatedImage(EImage.DOTS_BUTTON.getPath()));
  gd=new GridData(SWT.RIGHT,SWT.TOP,false,false,1,1);
  button.setLayoutData(gd);
  button.setToolTipText("String_Node_Str");
  button.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      if (isFile) {
        FileDialog fileDialog=new FileDialog(parent.getShell(),SWT.OPEN);
        fileDialog.setFilterExtensions(fileExtents);
        fileDialog.setFileName(filename);
        String name=fileDialog.open();
        if (name != null) {
          text.setText(name);
        }
      }
 else {
        DirectoryDialog d=new DirectoryDialog(parent.getShell());
        String name=d.open();
        if (name != null)         text.setText(name);
      }
    }
  }
);
}

Fixed version (ground truth):
private void create(){
  GridData gd=new GridData(SWT.LEFT,SWT.TOP,false,true,1,1);
  if (label.length() > 0) {
    Label label=factory.createLabel(parent,this.label);
    label.setText(this.label);
    label.setLayoutData(gd);
  }
  text=factory.createText(parent,"String_Node_Str",SWT.SINGLE | SWT.BORDER);
  gd=new GridData(SWT.FILL,SWT.FILL,true,false,1,1);
  text.setLayoutData(gd);
  text.setText(filename);
  button=new Button(parent,SWT.PUSH);
  button.setText("String_Node_Str");
  button.setImage(ImageCache.getCreatedImage(EImage.DOTS_BUTTON.getPath()));
  gd=new GridData(SWT.RIGHT,SWT.TOP,false,false,1,1);
  button.setLayoutData(gd);
  button.setToolTipText("String_Node_Str");
  button.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      if (isFile) {
        FileDialog fileDialog=new FileDialog(parent.getShell(),type);
        fileDialog.setFilterExtensions(fileExtents);
        fileDialog.setFileName(filename);
        String name=fileDialog.open();
        if (name != null) {
          text.setText(name);
        }
      }
 else {
        DirectoryDialog d=new DirectoryDialog(parent.getShell());
        String name=d.open();
        if (name != null)         text.setText(name);
      }
    }
  }
);
}
Program: 148288
Project: 148288
Buggy source:
public FileSelectWidget(Composite parent,String label,String[] fileExtents,String filename,boolean isFile){
  this.label=label;
  this.filename=filename;
  this.fileExtents=fileExtents;
  this.parent=parent;
  if (parent.getLayout() == null) {
    GridLayout layout=new GridLayout();
    layout.numColumns=3;
    this.parent.setLayout(layout);
  }
  this.isFile=isFile;
  create();
}

Fixed version (ground truth):
public FileSelectWidget(Composite parent,String label,String[] fileExtents,String filename,boolean isFile){
  this(parent,label,fileExtents,filename,isFile,SWT.OPEN);
}
Program: 148289
Project: 148289
Buggy source:
protected void registToGolbalCommitBarListenerReg(){
  CommitBarListenerRegistry.getInstance().registListener(getParentTabID(),this);
}

Fixed version (ground truth):
protected void registToGolbalCommitBarListenerReg(){
  CommitBarListenerRegistry.getInstance().registListener(getParentTabID(),this);
  registCommitSectionListener();
}
Program: 148290
Project: 148290
Buggy source:
@Override public void createControls(Composite parent,TabbedPropertySheetPage aTabbedPropertySheetPage){
  super.createControls(parent,aTabbedPropertySheetPage);
  initUIListeners();
  registListenersFromGlobalRegistry();
}

Fixed version (ground truth):
@Override public void createControls(Composite parent,TabbedPropertySheetPage aTabbedPropertySheetPage){
  super.createControls(parent,aTabbedPropertySheetPage);
  initUIListeners();
  registListenersFromGlobalRegistry();
  CommitBarListenerRegistry.getInstance().registCommitSection(this);
}
Program: 148291
Project: 148291
Buggy source:
@Override protected void createControlsInSection(Composite compSectionClient){
  Composite compTop=getWidgetFactory().createFlatFormComposite(compSectionClient);
  compTop.setLayout(new GridLayout());
  compNameConfig=new NameConfigComposite(compTop,SWT.NONE);
  GridData gdCompName=new GridData(SWT.FILL,SWT.CENTER,true,false);
  compNameConfig.setLayoutData(gdCompName);
  Group gpKeyConfig=new Group(compTop,SWT.NONE);
  gpKeyConfig.setText("String_Node_Str");
  gpKeyConfig.setBackground(compSectionClient.getDisplay().getSystemColor(SWT.COLOR_WHITE));
  GridData gdGroupKeyConfig=new GridData(SWT.FILL,SWT.FILL,true,true);
  gpKeyConfig.setLayoutData(gdGroupKeyConfig);
  gpKeyConfig.setLayout(new FillLayout());
  compKeyConfig=new EntityKeyConfigComposite(gpKeyConfig,SWT.NONE);
  compCommitBar=new CommitBarComposite(compTop,SWT.NONE);
  GridData gdCompCommitBar=new GridData(SWT.BEGINNING,SWT.TOP,false,false);
  compCommitBar.setLayoutData(gdCompCommitBar);
  compCommitBar.addCommitListener(this);
}

Fixed version (ground truth):
@Override protected void createControlsInSection(Composite compSectionClient){
  Composite compTop=getWidgetFactory().createFlatFormComposite(compSectionClient);
  compTop.setLayout(new GridLayout());
  compCommitBar=new CommitBarComposite(compTop,SWT.NONE);
  GridData gdCompCommitBar=new GridData(SWT.BEGINNING,SWT.TOP,false,false);
  compCommitBar.setLayoutData(gdCompCommitBar);
  compCommitBar.addCommitListener(this);
  compNameConfig=new NameConfigComposite(compTop,SWT.NONE);
  GridData gdCompName=new GridData(SWT.FILL,SWT.CENTER,true,false);
  compNameConfig.setLayoutData(gdCompName);
  Group gpKeyConfig=new Group(compTop,SWT.NONE);
  gpKeyConfig.setText("String_Node_Str");
  gpKeyConfig.setBackground(compSectionClient.getDisplay().getSystemColor(SWT.COLOR_WHITE));
  GridData gdGroupKeyConfig=new GridData(SWT.FILL,SWT.FILL,true,true);
  gpKeyConfig.setLayoutData(gdGroupKeyConfig);
  gpKeyConfig.setLayout(new FillLayout());
  compKeyConfig=new EntityKeyConfigComposite(gpKeyConfig,SWT.NONE);
}
Program: 148292
Project: 148292
Buggy source:
public CommitBarListener[] getCommitBarListeners(){
  return listeners.toArray(new CommitBarListener[0]);
}

Fixed version (ground truth):
public List<CommitBarListener> getCommitBarListeners(){
  return listeners;
}
Program: 148293
Project: 148293
Buggy source:
protected Control createDialogArea(Composite parent){
  Composite composite=(Composite)super.createDialogArea(parent);
  if (message != null) {
    Label label=new Label(composite,SWT.WRAP);
    label.setText(message);
    GridData data=new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL| GridData.VERTICAL_ALIGN_CENTER);
    data.widthHint=convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label.setLayoutData(data);
    label.setFont(parent.getFont());
  }
  inputCombo=new Combo(composite,SWT.READ_ONLY);
  inputCombo.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
  inputCombo.setItems(values);
  inputCombo.add("String_Node_Str");
  for (  String pro : values) {
    if (pro.equals(value)) {
      inputCombo.setText(pro);
      break;
    }
  }
  if (txtValue != null) {
    errorMessageText=new Text(composite,SWT.BORDER);
    errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
    errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    errorMessageText.setText(txtValue);
  }
  return composite;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  Composite composite=(Composite)super.createDialogArea(parent);
  if (message != null) {
    Label label=new Label(composite,SWT.WRAP);
    label.setText(message);
    GridData data=new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL| GridData.VERTICAL_ALIGN_CENTER);
    data.widthHint=convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label.setLayoutData(data);
    label.setFont(parent.getFont());
  }
  inputCombo=new Combo(composite,SWT.READ_ONLY);
  inputCombo.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
  inputCombo.setItems(values);
  inputCombo.add("String_Node_Str");
  for (  String pro : values) {
    if (pro.equals(value)) {
      inputCombo.setText(pro);
      break;
    }
  }
  if (txtValue != null) {
    errorMessageText=new Text(composite,SWT.BORDER);
    errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
    errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    errorMessageText.setText(txtValue);
    errorMessageText.setEditable(false);
  }
  return composite;
}
Program: 148294
Project: 148294
Buggy source:
public String getServer(){
  return endpointsCombo.getCombo().getText().trim();
}

Fixed version (ground truth):
public String getServer(){
  return urlText.getText().trim();
}
Program: 148295
Project: 148295
Buggy source:
private MDMServerDef getSelectedMDMServerDef(){
  IStructuredSelection selection=(IStructuredSelection)endpointsCombo.getSelection();
  if (selection.isEmpty())   return null;
  return (MDMServerDef)selection.getFirstElement();
}

Fixed version (ground truth):
private MDMServerDef getSelectedMDMServerDef(){
  IStructuredSelection selection=(IStructuredSelection)descCombo.getSelection();
  if (selection.isEmpty())   return null;
  return (MDMServerDef)selection.getFirstElement();
}
Program: 148296
Project: 148296
Buggy source:
private void onSelectMDMServer(){
  MDMServerDef selectedServer=getSelectedMDMServerDef();
  endpointsCombo.getCombo().setToolTipText(selectedServer == null ? "String_Node_Str" : selectedServer.getDesc());
  userText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getUser());
  passwordText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getPasswd());
  descriptionText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getDesc());
  userText.setFocus();
}

Fixed version (ground truth):
private void onSelectMDMServer(){
  MDMServerDef selectedServer=getSelectedMDMServerDef();
  descCombo.getCombo().setText(selectedServer == null ? "String_Node_Str" : selectedServer.getDesc());
  userText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getUser());
  passwordText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getPasswd());
  urlText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getUrl());
  userText.setFocus();
}
Program: 148297
Project: 148297
Buggy source:
public String getText(Object element){
  if (!(element instanceof MDMServerDef))   return "String_Node_Str";
  return ((MDMServerDef)element).getUrl();
}

Fixed version (ground truth):
public String getText(Object element){
  if (!(element instanceof MDMServerDef))   return "String_Node_Str";
  return ((MDMServerDef)element).getDesc();
}
Program: 148298
Project: 148298
Buggy source:
private void updateServerListInPreference(){
  String description=descriptionText.getText().trim();
  if ("String_Node_Str".equals(description)) {
    description=getDefaultConnectionDescription();
  }
  PreferenceMDMServerExtractor.getInstence().updateMDMServerDefinitionsBy(endpointsCombo.getCombo().getText().trim(),userText.getText().trim(),passwordText.getText(),description);
}

Fixed version (ground truth):
private void updateServerListInPreference(){
  String description=descCombo.getCombo().getText().trim();
  if ("String_Node_Str".equals(description)) {
    description=getDefaultConnectionDescription();
  }
  PreferenceMDMServerExtractor.getInstence().updateMDMServerDefinitionsBy(urlText.getText().trim(),userText.getText().trim(),passwordText.getText(),description);
}
Program: 148301
Project: 148301
Buggy source:
private boolean checkServer(Element root){
  List properties=root.elements("String_Node_Str");
  for (Iterator iterator=properties.iterator(); iterator.hasNext(); ) {
    Element ele=(Element)iterator.next();
    if (ele.element("String_Node_Str").getText().equals(endpointsCombo.getCombo().getText().trim()) && ele.element("String_Node_Str").getText().equals(userText.getText()) && ele.element("String_Node_Str").getText().equals(passwordText.getText())&& ele.element("String_Node_Str").getText().equals(universeCombo.getText()))     return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean checkServer(Element root){
  List properties=root.elements("String_Node_Str");
  for (Iterator iterator=properties.iterator(); iterator.hasNext(); ) {
    Element ele=(Element)iterator.next();
    if (ele.element("String_Node_Str").getText().equals(urlText.getText().trim()) && ele.element("String_Node_Str").getText().equals(userText.getText()) && ele.element("String_Node_Str").getText().equals(passwordText.getText())&& ele.element("String_Node_Str").getText().equals(universeCombo.getText()))     return true;
  }
  return false;
}
Program: 148302
Project: 148302
Buggy source:
private String getDefaultConnectionDescription(){
  StringBuilder sb=new StringBuilder();
  sb.append(userText.getText().trim());
  sb.append("String_Node_Str");
  sb.append(endpointsCombo.getCombo().getText().trim());
  return sb.toString();
}

Fixed version (ground truth):
private String getDefaultConnectionDescription(){
  StringBuilder sb=new StringBuilder();
  sb.append(userText.getText().trim());
  sb.append("String_Node_Str");
  sb.append(urlText.getText().trim());
  return sb.toString();
}
Program: 148303
Project: 148303
Buggy source:
private void addServer(Element root){
  Element prop=root.addElement("String_Node_Str");
  Element url=prop.addElement("String_Node_Str");
  Element user=prop.addElement("String_Node_Str");
  Element password=prop.addElement("String_Node_Str");
  Element universe=prop.addElement("String_Node_Str");
  url.setText(endpointsCombo.getCombo().getText().trim());
  user.setText(userText.getText());
  if (savePasswordButton.getSelection() == true)   password.setText(PasswordUtil.encryptPassword(passwordText.getText()));
 else   root.remove(prop);
  if (Util.IsEnterPrise())   universe.setText(universeCombo.getText());
}

Fixed version (ground truth):
private void addServer(Element root){
  Element prop=root.addElement("String_Node_Str");
  Element url=prop.addElement("String_Node_Str");
  Element user=prop.addElement("String_Node_Str");
  Element password=prop.addElement("String_Node_Str");
  Element universe=prop.addElement("String_Node_Str");
  url.setText(urlText.getText().trim());
  user.setText(userText.getText());
  if (savePasswordButton.getSelection() == true)   password.setText(PasswordUtil.encryptPassword(passwordText.getText()));
 else   root.remove(prop);
  if (Util.IsEnterPrise())   universe.setText(universeCombo.getText());
}
Program: 148304
Project: 148304
Buggy source:
/** 
 * Selection Listener on OK Button
 */
public void widgetSelected(SelectionEvent e){
  int buttonId=((Integer)e.widget.getData()).intValue();
  if (IDialogConstants.OK_ID != buttonId)   return;
  String url=dialog.getServer();
  String username=dialog.getUsernameText();
  String password=dialog.getPasswordText();
  String universe=dialog.getUniverse();
  dialog.close();
  String cmp=Util.checkOnVersionCompatibility(url,username,password,universe);
  if (cmp != null) {
    MessageDialog.openError(null,"String_Node_Str","String_Node_Str" + cmp);
    return;
  }
  view.initServerTree(url,username,password,universe);
}

Fixed version (ground truth):
/** 
 * Selection Listener on OK Button
 */
public void widgetSelected(SelectionEvent e){
  int buttonId=((Integer)e.widget.getData()).intValue();
  if (IDialogConstants.OK_ID != buttonId || !dialog.isOK())   return;
  String url=dialog.getServer();
  String username=dialog.getUsernameText();
  String password=dialog.getPasswordText();
  String universe=dialog.getUniverse();
  dialog.close();
  String cmp=Util.checkOnVersionCompatibility(url,username,password,universe);
  if (cmp != null) {
    MessageDialog.openError(null,"String_Node_Str","String_Node_Str" + cmp);
    return;
  }
  view.initServerTree(url,username,password,universe);
}
Program: 148305
Project: 148305
Buggy source:
private void editWhiteSpace(){
  String[] values={"String_Node_Str","String_Node_Str","String_Node_Str"};
  XSDWhiteSpaceFacet currentValue=std.getWhiteSpaceFacet();
  String stringValue="String_Node_Str";
  if (currentValue != null)   stringValue=currentValue.getLexicalValue();
  dialog=new InputComboDialog(page.getSite().getShell(),"String_Node_Str","String_Node_Str",values,stringValue);
  dialog.setBlockOnOpen(true);
  int ret=dialog.open();
  if (ret == Dialog.CANCEL)   return;
  if (currentValue != null)   std.getFacetContents().remove(currentValue);
  String stirngValue=((InputComboDialog)dialog).getValue();
  if (stirngValue != null && stirngValue.length() > 0) {
    XSDWhiteSpaceFacet f=(XSDSchemaBuildingTools.getXSDFactory()).createXSDWhiteSpaceFacet();
    f.setLexicalValue("String_Node_Str" + stirngValue);
    std.getFacetContents().add(f);
  }
}

Fixed version (ground truth):
private void editWhiteSpace(){
  String[] values={"String_Node_Str","String_Node_Str","String_Node_Str"};
  XSDWhiteSpaceFacet currentValue=std.getWhiteSpaceFacet();
  String stringValue="String_Node_Str";
  if (currentValue != null)   stringValue=currentValue.getLexicalValue();
  dialog=new InputComboDialog(page.getSite().getShell(),"String_Node_Str","String_Node_Str",values,stringValue,null);
  dialog.setBlockOnOpen(true);
  int ret=dialog.open();
  if (ret == Dialog.CANCEL)   return;
  if (currentValue != null)   std.getFacetContents().remove(currentValue);
  String stirngValue=((InputComboDialog)dialog).getValue();
  if (stirngValue != null && stirngValue.length() > 0) {
    XSDWhiteSpaceFacet f=(XSDSchemaBuildingTools.getXSDFactory()).createXSDWhiteSpaceFacet();
    f.setLexicalValue("String_Node_Str" + stirngValue);
    std.getFacetContents().add(f);
  }
}
Program: 148306
Project: 148306
Buggy source:
public InputComboDialog(Shell parentShell,String dialogTitle,String dialogMessage,String[] dialogValues,String initialValue){
  super(parentShell);
  this.message=dialogMessage;
  this.title=dialogTitle;
  this.message=dialogMessage;
  this.values=dialogValues;
  this.value=initialValue;
}

Fixed version (ground truth):
public InputComboDialog(Shell parentShell,String dialogTitle,String dialogMessage,String[] dialogValues,String initialValue,String txtValue){
  super(parentShell);
  this.message=dialogMessage;
  this.title=dialogTitle;
  this.message=dialogMessage;
  this.values=dialogValues;
  this.value=initialValue;
  this.txtValue=txtValue;
}
Program: 148307
Project: 148307
Buggy source:
protected Control createDialogArea(Composite parent){
  Composite composite=(Composite)super.createDialogArea(parent);
  if (message != null) {
    Label label=new Label(composite,SWT.WRAP);
    label.setText(message);
    GridData data=new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL| GridData.VERTICAL_ALIGN_CENTER);
    data.widthHint=convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label.setLayoutData(data);
    label.setFont(parent.getFont());
  }
  inputCombo=new Combo(composite,SWT.READ_ONLY);
  inputCombo.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
  inputCombo.setItems(values);
  inputCombo.add("String_Node_Str");
  for (  String pro : values) {
    if (pro.equals(value)) {
      inputCombo.setText(pro);
      break;
    }
  }
  errorMessageText=new Text(composite,SWT.READ_ONLY | SWT.WRAP);
  errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
  errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
  applyDialogFont(composite);
  return composite;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  Composite composite=(Composite)super.createDialogArea(parent);
  if (message != null) {
    Label label=new Label(composite,SWT.WRAP);
    label.setText(message);
    GridData data=new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL| GridData.VERTICAL_ALIGN_CENTER);
    data.widthHint=convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label.setLayoutData(data);
    label.setFont(parent.getFont());
  }
  inputCombo=new Combo(composite,SWT.READ_ONLY);
  inputCombo.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
  inputCombo.setItems(values);
  inputCombo.add("String_Node_Str");
  for (  String pro : values) {
    if (pro.equals(value)) {
      inputCombo.setText(pro);
      break;
    }
  }
  if (txtValue != null) {
    errorMessageText=new Text(composite,SWT.BORDER);
    errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
    errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    errorMessageText.setText(txtValue);
  }
  return composite;
}
Program: 148309
Project: 148309
Buggy source:
protected void okPressed(){
  boolean isExist=false;
  SAXReader reader=new SAXReader();
  Element root=null;
  if (new File(f).exists()) {
    try {
      logininfoDocument=reader.read(new File(f));
    }
 catch (    DocumentException e) {
      log.error(e.getMessage(),e);
    }
    root=logininfoDocument.getRootElement();
    isExist=checkServer(root);
  }
 else {
    logininfoDocument=DocumentHelper.createDocument();
    root=logininfoDocument.addElement("String_Node_Str");
  }
  if (!isExist) {
    addServer(root);
    updateServerListInPreference();
  }
  XMLWriter writer;
  try {
    writer=new XMLWriter(new FileWriter(f));
    writer.write(logininfoDocument);
    writer.close();
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
  setReturnCode(OK);
}

Fixed version (ground truth):
protected void okPressed(){
  boolean isExist=false;
  if (descriptionText.getText().trim().length() == 0) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
    descriptionText.setFocus();
    isOK=false;
    return;
  }
  if (userText.getText().trim().length() == 0) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
    userText.setFocus();
    isOK=false;
    return;
  }
  if (passwordText.getText().trim().length() == 0) {
    MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
    passwordText.setFocus();
    isOK=false;
    return;
  }
  for (  MDMServerDef def : PreferenceMDMServerExtractor.getInstence().getMDMServerDefinitions()) {
    if (def.getDesc().equals(descriptionText.getText()) && !def.getUrl().equals(endpointsCombo.getCombo().getText())) {
      MessageDialog.openWarning(null,"String_Node_Str","String_Node_Str");
      descriptionText.setFocus();
      isOK=false;
      return;
    }
  }
  isOK=true;
  SAXReader reader=new SAXReader();
  Element root=null;
  if (new File(f).exists()) {
    try {
      logininfoDocument=reader.read(new File(f));
    }
 catch (    DocumentException e) {
      log.error(e.getMessage(),e);
    }
    root=logininfoDocument.getRootElement();
    isExist=checkServer(root);
  }
 else {
    logininfoDocument=DocumentHelper.createDocument();
    root=logininfoDocument.addElement("String_Node_Str");
  }
  if (!isExist) {
    addServer(root);
    updateServerListInPreference();
  }
  XMLWriter writer;
  try {
    writer=new XMLWriter(new FileWriter(f));
    writer.write(logininfoDocument);
    writer.close();
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
  setReturnCode(OK);
}
Program: 148311
Project: 148311
Buggy source:
/** 
 * readjust the viewer height
 */
private void readjustViewerHeight(){
  LineItem[] items=(LineItem[])resultsViewer.getInput();
  GridData grid=(GridData)resultsViewer.getTable().getLayoutData();
  int actualHeight=14 * items.length;
  if (actualHeight < DEFAULT_VIEWER_HEIGHT)   actualHeight=DEFAULT_VIEWER_HEIGHT;
  grid.heightHint=actualHeight;
  resultsViewer.refresh();
  getManagedForm().reflow(true);
}

Fixed version (ground truth):
/** 
 * readjust the viewer height
 */
private void readjustViewerHeight(){
  resultsViewer.refresh();
}
Program: 148314
Project: 148314
Buggy source:
public ExtensibleTextContentEditorPage(Composite parent,int style){
  super(parent,style);
  setLayout(new FillLayout());
  textViewer=new SourceViewer(this,new VerticalRuler(10),SWT.V_SCROLL);
  initUIListeners();
}

Fixed version (ground truth):
public ExtensibleTextContentEditorPage(Composite parent,int style){
  super(parent,style);
  setLayout(new FillLayout());
  textViewer=new SourceViewer(this,new VerticalRuler(10),SWT.H_SCROLL | SWT.V_SCROLL);
  initUIListeners();
}
Program: 148315
Project: 148315
Buggy source:
private void onSelectMDMServer(){
  MDMServerDef selectedServer=getSelectedMDMServerDef();
  endpointsCombo.getCombo().setToolTipText(selectedServer == null ? "String_Node_Str" : selectedServer.getDesc());
  userText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getUser());
  passwordText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getPasswd());
}

Fixed version (ground truth):
private void onSelectMDMServer(){
  MDMServerDef selectedServer=getSelectedMDMServerDef();
  endpointsCombo.getCombo().setToolTipText(selectedServer == null ? "String_Node_Str" : selectedServer.getDesc());
  userText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getUser());
  passwordText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getPasswd());
  descriptionText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getDesc());
}
Program: 148316
Project: 148316
Buggy source:
private void onSelectMDMServer(){
  MDMServerDef selectedServer=getSelectedMDMServerDef();
  endpointsCombo.getCombo().setToolTipText(selectedServer == null ? "String_Node_Str" : selectedServer.getDesc());
  userText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getUser());
  passwordText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getPasswd());
  descriptionText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getDesc());
}

Fixed version (ground truth):
private void onSelectMDMServer(){
  MDMServerDef selectedServer=getSelectedMDMServerDef();
  endpointsCombo.getCombo().setToolTipText(selectedServer == null ? "String_Node_Str" : selectedServer.getDesc());
  descriptionText.setText(selectedServer == null ? "String_Node_Str" : selectedServer.getDesc());
  userText.setFocus();
}
Program: 148318
Project: 148318
Buggy source:
protected void createCharacteristicsContent(FormToolkit toolkit,Composite mainComposite){
  try {
    Label descriptionLabel=toolkit.createLabel(mainComposite,"String_Node_Str",SWT.NULL);
    descriptionLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true,1,1));
    descriptionText=toolkit.createText(mainComposite,"String_Node_Str",SWT.BORDER | SWT.MULTI);
    descriptionText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
    ((GridData)descriptionText.getLayoutData()).minimumHeight=30;
    descriptionText.addModifyListener(this);
    refreshData();
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
protected void createCharacteristicsContent(FormToolkit toolkit,Composite mainComposite){
  try {
    Label descriptionLabel=toolkit.createLabel(mainComposite,"String_Node_Str",SWT.NULL);
    descriptionLabel.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true,1,1));
    descriptionText=toolkit.createText(mainComposite,"String_Node_Str",SWT.BORDER);
    descriptionText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
    ((GridData)descriptionText.getLayoutData()).minimumHeight=30;
    descriptionText.addModifyListener(this);
    refreshData();
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
}
Program: 148326
Project: 148326
Buggy source:
public CalendarSelectWidget(FormToolkit toolkit,final Composite composite,boolean hasDefaultTime){
  text=toolkit.createText(composite,"String_Node_Str",SWT.BORDER | SWT.MULTI);
  text.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,true,1,1));
  ((GridData)text.getLayoutData()).widthHint=100;
  if (hasDefaultTime) {
    Calendar c=Calendar.getInstance();
    long yesterday=c.getTimeInMillis() - (1000 * 60 * 60* 24);
    c.setTimeInMillis(yesterday);
    text.pack();
  }
  btn=toolkit.createButton(composite,"String_Node_Str",SWT.CENTER | SWT.ARROW | SWT.DOWN);
  btn.addListener(SWT.Selection,new Listener(){
    public void handleEvent(    Event event){
      if (cal == null || cal.getShell().isDisposed())       cal=new CalendarDialog(composite.getShell());
      if (text.getText() != null && text.getText().length() > 0) {
        try {
          Date d=sdf.parse(text.getText());
          cal.setDate(d);
        }
 catch (        ParseException pe) {
        }
      }
      cal.addDateChangedListener(new SWTCalendarListener(){
        public void dateChanged(        SWTCalendarEvent calendarEvent){
          text.setText(sdf.format(calendarEvent.getCalendar().getTime()));
        }
      }
);
      Point sbPoint=btn.getDisplay().map(btn.getParent(),null,btn.getLocation());
      cal.getShell().setLocation(new Point(sbPoint.x,sbPoint.y + btn.getSize().y));
      cal.open();
    }
  }
);
}

Fixed version (ground truth):
public CalendarSelectWidget(FormToolkit toolkit,final Composite composite,boolean hasDefaultTime){
  text=toolkit.createText(composite,"String_Node_Str",SWT.BORDER);
  text.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,true,1,1));
  ((GridData)text.getLayoutData()).widthHint=100;
  if (hasDefaultTime) {
    Calendar c=Calendar.getInstance();
    long yesterday=c.getTimeInMillis() - (1000 * 60 * 60* 24);
    c.setTimeInMillis(yesterday);
    text.pack();
  }
  btn=toolkit.createButton(composite,"String_Node_Str",SWT.CENTER | SWT.ARROW | SWT.DOWN);
  btn.addListener(SWT.Selection,new Listener(){
    public void handleEvent(    Event event){
      if (cal == null || cal.getShell().isDisposed())       cal=new CalendarDialog(composite.getShell());
      if (text.getText() != null && text.getText().length() > 0) {
        try {
          Date d=sdf.parse(text.getText());
          cal.setDate(d);
        }
 catch (        ParseException pe) {
        }
      }
      cal.addDateChangedListener(new SWTCalendarListener(){
        public void dateChanged(        SWTCalendarEvent calendarEvent){
          text.setText(sdf.format(calendarEvent.getCalendar().getTime()));
        }
      }
);
      Point sbPoint=btn.getDisplay().map(btn.getParent(),null,btn.getLocation());
      cal.getShell().setLocation(new Point(sbPoint.x,sbPoint.y + btn.getSize().y));
      cal.open();
    }
  }
);
}
Program: 148328
Project: 148328
Buggy source:
public LabelText(FormToolkit toolkit,Composite parent,final String labelName){
  label=toolkit.createLabel(parent,labelName,SWT.NULL);
  label.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,true,1,1));
  text=toolkit.createText(parent,"String_Node_Str",SWT.BORDER | SWT.MULTI);
  text.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
}

Fixed version (ground truth):
public LabelText(FormToolkit toolkit,Composite parent,final String labelName){
  label=toolkit.createLabel(parent,labelName,SWT.NULL);
  label.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,true,1,1));
  text=toolkit.createText(parent,"String_Node_Str",SWT.BORDER);
  text.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
}
Program: 148329
Project: 148329
Buggy source:
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e){
  changeDomTree(tree,"String_Node_Str");
}

Fixed version (ground truth):
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e){
  changeDomTree(tree,filterText.getText());
}
Program: 148331
Project: 148331
Buggy source:
protected IStatus redo(){
  System.out.println(getText() + "String_Node_Str");
  String doc=redoActionTrack.get(getActionUndoPos());
  refresh(doc);
  return Status.OK_STATUS;
}

Fixed version (ground truth):
protected IStatus redo(){
  log.info(getText() + "String_Node_Str");
  String doc=redoActionTrack.get(getActionUndoPos());
  refresh(doc);
  return Status.OK_STATUS;
}
Program: 148332
Project: 148332
Buggy source:
/** 
 * need override by subclass
 * @return
 */
protected IStatus undo(){
  System.out.println(getText() + "String_Node_Str");
  String doc=undoActionTrack.get(getActionUndoPos() - 1);
  refresh(doc);
  return Status.OK_STATUS;
}

Fixed version (ground truth):
/** 
 * need override by subclass
 * @return
 */
protected IStatus undo(){
  log.info(getText() + "String_Node_Str");
  String doc=undoActionTrack.get(getActionUndoPos() - 1);
  refresh(doc);
  return Status.OK_STATUS;
}
Program: 148335
Project: 148335
Buggy source:
/** 
 * Dump the given events to "standard" output.
 * @param who who is dumping the event
 * @param e the event
 */
private void dump(String who,Event e){
  StringBuffer sb=new StringBuffer("String_Node_Str");
  sb.append(who);
  sb.append("String_Node_Str" + e.keyCode + hex(e.keyCode));
  sb.append("String_Node_Str" + e.character + hex(e.character));
  sb.append("String_Node_Str" + e.stateMask + hex(e.stateMask));
  sb.append("String_Node_Str" + e.doit);
  sb.append("String_Node_Str" + e.detail + hex(e.detail));
  sb.append("String_Node_Str" + e.widget);
  System.out.println(sb);
}

Fixed version (ground truth):
/** 
 * Dump the given events to "standard" output.
 * @param who who is dumping the event
 * @param e the event
 */
private void dump(String who,Event e){
  StringBuffer sb=new StringBuffer("String_Node_Str");
  sb.append(who);
  sb.append("String_Node_Str" + e.keyCode + hex(e.keyCode));
  sb.append("String_Node_Str" + e.character + hex(e.character));
  sb.append("String_Node_Str" + e.stateMask + hex(e.stateMask));
  sb.append("String_Node_Str" + e.doit);
  sb.append("String_Node_Str" + e.detail + hex(e.detail));
  sb.append("String_Node_Str" + e.widget);
  log.info(sb);
}
Program: 148336
Project: 148336
Buggy source:
private void addControlListener(Control control){
  if (DEBUG) {
    System.out.println("String_Node_Str");
  }
  if (controlListener != null) {
    return;
  }
  controlListener=new ProposalListener();
  Listener[] listeners=control.getListeners(SWT.KeyDown);
  for (  Listener lis : listeners) {
    if (lis instanceof ProposalListener)     control.removeListener(SWT.KeyDown,lis);
  }
  listeners=control.getListeners(SWT.KeyUp);
  for (  Listener lis : listeners) {
    if (lis instanceof ProposalListener)     control.removeListener(SWT.KeyUp,lis);
  }
  listeners=control.getListeners(SWT.Traverse);
  for (  Listener lis : listeners) {
    if (lis instanceof ProposalListener)     control.removeListener(SWT.Traverse,lis);
  }
  control.addListener(SWT.KeyDown,controlListener);
  control.addListener(SWT.KeyUp,controlListener);
  control.addListener(SWT.Traverse,controlListener);
  if (DEBUG) {
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
private void addControlListener(Control control){
  if (DEBUG) {
    log.info("String_Node_Str");
  }
  if (controlListener != null) {
    return;
  }
  controlListener=new ProposalListener();
  Listener[] listeners=control.getListeners(SWT.KeyDown);
  for (  Listener lis : listeners) {
    if (lis instanceof ProposalListener)     control.removeListener(SWT.KeyDown,lis);
  }
  listeners=control.getListeners(SWT.KeyUp);
  for (  Listener lis : listeners) {
    if (lis instanceof ProposalListener)     control.removeListener(SWT.KeyUp,lis);
  }
  listeners=control.getListeners(SWT.Traverse);
  for (  Listener lis : listeners) {
    if (lis instanceof ProposalListener)     control.removeListener(SWT.Traverse,lis);
  }
  control.addListener(SWT.KeyDown,controlListener);
  control.addListener(SWT.KeyUp,controlListener);
  control.addListener(SWT.Traverse,controlListener);
  if (DEBUG) {
    log.info("String_Node_Str");
  }
}
Program: 148342
Project: 148342
Buggy source:
public Object[] getChildren(Object parent){
  if (parent == null) {
    System.out.println("String_Node_Str");
    return new Object[0];
  }
  return findChildren(parent);
}

Fixed version (ground truth):
public Object[] getChildren(Object parent){
  if (parent == null) {
    log.info("String_Node_Str");
    return new Object[0];
  }
  return findChildren(parent);
}
Program: 148343
Project: 148343
Buggy source:
protected Image getImageForXSDComplexTypeDef_WrangStatus(XSDComplexTypeDefinition element){
  System.out.println("String_Node_Str" + element.getContent().getClass().getName());
  return ImageCache.getCreatedImage(EImage.ERROR.getPath());
}

Fixed version (ground truth):
protected Image getImageForXSDComplexTypeDef_WrangStatus(XSDComplexTypeDefinition element){
  log.info("String_Node_Str" + element.getContent().getClass().getName());
  return ImageCache.getCreatedImage(EImage.ERROR.getPath());
}
Program: 148344
Project: 148344
Buggy source:
protected Image getImageForXSDParticle_WrongStatus(XSDParticle element){
  System.out.println("String_Node_Str" + element.getTerm().getClass().getName());
  return ImageCache.getCreatedImage(EImage.ERROR.getPath());
}

Fixed version (ground truth):
protected Image getImageForXSDParticle_WrongStatus(XSDParticle element){
  log.info("String_Node_Str" + element.getTerm().getClass().getName());
  return ImageCache.getCreatedImage(EImage.ERROR.getPath());
}
Program: 148345
Project: 148345
Buggy source:
@Override public void run(){
  ISelection selection=view.getViewer().getSelection();
  TreeObject xobject=(TreeObject)((IStructuredSelection)selection).getFirstElement();
  this.page=view.getSite().getWorkbenchWindow().getActivePage();
  page.closeEditor(page.findEditor(new XObjectEditorInput(xobject,xobject.getDisplayName())),true);
  try {
    if (TreeObjectUtil.renameTreeOjects(xobject,view))     TreeObjectUtil.deleteTreeObject(xobject,view);
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  ISelection selection=view.getViewer().getSelection();
  TreeObject xobject=(TreeObject)((IStructuredSelection)selection).getFirstElement();
  this.page=view.getSite().getWorkbenchWindow().getActivePage();
  try {
    IEditorInput input=new XObjectEditorInput(xobject,xobject.getDisplayName());
    if (xobject.getType() == TreeObject.DATA_MODEL) {
      IFile pathToTempFile=XSDEditorUtil.createFile(xobject);
      input=new XSDEditorInput(pathToTempFile);
    }
    IEditorPart part=page.findEditor(input);
    page.closeEditor(part,true);
    if (TreeObjectUtil.renameTreeOjects(xobject,view))     TreeObjectUtil.deleteTreeObject(xobject,view);
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
}
Program: 148346
Project: 148346
Buggy source:
private void fillUIContentsInTxtName(){
  txtName.setText(complextType.getName());
}

Fixed version (ground truth):
private void fillUIContentsInTxtName(){
  txtName.setText(complextType.getName() == null ? "String_Node_Str" : complextType.getName());
}
Program: 148347
Project: 148347
Buggy source:
private void initUIContentForTxtName(){
  txtName.setText(xsdSimpleType.getName());
}

Fixed version (ground truth):
private void initUIContentForTxtName(){
  txtName.setText(xsdSimpleType.getName() == null ? "String_Node_Str" : xsdSimpleType.getName());
}
Program: 148348
Project: 148348
Buggy source:
@Override public IStatus run(IProgressMonitor monitor){
  try {
    monitor.beginTask("String_Node_Str" + dataCluster + "String_Node_Str",IProgressMonitor.UNKNOWN);
    monitor.done();
    return Status.OK_STATUS;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return Status.CANCEL_STATUS;
  }
}

Fixed version (ground truth):
@Override public IStatus run(IProgressMonitor monitor){
  try {
    monitor.beginTask("String_Node_Str" + dataCluster + "String_Node_Str",IProgressMonitor.UNKNOWN);
    monitor.done();
    return Status.OK_STATUS;
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
    return Status.CANCEL_STATUS;
  }
}
Program: 148349
Project: 148349
Buggy source:
@Override protected void okPressed(){
  if (comboDataCluster.getCombo().getText().trim().length() == 0) {
    MessageDialog.openError(null,"String_Node_Str","String_Node_Str");
    comboDataCluster.getCombo().setFocus();
    return;
  }
  if (fw.getText().getText().trim().length() == 0) {
    MessageDialog.openError(null,"String_Node_Str","String_Node_Str");
    fw.getText().setFocus();
    return;
  }
  String url=xObject.getServerRoot().getEndpointAddress();
  server=null;
  try {
    server=new URL(url).getHost();
  }
 catch (  MalformedURLException e1) {
    e1.printStackTrace();
  }
  dataCluster=comboDataCluster.getCombo().getText();
  dataCluster=xpathMap.get(dataCluster);
  filename=fw.getText().getText().trim();
  Job job=new Job("String_Node_Str" + dataCluster + "String_Node_Str"){
    @Override public IStatus run(    IProgressMonitor monitor){
      try {
        monitor.beginTask("String_Node_Str" + dataCluster + "String_Node_Str",IProgressMonitor.UNKNOWN);
        monitor.done();
        return Status.OK_STATUS;
      }
 catch (      Exception e) {
        e.printStackTrace();
        return Status.CANCEL_STATUS;
      }
    }
  }
;
  job.setPriority(Job.INTERACTIVE);
  job.schedule();
  super.okPressed();
}

Fixed version (ground truth):
@Override protected void okPressed(){
  if (comboDataCluster.getCombo().getText().trim().length() == 0) {
    MessageDialog.openError(null,"String_Node_Str","String_Node_Str");
    comboDataCluster.getCombo().setFocus();
    return;
  }
  if (fw.getText().getText().trim().length() == 0) {
    MessageDialog.openError(null,"String_Node_Str","String_Node_Str");
    fw.getText().setFocus();
    return;
  }
  String url=xObject.getServerRoot().getEndpointAddress();
  server=null;
  try {
    server=new URL(url).getHost();
  }
 catch (  MalformedURLException e1) {
    log.error(e1.getMessage(),e1);
  }
  dataCluster=comboDataCluster.getCombo().getText();
  dataCluster=xpathMap.get(dataCluster);
  filename=fw.getText().getText().trim();
  Job job=new Job("String_Node_Str" + dataCluster + "String_Node_Str"){
    @Override public IStatus run(    IProgressMonitor monitor){
      try {
        monitor.beginTask("String_Node_Str" + dataCluster + "String_Node_Str",IProgressMonitor.UNKNOWN);
        monitor.done();
        return Status.OK_STATUS;
      }
 catch (      Exception e) {
        log.error(e.getMessage(),e);
        return Status.CANCEL_STATUS;
      }
    }
  }
;
  job.setPriority(Job.INTERACTIVE);
  job.schedule();
  super.okPressed();
}
Program: 148350
Project: 148350
Buggy source:
public ImportItemsWizard(IStructuredSelection sel,ServerView view){
  this.sel=sel;
  this.view=view;
  serverRoot=((TreeObject)sel.getFirstElement()).getServerRoot();
  try {
    port=Util.getPort((TreeObject)sel.getFirstElement());
  }
 catch (  XtentisException e3) {
    e3.printStackTrace();
  }
}

Fixed version (ground truth):
public ImportItemsWizard(IStructuredSelection sel,ServerView view){
  this.sel=sel;
  this.view=view;
  serverRoot=((TreeObject)sel.getFirstElement()).getServerRoot();
  try {
    port=Util.getPort((TreeObject)sel.getFirstElement());
  }
 catch (  XtentisException e3) {
    log.error(e3.getMessage(),e3);
  }
}
Program: 148351
Project: 148351
Buggy source:
public void widgetSelected(SelectionEvent e){
  String msg=getContentsCheckResult();
  boolean isok=msg.equals(CHECKMSG_SUCCESSFULCONN);
  errorLabel.setForeground(isok ? errorLabel.getDisplay().getSystemColor(SWT.COLOR_BLUE) : errorLabel.getDisplay().getSystemColor(SWT.COLOR_RED));
  errorLabel.setText(msg);
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  String msg=getContentsCheckResult();
  errorLabel.setForeground(CHECKMSG_SUCCESSFULCONN.equals(msg) ? errorLabel.getDisplay().getSystemColor(SWT.COLOR_BLUE) : errorLabel.getDisplay().getSystemColor(SWT.COLOR_RED));
  errorLabel.setText(msg);
}
Program: 148354
Project: 148354
Buggy source:
private void setAnnotationActions2(Object obj,IMenuManager manager){
  if (obj instanceof XSDElementDeclaration) {
    manager.add(setAnnotationLabelAction);
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLookupFieldsAction);
    manager.add(setAnnotationPrimaryKeyInfoAction);
  }
  if (obj instanceof XSDParticle) {
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLabelAction);
  }
  if (Util.IsEnterPrise()) {
    manager.add(new Separator());
    manager.add(setAnnotationWriteAction);
    manager.add(setAnnotationNoAction);
    if (obj instanceof XSDParticle) {
      manager.add(visibleRuleAction);
      manager.add(defaultValueRuleAction);
    }
  }
  java.util.List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
  for (int i=0; i < availablemodels.size(); i++) {
    IAvailableModel model=availablemodels.get(i);
    model.fillContextMenu(obj,manager,this,dataModelName);
    if (i == 0) {
      manager.add(new Separator());
    }
  }
}

Fixed version (ground truth):
private void setAnnotationActions2(Object obj,IMenuManager manager){
  if (obj instanceof XSDElementDeclaration) {
    manager.add(setAnnotationLabelAction);
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLookupFieldsAction);
    manager.add(setAnnotationPrimaryKeyInfoAction);
  }
  if (obj instanceof XSDParticle) {
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLabelAction);
  }
  if (Util.IsEnterPrise()) {
    manager.add(new Separator());
    manager.add(setAnnotationWriteAction);
    manager.add(setAnnotationNoAction);
    if (obj instanceof XSDParticle) {
      manager.add(visibleRuleAction);
      manager.add(defaultValueRuleAction);
    }
  }
  java.util.List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
  for (int i=0; i < availablemodels.size(); i++) {
    IAvailableModel model=availablemodels.get(i);
    model.fillContextMenu(obj,manager,this,dataModelName);
    if (i == 1) {
      manager.add(new Separator());
    }
  }
}