nus-yam/ex-repair huggingface dataset:
Program: 148564
Project: 148564
Buggy source:
public void addChild(TreeObject child){
  if (child != null) {
    children.remove(child);
    children.add(child);
    child.setParent(this);
    child.fireEvent(IXObjectModelListener.ADD,this,child);
  }
  LocalTreeObjectRepository.getInstance().correctDisplayNameForCategory(child);
}

Fixed version (ground truth):
public void addChild(TreeObject child,boolean isMergeCategory){
  if (child != null) {
    children.remove(child);
    children.add(child);
    child.setParent(this);
    if (isMergeCategory)     child.fireEvent(IXObjectModelListener.ADD,this,child);
  }
  if (isMergeCategory)   LocalTreeObjectRepository.getInstance().correctDisplayNameForCategory(child);
}
Program: 148565
Project: 148565
Buggy source:
private void hookTypesContextMenu(){
  typesMenuMgr=new MenuManager();
  typesMenuMgr.setRemoveAllWhenShown(true);
  typesMenuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      DataModelMainPage.this.fillTypesContextMenu(manager);
    }
  }
);
  Menu menu=typesMenuMgr.createContextMenu(typesViewer.getControl());
  typesViewer.getControl().setMenu(menu);
  getSite().registerContextMenu(typesMenuMgr,typesViewer);
}

Fixed version (ground truth):
private void hookTypesContextMenu(){
  typesMenuMgr=new MenuManager();
  typesMenuMgr.setRemoveAllWhenShown(true);
  typesMenuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      DataModelMainPage.this.fillContextMenu(manager,true);
    }
  }
);
  Menu menu=typesMenuMgr.createContextMenu(typesViewer.getControl());
  typesViewer.getControl().setMenu(menu);
  getSite().registerContextMenu(typesMenuMgr,typesViewer);
}
Program: 148566
Project: 148566
Buggy source:
private void hookContextMenu(){
  menuMgr=new MenuManager();
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      DataModelMainPage.this.fillContextMenu(manager);
    }
  }
);
  Menu menu=menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuMgr,viewer);
}

Fixed version (ground truth):
private void hookContextMenu(){
  menuMgr=new MenuManager();
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      DataModelMainPage.this.fillContextMenu(manager,false);
    }
  }
);
  Menu menu=menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
  getSite().registerContextMenu(menuMgr,viewer);
}
Program: 148567
Project: 148567
Buggy source:
public void menuAboutToShow(IMenuManager manager){
  DataModelMainPage.this.fillTypesContextMenu(manager);
}

Fixed version (ground truth):
public void menuAboutToShow(IMenuManager manager){
  DataModelMainPage.this.fillContextMenu(manager,true);
}
Program: 148570
Project: 148570
Buggy source:
private void changeDomTree(final TreeParent pObject){
  String modelDisplay=dataModelCombo.getText();
  if (modelDisplay.length() == 0)   return;
  this.dataModelName=modelDisplay;
  XtentisPort port=null;
  try {
    port=Util.getPort(pObject);
  }
 catch (  XtentisException e3) {
    e3.printStackTrace();
  }
catch (  Exception e3) {
    e3.printStackTrace();
  }
  WSDataModel wsDataModel=null;
  try {
    wsDataModel=port.getDataModel(new WSGetDataModel(new WSDataModelPK(dataModelName)));
  }
 catch (  RemoteException e2) {
    e2.printStackTrace();
  }
  try {
    XSDSchema xsdSchema=Util.getXSDSchema(wsDataModel.getXsdSchema());
    String schema=Util.nodeToString(xsdSchema.getDocument());
    XSDSchema xsd=Util.createXsdSchema(schema,pObject);
    provideViwerContent(xsd);
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
private void changeDomTree(final TreeParent pObject){
  String modelDisplay=dataModelCombo.getText();
  if (modelDisplay.length() == 0)   return;
  this.dataModelName=modelDisplay;
  XtentisPort port=null;
  try {
    port=Util.getPort(pObject);
  }
 catch (  XtentisException e3) {
    e3.printStackTrace();
  }
catch (  Exception e3) {
    e3.printStackTrace();
  }
  WSDataModel wsDataModel=null;
  try {
    wsDataModel=port.getDataModel(new WSGetDataModel(new WSDataModelPK(dataModelName)));
  }
 catch (  RemoteException e2) {
    e2.printStackTrace();
  }
  try {
    String schema=wsDataModel.getXsdSchema();
    XSDSchema xsd=Util.createXsdSchema(schema,pObject);
    provideViwerContent(xsd);
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}
Program: 148572
Project: 148572
Buggy source:
private void changeDomTree(final TreeParent pObject){
  String modelDisplay=dataModelCombo.getText();
  if (modelDisplay.length() == 0)   return;
  this.dataModelName=modelDisplay;
  XtentisPort port=null;
  try {
    port=Util.getPort(pObject);
  }
 catch (  XtentisException e3) {
    e3.printStackTrace();
  }
catch (  Exception e3) {
    e3.printStackTrace();
  }
  WSDataModel wsDataModel=null;
  try {
    wsDataModel=port.getDataModel(new WSGetDataModel(new WSDataModelPK(dataModelName)));
  }
 catch (  RemoteException e2) {
    e2.printStackTrace();
  }
  try {
    XSDSchema xsdSchema=Util.getXSDSchema(wsDataModel.getXsdSchema());
    String schema=Util.nodeToString(xsdSchema.getDocument());
    XSDSchema xsd=Util.createXsdSchema(schema,pObject);
    provideViwerContent(xsd);
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
private void changeDomTree(final TreeParent pObject){
  String modelDisplay=dataModelCombo.getText();
  if (modelDisplay.length() == 0)   return;
  this.dataModelName=modelDisplay;
  XtentisPort port=null;
  try {
    port=Util.getPort(pObject);
  }
 catch (  XtentisException e3) {
    e3.printStackTrace();
  }
catch (  Exception e3) {
    e3.printStackTrace();
  }
  WSDataModel wsDataModel=null;
  try {
    wsDataModel=port.getDataModel(new WSGetDataModel(new WSDataModelPK(dataModelName)));
  }
 catch (  RemoteException e2) {
    e2.printStackTrace();
  }
  try {
    String schema=wsDataModel.getXsdSchema();
    XSDSchema xsd=Util.createXsdSchema(schema,pObject);
    provideViwerContent(xsd);
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}
Program: 148573
Project: 148573
Buggy source:
public static String getDataModelName(){
  return dataModelName;
}

Fixed version (ground truth):
public String getDataModelName(){
  return dataModelName;
}
Program: 148575
Project: 148575
Buggy source:
public static String formatXsdSource(String xsdSource){
  try {
    SAXReader reader=new SAXReader();
    org.dom4j.Document document=reader.read(new StringReader(xsdSource));
    StringWriter writer=new StringWriter();
    OutputFormat format=OutputFormat.createPrettyPrint();
    format.setEncoding("String_Node_Str");
    XMLWriter xmlwriter=new XMLWriter(writer,format);
    xmlwriter.write(document);
    return writer.toString();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return xsdSource;
}

Fixed version (ground truth):
public static String formatXsdSource(String xsdSource){
  try {
    SAXReader reader=new SAXReader();
    org.dom4j.Document document=reader.read(new StringReader(xsdSource));
    StringWriter writer=new StringWriter();
    OutputFormat format=OutputFormat.createPrettyPrint();
    format.setEncoding("String_Node_Str");
    XMLWriter xmlwriter=new XMLWriter(writer,format);
    xmlwriter.write(document);
    String str=writer.toString();
    writer.close();
    xmlwriter.close();
    return str;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return xsdSource;
}
Program: 148576
Project: 148576
Buggy source:
/** 
 * Returns and XSDSchema Object from an xsd
 * @param schema
 * @return
 * @throws Exception
 */
public static XSDSchema getXSDSchema(String schema) throws Exception {
  DocumentBuilderFactory documentBuilderFactory=DocumentBuilderFactory.newInstance();
  documentBuilderFactory.setNamespaceAware(true);
  documentBuilderFactory.setValidating(false);
  InputSource source=new InputSource(new StringReader(schema));
  DocumentBuilder documentBuilder=documentBuilderFactory.newDocumentBuilder();
  Document document=documentBuilder.parse(source);
  XSDSchema xsdSchema=null;
  xsdSchema=XSDSchemaImpl.createSchema(document.getDocumentElement());
  return xsdSchema;
}

Fixed version (ground truth):
/** 
 * Returns and XSDSchema Object from an xsd
 * @param schema
 * @return
 * @throws Exception
 */
public static XSDSchema getXSDSchema(String schema) throws Exception {
  DocumentBuilderFactory documentBuilderFactory=DocumentBuilderFactory.newInstance();
  documentBuilderFactory.setNamespaceAware(true);
  documentBuilderFactory.setValidating(false);
  StringReader reader=new StringReader(schema);
  InputSource source=new InputSource(new StringReader(schema));
  DocumentBuilder documentBuilder=documentBuilderFactory.newDocumentBuilder();
  Document document=documentBuilder.parse(source);
  XSDSchema xsdSchema=null;
  xsdSchema=XSDSchemaImpl.createSchema(document.getDocumentElement());
  reader.close();
  return xsdSchema;
}
Program: 148577
Project: 148577
Buggy source:
protected void markDirty(){
  if (mainPage != null) {
    mainPage.markDirty();
  }
  for (  Object obj : modifyList.getListeners()) {
    if (obj instanceof ITableModifyListener) {
      ((ITableModifyListener)obj).handleEvent((List<Line>)getViewer().getInput());
    }
  }
}

Fixed version (ground truth):
protected void markDirty(){
  if (mainPage != null) {
    mainPage.markDirtyWithoutCommit();
  }
  for (  Object obj : modifyList.getListeners()) {
    if (obj instanceof ITableModifyListener) {
      ((ITableModifyListener)obj).handleEvent((List<Line>)getViewer().getInput());
    }
  }
}
Program: 148578
Project: 148578
Buggy source:
@Override protected Control createControl(Composite parent){
  if (mainPage != null)   xpath=new XpathWidget(parent,mainPage,false);
 else   xpath=new XpathWidget(parent,false);
  xpaths.add(xpath);
  xpath.setConceptName(conceptName);
  ((GridData)xpath.getComposite().getChildren()[0].getLayoutData()).heightHint=15;
  ((GridData)xpath.getComposite().getChildren()[1].getLayoutData()).heightHint=15;
  if (parent instanceof Table) {
    ((Table)parent).addMouseListener(new MouseListener(){
      public void mouseDoubleClick(      MouseEvent e){
      }
      public void mouseDown(      MouseEvent e){
      }
      public void mouseUp(      MouseEvent e){
        if (!isMouseInControl(e)) {
          deactive();
        }
      }
    }
);
    xpath.getTextWidget().addKeyListener(new KeyListener(){
      public void keyPressed(      KeyEvent e){
      }
      public void keyReleased(      KeyEvent e){
        if (e.character == SWT.CR) {
          xpath.setText(xpath.getText().trim());
          deactive();
        }
      }
    }
);
  }
  return xpath.getComposite();
}

Fixed version (ground truth):
@Override protected Control createControl(Composite parent){
  if (mainPage != null)   xpath=new XpathWidget(parent,mainPage,false);
 else   xpath=new XpathWidget(parent,false);
  xpaths.add(xpath);
  xpath.setConceptName(conceptName);
  xpath.setDataModelName(datamodelName);
  ((GridData)xpath.getComposite().getChildren()[0].getLayoutData()).heightHint=15;
  ((GridData)xpath.getComposite().getChildren()[1].getLayoutData()).heightHint=15;
  if (parent instanceof Table) {
    ((Table)parent).addMouseListener(new MouseListener(){
      public void mouseDoubleClick(      MouseEvent e){
      }
      public void mouseDown(      MouseEvent e){
      }
      public void mouseUp(      MouseEvent e){
        if (!isMouseInControl(e)) {
          deactive();
        }
      }
    }
);
    xpath.getTextWidget().addKeyListener(new KeyListener(){
      public void keyPressed(      KeyEvent e){
      }
      public void keyReleased(      KeyEvent e){
        if (e.character == SWT.CR) {
          xpath.setText(xpath.getText().trim());
          deactive();
        }
      }
    }
);
  }
  return xpath.getComposite();
}
Program: 148583
Project: 148583
Buggy source:
private void editMinInclusive(){
  XSDMinInclusiveFacet currentValue=std.getMinInclusiveFacet();
  String stringValue="String_Node_Str";
  if (currentValue != null)   stringValue=currentValue.getLexicalValue();
  dialog=new InputDialog(page.getSite().getShell(),"String_Node_Str","String_Node_Str",stringValue == null ? "String_Node_Str" : stringValue,new IInputValidator(){
    public String isValid(    String newText){
      double val;
      try {
        val=Double.parseDouble(newText);
      }
 catch (      Exception e) {
        return "String_Node_Str";
      }
      if (val < 0)       return "String_Node_Str";
      return null;
    }
  }
);
  dialog.setBlockOnOpen(true);
  int ret=dialog.open();
  if (ret == Dialog.CANCEL)   return;
  if (currentValue != null)   std.getFacetContents().remove(currentValue);
  double intValue=Double.parseDouble(((InputDialog)dialog).getValue());
  if (intValue > 0) {
    XSDMinInclusiveFacet f=(XSDSchemaBuildingTools.getXSDFactory()).createXSDMinInclusiveFacet();
    f.setLexicalValue("String_Node_Str" + intValue);
    std.getFacetContents().add(f);
  }
}

Fixed version (ground truth):
private void editMinInclusive(){
  XSDMinInclusiveFacet currentValue=std.getMinInclusiveFacet();
  String stringValue="String_Node_Str";
  if (currentValue != null)   stringValue=currentValue.getLexicalValue();
  dialog=new InputDialog(page.getSite().getShell(),"String_Node_Str","String_Node_Str",stringValue == null ? "String_Node_Str" : stringValue,new IInputValidator(){
    public String isValid(    String newText){
      double val;
      try {
        val=Double.parseDouble(newText);
      }
 catch (      Exception e) {
        return "String_Node_Str";
      }
      if (val < 0)       return "String_Node_Str";
      return null;
    }
  }
);
  dialog.setBlockOnOpen(true);
  int ret=dialog.open();
  if (ret == Dialog.CANCEL)   return;
  if (currentValue != null)   std.getFacetContents().remove(currentValue);
  int intValue=Integer.parseInt(((InputDialog)dialog).getValue());
  if (intValue > 0) {
    XSDMinInclusiveFacet f=(XSDSchemaBuildingTools.getXSDFactory()).createXSDMinInclusiveFacet();
    f.setLexicalValue("String_Node_Str" + intValue);
    std.getFacetContents().add(f);
  }
}
Program: 148584
Project: 148584
Buggy source:
private void editMinExclusive(){
  XSDMinExclusiveFacet currentValue=std.getMinExclusiveFacet();
  String stringValue="String_Node_Str";
  if (currentValue != null)   stringValue=currentValue.getLexicalValue();
  dialog=new InputDialog(page.getSite().getShell(),"String_Node_Str","String_Node_Str",stringValue == null ? "String_Node_Str" : stringValue,new IInputValidator(){
    public String isValid(    String newText){
      double val;
      try {
        val=Double.parseDouble(newText);
      }
 catch (      Exception e) {
        return "String_Node_Str";
      }
      if (val < 0)       return "String_Node_Str";
      return null;
    }
  }
);
  dialog.setBlockOnOpen(true);
  int ret=dialog.open();
  if (ret == Dialog.CANCEL)   return;
  if (currentValue != null)   std.getFacetContents().remove(currentValue);
  double intValue=Double.parseDouble(((InputDialog)dialog).getValue());
  if (intValue > 0) {
    XSDMinExclusiveFacet f=(XSDSchemaBuildingTools.getXSDFactory()).createXSDMinExclusiveFacet();
    f.setLexicalValue("String_Node_Str" + intValue);
    std.getFacetContents().add(f);
  }
}

Fixed version (ground truth):
private void editMinExclusive(){
  XSDMinExclusiveFacet currentValue=std.getMinExclusiveFacet();
  String stringValue="String_Node_Str";
  if (currentValue != null)   stringValue=currentValue.getLexicalValue();
  dialog=new InputDialog(page.getSite().getShell(),"String_Node_Str","String_Node_Str",stringValue == null ? "String_Node_Str" : stringValue,new IInputValidator(){
    public String isValid(    String newText){
      double val;
      try {
        val=Double.parseDouble(newText);
      }
 catch (      Exception e) {
        return "String_Node_Str";
      }
      if (val < 0)       return "String_Node_Str";
      return null;
    }
  }
);
  dialog.setBlockOnOpen(true);
  int ret=dialog.open();
  if (ret == Dialog.CANCEL)   return;
  if (currentValue != null)   std.getFacetContents().remove(currentValue);
  int intValue=Integer.parseInt(((InputDialog)dialog).getValue());
  if (intValue > 0) {
    XSDMinExclusiveFacet f=(XSDSchemaBuildingTools.getXSDFactory()).createXSDMinExclusiveFacet();
    f.setLexicalValue("String_Node_Str" + intValue);
    std.getFacetContents().add(f);
  }
}
Program: 148585
Project: 148585
Buggy source:
private void editMaxInclusive(){
  XSDMaxInclusiveFacet currentValue=std.getMaxInclusiveFacet();
  String stringValue="String_Node_Str";
  if (currentValue != null)   stringValue=currentValue.getLexicalValue();
  dialog=new InputDialog(page.getSite().getShell(),"String_Node_Str","String_Node_Str",stringValue == null ? "String_Node_Str" : stringValue,new IInputValidator(){
    public String isValid(    String newText){
      double val;
      try {
        val=Double.parseDouble(newText);
      }
 catch (      Exception e) {
        return "String_Node_Str";
      }
      if (val < 0)       return "String_Node_Str";
      return null;
    }
  }
);
  dialog.setBlockOnOpen(true);
  int ret=dialog.open();
  if (ret == Dialog.CANCEL)   return;
  if (currentValue != null)   std.getFacetContents().remove(currentValue);
  double intValue=Double.parseDouble(((InputDialog)dialog).getValue());
  if (intValue > 0) {
    XSDMaxInclusiveFacet f=(XSDSchemaBuildingTools.getXSDFactory()).createXSDMaxInclusiveFacet();
    f.setLexicalValue("String_Node_Str" + intValue);
    std.getFacetContents().add(f);
  }
}

Fixed version (ground truth):
private void editMaxInclusive(){
  XSDMaxInclusiveFacet currentValue=std.getMaxInclusiveFacet();
  String stringValue="String_Node_Str";
  if (currentValue != null)   stringValue=currentValue.getLexicalValue();
  dialog=new InputDialog(page.getSite().getShell(),"String_Node_Str","String_Node_Str",stringValue == null ? "String_Node_Str" : stringValue,new IInputValidator(){
    public String isValid(    String newText){
      double val;
      try {
        val=Double.parseDouble(newText);
      }
 catch (      Exception e) {
        return "String_Node_Str";
      }
      if (val < 0)       return "String_Node_Str";
      return null;
    }
  }
);
  dialog.setBlockOnOpen(true);
  int ret=dialog.open();
  if (ret == Dialog.CANCEL)   return;
  if (currentValue != null)   std.getFacetContents().remove(currentValue);
  int intValue=Integer.parseInt(((InputDialog)dialog).getValue());
  if (intValue > 0) {
    XSDMaxInclusiveFacet f=(XSDSchemaBuildingTools.getXSDFactory()).createXSDMaxInclusiveFacet();
    f.setLexicalValue("String_Node_Str" + intValue);
    std.getFacetContents().add(f);
  }
}
Program: 148586
Project: 148586
Buggy source:
private void editMaxExclusive(){
  XSDMaxExclusiveFacet currentValue=std.getMaxExclusiveFacet();
  String stringValue="String_Node_Str";
  if (currentValue != null)   stringValue=currentValue.getLexicalValue();
  dialog=new InputDialog(page.getSite().getShell(),"String_Node_Str","String_Node_Str",stringValue == null ? "String_Node_Str" : stringValue,new IInputValidator(){
    public String isValid(    String newText){
      double val;
      try {
        val=Double.parseDouble(newText);
      }
 catch (      Exception e) {
        return "String_Node_Str";
      }
      if (val < 0)       return "String_Node_Str";
      return null;
    }
  }
);
  dialog.setBlockOnOpen(true);
  int ret=dialog.open();
  if (ret == Dialog.CANCEL)   return;
  if (currentValue != null)   std.getFacetContents().remove(currentValue);
  double intValue=Double.parseDouble(((InputDialog)dialog).getValue());
  if (intValue > 0) {
    XSDMaxExclusiveFacet f=(XSDSchemaBuildingTools.getXSDFactory()).createXSDMaxExclusiveFacet();
    f.setLexicalValue("String_Node_Str" + intValue);
    std.getFacetContents().add(f);
  }
}

Fixed version (ground truth):
private void editMaxExclusive(){
  XSDMaxExclusiveFacet currentValue=std.getMaxExclusiveFacet();
  String stringValue="String_Node_Str";
  if (currentValue != null)   stringValue=currentValue.getLexicalValue();
  dialog=new InputDialog(page.getSite().getShell(),"String_Node_Str","String_Node_Str",stringValue == null ? "String_Node_Str" : stringValue,new IInputValidator(){
    public String isValid(    String newText){
      double val;
      try {
        val=Double.parseDouble(newText);
      }
 catch (      Exception e) {
        return "String_Node_Str";
      }
      if (val < 0)       return "String_Node_Str";
      return null;
    }
  }
);
  dialog.setBlockOnOpen(true);
  int ret=dialog.open();
  if (ret == Dialog.CANCEL)   return;
  if (currentValue != null)   std.getFacetContents().remove(currentValue);
  int intValue=Integer.parseInt(((InputDialog)dialog).getValue());
  if (intValue > 0) {
    XSDMaxExclusiveFacet f=(XSDSchemaBuildingTools.getXSDFactory()).createXSDMaxExclusiveFacet();
    f.setLexicalValue("String_Node_Str" + intValue);
    std.getFacetContents().add(f);
  }
}
Program: 148587
Project: 148587
Buggy source:
public void keyPressed(KeyEvent e){
  ISelection selection=ServerView.this.getViewer().getSelection();
  TreeObject xo=(TreeObject)((IStructuredSelection)selection).getFirstElement();
  if ((e.stateMask == 0) && (e.keyCode == SWT.DEL)) {
switch (xo.getType()) {
case TreeObject.DATA_MODEL:
      if (xo.getParent().getType() == TreeObject.DATA_MODEL) {
        deleteXObjectAction.run();
      }
    break;
default :
  return;
}
}
}

Fixed version (ground truth):
public void keyPressed(KeyEvent e){
  ISelection selection=ServerView.this.getViewer().getSelection();
  TreeObject xo=(TreeObject)((IStructuredSelection)selection).getFirstElement();
  if ((e.stateMask == 0) && (e.keyCode == SWT.DEL)) {
switch (xo.getType()) {
case TreeObject.JOB:
      new DeleteJobAction().run();
    break;
default :
  deleteXObjectAction.run();
return;
}
}
}
Program: 148588
Project: 148588
Buggy source:
private void hookKeyPressAction(){
  viewer.getTree().addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
      ISelection selection=ServerView.this.getViewer().getSelection();
      TreeObject xo=(TreeObject)((IStructuredSelection)selection).getFirstElement();
      if ((e.stateMask == 0) && (e.keyCode == SWT.DEL)) {
switch (xo.getType()) {
case TreeObject.DATA_MODEL:
          if (xo.getParent().getType() == TreeObject.DATA_MODEL) {
            deleteXObjectAction.run();
          }
        break;
default :
      return;
  }
}
}
public void keyReleased(KeyEvent e){
}
}
);
}

Fixed version (ground truth):
private void hookKeyPressAction(){
  viewer.getTree().addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
      ISelection selection=ServerView.this.getViewer().getSelection();
      TreeObject xo=(TreeObject)((IStructuredSelection)selection).getFirstElement();
      if ((e.stateMask == 0) && (e.keyCode == SWT.DEL)) {
switch (xo.getType()) {
case TreeObject.JOB:
          new DeleteJobAction().run();
        break;
default :
      deleteXObjectAction.run();
    return;
}
}
}
public void keyReleased(KeyEvent e){
if (e.keyCode == 'c' && e.stateMask == SWT.CTRL) {
copyAction.run();
}
 else if (e.keyCode == 'v' && e.stateMask == SWT.CTRL) {
TreeObject xobject=(TreeObject)((IStructuredSelection)viewer.getSelection()).getFirstElement();
((PasteXObjectAction)pasteAction).setXtentisPort(xobject);
((PasteXObjectAction)pasteAction).setParent(xobject instanceof TreeParent ? (TreeParent)xobject : xobject.getParent());
pasteAction.run();
}
}
}
);
}
Program: 148589
Project: 148589
Buggy source:
/** 
 * This is a callback that will allow us to create the viewer and initialize it.
 */
public void createPartControl(Composite parent){
  viewer=createTreeViewer(parent);
  drillDownAdapter=new DrillDownAdapter(viewer);
  contentProvider=new ServerTreeContentProvider(this.getSite(),new TreeParent("String_Node_Str",null,TreeObject._ROOT_,null,null));
  setTreeContentProvider(contentProvider);
  viewer.setLabelProvider(new ServerTreeLabelProvider());
  viewer.setSorter(new ViewerSorter(){
    public int category(    Object element){
      if (element instanceof TreeParent) {
        TreeParent category=(TreeParent)element;
        if (category.getType() == TreeObject.CATEGORY_FOLDER)         return -1;
      }
      return 0;
    }
  }
);
  viewer.setInput(getViewSite());
  viewer.getTree().addTreeListener(new TreeListener(){
    public void treeExpanded(    TreeEvent event){
      if (event.item.getData() instanceof TreeParent && ((TreeParent)event.item.getData()).getType() == TreeObject._SERVER_ && ((TreeParent)event.item.getData()).getChildrenList().size() == 1) {
        initServer((TreeParent)event.item.getData());
      }
    }
    public void treeCollapsed(    TreeEvent e){
    }
  }
);
  createTreeDragSource();
  createTreeDropTarget();
  makeActions();
  hookContextMenu();
  hookDoubleClickAction();
  hookKeyPressAction();
  contributeToActionBars();
  hookKeyboard();
  initView();
}

Fixed version (ground truth):
/** 
 * This is a callback that will allow us to create the viewer and initialize it.
 */
public void createPartControl(Composite parent){
  viewer=createTreeViewer(parent);
  drillDownAdapter=new DrillDownAdapter(viewer);
  contentProvider=new ServerTreeContentProvider(this.getSite(),new TreeParent("String_Node_Str",null,TreeObject._ROOT_,null,null));
  setTreeContentProvider(contentProvider);
  viewer.setLabelProvider(new ServerTreeLabelProvider());
  viewer.setSorter(new ViewerSorter(){
    public int category(    Object element){
      if (element instanceof TreeParent) {
        TreeParent category=(TreeParent)element;
        if (category.getType() == TreeObject.CATEGORY_FOLDER)         return -1;
      }
      return 0;
    }
  }
);
  viewer.setInput(getViewSite());
  viewer.getTree().addTreeListener(new TreeListener(){
    public void treeExpanded(    TreeEvent event){
      if (event.item.getData() instanceof TreeParent && ((TreeParent)event.item.getData()).getType() == TreeObject._SERVER_ && ((TreeParent)event.item.getData()).getChildrenList().size() == 1) {
        initServer((TreeParent)event.item.getData());
      }
    }
    public void treeCollapsed(    TreeEvent e){
    }
  }
);
  createTreeDragSource();
  createTreeDropTarget();
  makeActions();
  hookContextMenu();
  hookDoubleClickAction();
  hookKeyPressAction();
  contributeToActionBars();
  initView();
}
Program: 148590
Project: 148590
Buggy source:
public void keyReleased(KeyEvent e){
}

Fixed version (ground truth):
public void keyReleased(KeyEvent e){
  if (e.keyCode == 'c' && e.stateMask == SWT.CTRL) {
    copyAction.run();
  }
 else   if (e.keyCode == 'v' && e.stateMask == SWT.CTRL) {
    TreeObject xobject=(TreeObject)((IStructuredSelection)viewer.getSelection()).getFirstElement();
    ((PasteXObjectAction)pasteAction).setXtentisPort(xobject);
    ((PasteXObjectAction)pasteAction).setParent(xobject instanceof TreeParent ? (TreeParent)xobject : xobject.getParent());
    pasteAction.run();
  }
}
Program: 148591
Project: 148591
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  try {
    monitor.beginTask("String_Node_Str",toAddViewableList.size());
    for (Iterator<String> iter=toAddViewableList.iterator(); iter.hasNext(); ) {
      String[] keyPath=new String[]{iter.next()};
      Line line=new Line(viewableElementColumns,keyPath);
      java.util.List<Line> vlines=(java.util.List<Line>)viewableViewer.getViewer().getInput();
      vlines.add(line);
      commit();
      monitor.worked(1);
    }
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(parentShell,"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  try {
    monitor.beginTask("String_Node_Str",toAddViewableList.size());
    for (Iterator<String> iter=toAddViewableList.iterator(); iter.hasNext(); ) {
      String[] keyPath=new String[]{iter.next()};
      Line line=new Line(viewableElementColumns,keyPath);
      java.util.List<Line> vlines=(java.util.List<Line>)viewableViewer.getViewer().getInput();
      vlines.add(line);
      commit();
      monitor.worked(1);
    }
    viewableViewer.getViewer().refresh();
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(parentShell,"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 148592
Project: 148592
Buggy source:
@Override public boolean beforeDoSave(){
  if (desAntionComposite.getText().trim().equals("String_Node_Str")) {
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str");
    return false;
  }
  WSView wsObject=(WSView)(getWsViewObject());
  if (wsObject.getSearchableBusinessElements().length == 0) {
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean beforeDoSave(){
  if (desAntionComposite.getText().trim().equals("String_Node_Str")) {
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str");
    return false;
  }
  java.util.List<Line> input=(java.util.List<Line>)searchableViewer.getViewer().getInput();
  if (input != null && input.size() == 0) {
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str");
    return false;
  }
  return true;
}
Program: 148593
Project: 148593
Buggy source:
private void setAnnotationActions2(Object obj,IMenuManager manager){
  if (obj instanceof XSDElementDeclaration) {
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLookupFieldsAction);
  }
  if (obj instanceof XSDParticle) {
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLabelAction);
  }
  if (Util.IsEnterPrise()) {
    manager.add(setAnnotationWriteAction);
    if (checkMandatoryElement(obj))     manager.add(setAnnotationNoAction);
  }
  java.util.List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
  for (  IAvailableModel model : availablemodels) {
    model.fillContextMenu(obj,manager,this,dataModelName);
  }
}

Fixed version (ground truth):
private void setAnnotationActions2(Object obj,IMenuManager manager){
  if (obj instanceof XSDElementDeclaration) {
    manager.add(setAnnotationLabelAction);
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLookupFieldsAction);
  }
  if (obj instanceof XSDParticle) {
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLabelAction);
  }
  if (Util.IsEnterPrise()) {
    manager.add(setAnnotationWriteAction);
    if (checkMandatoryElement(obj))     manager.add(setAnnotationNoAction);
  }
  java.util.List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
  for (  IAvailableModel model : availablemodels) {
    model.fillContextMenu(obj,manager,this,dataModelName);
  }
}
Program: 148595
Project: 148595
Buggy source:
private void hookDoubleClickAction(){
  viewer.addDoubleClickListener(new IDoubleClickListener(){
    public void doubleClick(    DoubleClickEvent event){
      IStructuredSelection selection=((IStructuredSelection)viewer.getSelection());
      int elem=getElementType(selection.getFirstElement());
      java.util.List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
      for (      IAvailableModel model : availablemodels) {
        model.doubleClickOnElement(elem,DataModelMainPage.this,dataModelName);
      }
switch (elem) {
case 0:
        editConceptAction.run();
      break;
case 1:
    editElementAction.run();
  break;
case 2:
newComplexTypeAction.run();
break;
case 3:
editIdentityConstraintAction.run();
break;
case 4:
editXPathAction.run();
break;
case 5:
changeBaseTypeAction.run();
break;
case 6:
setAnnotationDescriptionsAction.run();
break;
case 7:
editParticleAction.run();
break;
case 8:
changeSubElementGroupAction.run();
break;
case 201:
initxsdEditFacetAction("String_Node_Str");
break;
case 202:
initxsdEditFacetAction("String_Node_Str");
break;
case 203:
initxsdEditFacetAction("String_Node_Str");
break;
case 204:
initxsdEditFacetAction("String_Node_Str");
break;
case 205:
initxsdEditFacetAction("String_Node_Str");
break;
case 206:
initxsdEditFacetAction("String_Node_Str");
break;
case 207:
initxsdEditFacetAction("String_Node_Str");
break;
case 208:
initxsdEditFacetAction("String_Node_Str");
break;
case 209:
initxsdEditFacetAction("String_Node_Str");
break;
case 210:
initxsdEditFacetAction("String_Node_Str");
break;
case 211:
initxsdEditFacetAction("String_Node_Str");
break;
case 212:
initxsdEditFacetAction("String_Node_Str");
break;
case 101:
setAnnotationLabelAction.run();
break;
case 102:
setAnnotationForeignKeyAction.run();
break;
case 103:
setAnnotationForeignKeyInfoAction.run();
break;
case 112:
setAnnotationFKFilterAction.run();
break;
case 104:
break;
case 105:
break;
case 106:
setAnnotationDescriptionsAction.run();
break;
case 107:
setAnnotationWriteAction.run();
break;
case 108:
if (Util.IsEnterPrise()) {
setAnnotationNoAction.run();
}
break;
case 110:
setFacetMsgAction.run();
break;
case 113:
setAnnotationDisplayFomatAction.run();
break;
case 114:
setAnnotationLookupFieldsAction.run();
break;
case -1:
if (drillDownAdapter.canGoInto() == true) drillDownAdapter.goInto();
}
}
}
);
}

Fixed version (ground truth):
private void hookDoubleClickAction(){
  viewer.addDoubleClickListener(new DoubleClickListener(viewer){
  }
);
  typesViewer.addDoubleClickListener(new DoubleClickListener(typesViewer){
  }
);
}
Program: 148597
Project: 148597
Buggy source:
public IBrandingConfiguration getBrandingConfiguration(){
  if (brandingConfigure == null) {
    brandingConfigure=new DefaultBrandingConfiguration();
  }
  return brandingConfigure;
}

Fixed version (ground truth):
public IBrandingConfiguration getBrandingConfiguration(){
  if (brandingConfigure == null) {
    brandingConfigure=new TOMBrandingConfiguration();
  }
  return brandingConfigure;
}
Program: 148599
Project: 148599
Buggy source:
public static void copyFile(String source,String dest){
  byte[] buf=new byte[1024];
  OutputStream os=null;
  InputStream is=null;
  try {
    os=new BufferedOutputStream(new FileOutputStream(dest));
    is=new BufferedInputStream(new FileInputStream(source));
    int readLen=0;
    while ((readLen=is.read(buf,0,1024)) != -1) {
      os.write(buf,0,readLen);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    if (is != null)     try {
      is.close();
    }
 catch (    Exception e) {
    }
    ;
    if (os != null)     try {
      os.close();
    }
 catch (    Exception e) {
    }
    ;
  }
}

Fixed version (ground truth):
public static void copyFile(String source,String dest){
  if (source.equals(dest))   return;
  byte[] buf=new byte[1024];
  OutputStream os=null;
  InputStream is=null;
  try {
    os=new BufferedOutputStream(new FileOutputStream(dest));
    is=new BufferedInputStream(new FileInputStream(source));
    int readLen=0;
    while ((readLen=is.read(buf,0,1024)) != -1) {
      os.write(buf,0,readLen);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    if (is != null)     try {
      is.close();
    }
 catch (    Exception e) {
    }
    ;
    if (os != null)     try {
      os.close();
    }
 catch (    Exception e) {
    }
    ;
  }
}
Program: 148601
Project: 148601
Buggy source:
private void setDetails(){
  setImageDescriptor(ImageCache.getImage(EImage.COPY.getPath()));
  setText("String_Node_Str");
  setToolTipText("String_Node_Str" + IConstants.TALEND + "String_Node_Str");
}

Fixed version (ground truth):
private void setDetails(){
  setImageDescriptor(ImageCache.getImage(EImage.DUPLICATE.getPath()));
  setText("String_Node_Str");
  setToolTipText("String_Node_Str" + IConstants.TALEND + "String_Node_Str");
}
Program: 148602
Project: 148602
Buggy source:
public RefreshXObjectAction(ServerView view){
  super();
  this.view=view;
  setImageDescriptor(ImageCache.getImage(EImage.REFRESH.getPath()));
  setText("String_Node_Str");
  setToolTipText("String_Node_Str" + IConstants.TALEND + "String_Node_Str");
}

Fixed version (ground truth):
public RefreshXObjectAction(ServerView view,TreeObject selection){
  super();
  this.view=view;
  this.selection=selection;
  setImageDescriptor(ImageCache.getImage(EImage.REFRESH.getPath()));
  setText("String_Node_Str");
  setToolTipText("String_Node_Str" + IConstants.TALEND + "String_Node_Str");
}
Program: 148603
Project: 148603
Buggy source:
public void run(){
  try {
    TreeParent xobject=(TreeParent)((IStructuredSelection)view.getViewer().getSelection()).getFirstElement();
    serverObject=xobject.getServerRoot();
    if (xobject == null)     return;
    String server=(String)xobject.getServerRoot().getWsKey();
    ObjectRetriever retriever=new ObjectRetriever((TreeParent)xobject,server,serverObject.getUsername(),serverObject.getPassword(),serverObject.getUser().getUniverse());
    retriever.run(new NullProgressMonitor());
  }
 catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(){
  try {
    TreeParent xobject=(TreeParent)selection;
    serverObject=xobject.getServerRoot();
    if (xobject == null)     return;
    String server=(String)xobject.getServerRoot().getWsKey();
    ObjectRetriever retriever=new ObjectRetriever((TreeParent)xobject,server,serverObject.getUsername(),serverObject.getPassword(),serverObject.getUser().getUniverse());
    retriever.run(new NullProgressMonitor());
  }
 catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 148605
Project: 148605
Buggy source:
private void initParamterProposal(String jndi){
  if ("String_Node_Str".equals(jndi)) {
    WSTransformerV2PK[] transformerPKs=null;
    try {
      transformerPKs=Util.getPort(getXObject()).getTransformerV2PKs(new WSGetTransformerV2PKs("String_Node_Str")).getWsTransformerV2PK();
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str");
    }
    java.util.List<String> proposals=new ArrayList<String>();
    if (transformerPKs != null)     for (    WSTransformerV2PK pk : transformerPKs) {
      if (pk.getPk() != null && pk.getPk().length() > 0)       proposals.add(pk.getPk());
    }
    ContentProposalAdapterExtended adapter=WidgetUtils.addContentProposal(serviceParametersText,(String[])proposals.toArray(new String[proposals.size()]),new char[]{' ','='});
    adapter.setPopupSize(new Point(120,100));
  }
}

Fixed version (ground truth):
private void initParamterProposal(String jndi){
  if ("String_Node_Str".equals(jndi)) {
    WSTransformerV2PK[] transformerPKs=null;
    try {
      transformerPKs=Util.getPort(getXObject()).getTransformerV2PKs(new WSGetTransformerV2PKs("String_Node_Str")).getWsTransformerV2PK();
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str");
    }
    java.util.List<String> proposals=new ArrayList<String>();
    if (transformerPKs != null)     for (    WSTransformerV2PK pk : transformerPKs) {
      if (pk.getPk() != null && pk.getPk().length() > 0)       proposals.add(pk.getPk());
    }
    ContentProposalAdapterExtended adapter=WidgetUtils.addContentProposal(serviceParametersText,(String[])proposals.toArray(new String[proposals.size()]),new char[]{' ','='});
    adapter.setPopupSize(new Point(300,250));
  }
}
Program: 148606
Project: 148606
Buggy source:
public ObserverMetaData(AMainPageV2 page,Object view){
  mainPage=page;
  observerView=view;
  MenuManager menuMgr=new MenuManager();
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      manager.add(new DeleteItemAction(ObserverMetaData.this));
      if (observerView instanceof List)       manager.add(new RenameItemAction(ObserverMetaData.this));
    }
  }
);
  KeyListener listener=new KeyListener(){
    public void keyPressed(    KeyEvent e){
    }
    public void keyReleased(    KeyEvent e){
      if ((e.stateMask == 0) && (e.character == SWT.DEL) && (observerView != null)) {
        notifyObserver(false);
      }
    }
  }
;
  if (view instanceof TableViewer) {
    TableViewer tableView=(TableViewer)view;
    Menu menu=menuMgr.createContextMenu(tableView.getControl());
    tableView.getControl().setMenu(menu);
    page.getSite().registerContextMenu(menuMgr,tableView);
    tableView.getTable().addKeyListener(listener);
  }
 else   if (view instanceof List) {
    List list=(List)view;
    Menu menu=menuMgr.createContextMenu(list);
    list.setMenu(menu);
    list.addKeyListener(listener);
  }
 else   if (view instanceof ListViewer) {
    ListViewer listView=(ListViewer)view;
    Menu menu=menuMgr.createContextMenu(listView.getControl());
    listView.getControl().setMenu(menu);
    page.getSite().registerContextMenu(menuMgr,listView);
    listView.getControl().addKeyListener(listener);
  }
}

Fixed version (ground truth):
public ObserverMetaData(AMainPageV2 page,Object view){
  mainPage=page;
  observerView=view;
  MenuManager menuMgr=new MenuManager();
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      if (observerView instanceof List) {
        manager.add(new Separator());
        manager.add(new RenameItemAction(ObserverMetaData.this));
      }
      manager.add(new DeleteItemAction(ObserverMetaData.this));
    }
  }
);
  KeyListener listener=new KeyListener(){
    public void keyPressed(    KeyEvent e){
    }
    public void keyReleased(    KeyEvent e){
      if ((e.stateMask == 0) && (e.character == SWT.DEL) && (observerView != null)) {
        notifyObserver(false);
      }
    }
  }
;
  if (view instanceof TableViewer) {
    TableViewer tableView=(TableViewer)view;
    Menu menu=menuMgr.createContextMenu(tableView.getControl());
    tableView.getControl().setMenu(menu);
    page.getSite().registerContextMenu(menuMgr,tableView);
    tableView.getTable().addKeyListener(listener);
  }
 else   if (view instanceof List) {
    List list=(List)view;
    Menu menu=menuMgr.createContextMenu(list);
    list.setMenu(menu);
    list.addKeyListener(listener);
  }
 else   if (view instanceof ListViewer) {
    ListViewer listView=(ListViewer)view;
    Menu menu=menuMgr.createContextMenu(listView.getControl());
    listView.getControl().setMenu(menu);
    page.getSite().registerContextMenu(menuMgr,listView);
    listView.getControl().addKeyListener(listener);
  }
}
Program: 148607
Project: 148607
Buggy source:
public void menuAboutToShow(IMenuManager manager){
  manager.add(new DeleteItemAction(ObserverMetaData.this));
  if (observerView instanceof List)   manager.add(new RenameItemAction(ObserverMetaData.this));
}

Fixed version (ground truth):
public void menuAboutToShow(IMenuManager manager){
  if (observerView instanceof List) {
    manager.add(new Separator());
    manager.add(new RenameItemAction(ObserverMetaData.this));
  }
  manager.add(new DeleteItemAction(ObserverMetaData.this));
}
Program: 148608
Project: 148608
Buggy source:
public void run(){
  if (this.server == null) {
    return;
  }
  IStructuredSelection selection=(IStructuredSelection)server.getViewer().getSelection();
  for (Iterator<TreeObject> iter=selection.iterator(); iter.hasNext(); ) {
    TreeObject xobject=iter.next();
    try {
      deleteJob(xobject);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void run(){
  if (this.server == null) {
    return;
  }
  closePage();
  IStructuredSelection selection=(IStructuredSelection)server.getViewer().getSelection();
  for (Iterator<TreeObject> iter=selection.iterator(); iter.hasNext(); ) {
    TreeObject xobject=iter.next();
    try {
      deleteJob(xobject);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 148610
Project: 148610
Buggy source:
@Override public IStatus run(IProgressMonitor monitor){
  try {
    monitor.beginTask("String_Node_Str" + dataCluster + "String_Node_Str",IProgressMonitor.UNKNOWN);
    Util.exportDataCluster(xObject,dataCluster,filename,server,monitor);
    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) {
    e.printStackTrace();
    return Status.CANCEL_STATUS;
  }
}
Program: 148611
Project: 148611
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);
        Util.exportDataCluster(xObject,dataCluster,filename,server,monitor);
        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) {
    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();
}