nus-yam/ex-repair huggingface dataset:
Program: 148613
Project: 148613
Buggy source:
private void writeInputStream(InputStream inputSteam,String filename){
  try {
    File f=new File(exportFolder + "String_Node_Str" + filename);
    if (!f.getParentFile().getParentFile().exists()) {
      f.getParentFile().getParentFile().mkdir();
    }
    if (!f.getParentFile().exists()) {
      f.getParentFile().mkdir();
    }
    FileOutputStream output=new FileOutputStream(f);
    BufferedInputStream is=new BufferedInputStream(new DataInputStream(inputSteam));
    int data=is.read();
    while (data != -1) {
      output.write(data);
      data=is.read();
    }
    output.close();
    is.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void writeInputStream(InputStream inputSteam,String filename){
  try {
    File f=new File(exportFolder + "String_Node_Str" + filename);
    if (!f.getParentFile().getParentFile().exists()) {
      f.getParentFile().getParentFile().mkdir();
    }
    if (!f.getParentFile().exists()) {
      f.getParentFile().mkdir();
    }
    FileOutputStream output=new FileOutputStream(f);
    IOUtils.copy(inputSteam,output);
    output.close();
    inputSteam.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 148615
Project: 148615
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;
  }
  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;
  }
  WSView wsObject=(WSView)(getWsViewObject());
  if (wsObject.getViewableBusinessElements().length == 0) {
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str");
    return false;
  }
  if (wsObject.getSearchableBusinessElements().length == 0) {
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str");
    return false;
  }
  return true;
}
Program: 148616
Project: 148616
Buggy source:
public void widgetSelected(SelectionEvent e){
  if (dialog.getReturnCode() == -1)   return;
  typeName=dialog.getTypeName();
  builtIn=dialog.isBuiltIn();
  if (builtIn) {
    boolean found=false;
    for (Iterator iter=schema.getSchemaForSchema().getTypeDefinitions().iterator(); iter.hasNext(); ) {
      XSDTypeDefinition type=(XSDTypeDefinition)iter.next();
      if (type instanceof XSDSimpleTypeDefinition)       if (type.getName().equals(typeName)) {
        found=true;
        break;
      }
    }
    if (!found) {
      MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + typeName + "String_Node_Str");
      return;
    }
  }
  dialog.close();
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  if (dialog.getReturnCode() == -1)   return;
  typeName=dialog.getTypeName();
  if (typeName.trim().length() == 0)   return;
  builtIn=dialog.isBuiltIn();
  if (builtIn) {
    boolean found=false;
    for (Iterator iter=schema.getSchemaForSchema().getTypeDefinitions().iterator(); iter.hasNext(); ) {
      XSDTypeDefinition type=(XSDTypeDefinition)iter.next();
      if (type instanceof XSDSimpleTypeDefinition)       if (type.getName().equals(typeName)) {
        found=true;
        break;
      }
    }
    if (!found) {
      MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + typeName + "String_Node_Str");
      return;
    }
  }
  dialog.close();
}
Program: 148620
Project: 148620
Buggy source:
private void deleteItems(Object view){
  if (view == stepsList) {
    int[] index=stepsList.getSelectionIndices();
    boolean firstPos=false;
    for (int i=index.length - 1; i >= 0; i--) {
      if (index[i] == 0) {
        firstPos=true;
      }
      removeStep(index[i]);
    }
    if (stepsList.getItemCount() == 0) {
      section.setVisible(false);
    }
    if (stepsList.getItemCount() >= 1 && firstPos) {
      stepsList.select(0);
      refreshStep(0);
    }
  }
 else   if (view == stepWidget.inputViewer || view == stepWidget.outputViewer) {
    TableViewer viewer=(TableViewer)view;
    IStructuredSelection selections=(IStructuredSelection)viewer.getSelection();
    java.util.List list=(java.util.List)Arrays.asList(selections.toArray());
    if (list.size() == 0)     return;
    java.util.List<WSTransformerVariablesMapping> items=(java.util.List<WSTransformerVariablesMapping>)viewer.getInput();
    items.removeAll(list);
    if (view == stepWidget.inputViewer)     stepWidget.processStep.setInputMappings(items.toArray(new WSTransformerVariablesMapping[items.size()]));
 else     stepWidget.processStep.setOutputMappings(items.toArray(new WSTransformerVariablesMapping[items.size()]));
    viewer.refresh();
    markDirtyWithoutCommit();
  }
}

Fixed version (ground truth):
private void deleteItems(Object view){
  if (view != null && view == stepsList) {
    int[] index=stepsList.getSelectionIndices();
    boolean firstPos=false;
    for (int i=index.length - 1; i >= 0; i--) {
      if (index[i] == 0) {
        firstPos=true;
      }
      removeStep(index[i]);
    }
    if (stepsList.getItemCount() == 0) {
      section.setVisible(false);
    }
    if (stepsList.getItemCount() >= 1 && firstPos) {
      stepsList.select(0);
      refreshStep(0);
    }
  }
 else   if (view == stepWidget.inputViewer || view == stepWidget.outputViewer) {
    TableViewer viewer=(TableViewer)view;
    IStructuredSelection selections=(IStructuredSelection)viewer.getSelection();
    java.util.List list=(java.util.List)Arrays.asList(selections.toArray());
    if (list.size() == 0)     return;
    java.util.List<WSTransformerVariablesMapping> items=(java.util.List<WSTransformerVariablesMapping>)viewer.getInput();
    items.removeAll(list);
    if (view == stepWidget.inputViewer)     stepWidget.processStep.setInputMappings(items.toArray(new WSTransformerVariablesMapping[items.size()]));
 else     stepWidget.processStep.setOutputMappings(items.toArray(new WSTransformerVariablesMapping[items.size()]));
    viewer.refresh();
    markDirtyWithoutCommit();
  }
}
Program: 148621
Project: 148621
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));
    }
  }
);
  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();
      }
    }
  }
;
  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){
      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);
  }
}
Program: 148622
Project: 148622
Buggy source:
public void run(){
  observer.notifyObserver();
}

Fixed version (ground truth):
public void run(){
  observer.notifyObserver(true);
}
Program: 148623
Project: 148623
Buggy source:
public void notifyObserver(){
  mainPage.update(ObserverMetaData.this,observerView);
}

Fixed version (ground truth):
public void notifyObserver(boolean isRename){
  if (isRename && mainPage instanceof TransformerMainPage)   ((TransformerMainPage)mainPage).rename(observerView);
 else   mainPage.update(ObserverMetaData.this,observerView);
}
Program: 148624
Project: 148624
Buggy source:
public void keyReleased(KeyEvent e){
  if ((e.stateMask == 0) && (e.character == SWT.DEL) && (observerView != null)) {
    notifyObserver();
  }
}

Fixed version (ground truth):
public void keyReleased(KeyEvent e){
  if ((e.stateMask == 0) && (e.character == SWT.DEL) && (observerView != null)) {
    notifyObserver(false);
  }
}
Program: 148625
Project: 148625
Buggy source:
public void menuAboutToShow(IMenuManager manager){
  manager.add(new DeleteItemAction(ObserverMetaData.this));
}

Fixed version (ground truth):
public void menuAboutToShow(IMenuManager manager){
  manager.add(new DeleteItemAction(ObserverMetaData.this));
  if (observerView instanceof List)   manager.add(new RenameItemAction(ObserverMetaData.this));
}
Program: 148626
Project: 148626
Buggy source:
/** 
 * Modify Events on the page
 */
public void modifyText(ModifyEvent e){
  markDirty();
}

Fixed version (ground truth):
/** 
 * Modify Events on the page
 */
public void modifyText(ModifyEvent e){
  markDirtyWithoutCommit();
}
Program: 148627
Project: 148627
Buggy source:
public void run(){
  XSDSchema schemaCpy=null;
  try {
    schemaCpy=Util.createXsdSchema(Util.nodeToString(xsdSchema.getDocument()),getXObject());
    xsdSchema.clearDiagnostics();
    performImport(addList);
    performDeletion(delList);
    validateSchema();
    markDirty();
    setXsdSchema(xsdSchema);
    commit();
    refreshData();
    XSDSchema mc=xsdSchema;
    MessageDialog.openInformation(getSite().getShell(),"String_Node_Str","String_Node_Str");
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    String detail="String_Node_Str";
    if (ex.getMessage() != null && !ex.getMessage().equals("String_Node_Str")) {
      detail+="String_Node_Str" + "String_Node_Str" + ex.getMessage();
    }
    setXsdSchema(schemaCpy);
    commit();
    refresh();
    MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str" + detail);
  }
}

Fixed version (ground truth):
public void run(){
  XSDSchema schemaCpy=null;
  try {
    schemaCpy=Util.createXsdSchema(Util.nodeToString(xsdSchema.getDocument()),getXObject());
    xsdSchema.clearDiagnostics();
    performImport(addList);
    performDeletion(delList);
    validateSchema();
    markDirtyWithoutCommit();
    setXsdSchema(xsdSchema);
    commit();
    refreshData();
    XSDSchema mc=xsdSchema;
    MessageDialog.openInformation(getSite().getShell(),"String_Node_Str","String_Node_Str");
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    String detail="String_Node_Str";
    if (ex.getMessage() != null && !ex.getMessage().equals("String_Node_Str")) {
      detail+="String_Node_Str" + "String_Node_Str" + ex.getMessage();
    }
    setXsdSchema(schemaCpy);
    commit();
    refresh();
    MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str" + detail);
  }
}
Program: 148628
Project: 148628
Buggy source:
public void stepDown(){
  TreeItem item;
  TreeItem[] items=viewer.getTree().getSelection();
  for (int i=items.length - 1; i >= 0; i--) {
    item=items[i];
    XSDConcreteComponent component=(XSDConcreteComponent)item.getData();
    if (!(component instanceof XSDParticle))     continue;
 else {
      XSDParticle particle=(XSDParticle)component;
      if (particle.getContainer() instanceof XSDModelGroup) {
        XSDModelGroup mp=(XSDModelGroup)particle.getContainer();
        int index=mp.getContents().indexOf(particle);
        if (index < mp.getContents().size() - 1) {
          mp.getContents().move(index,index + 1);
          this.refresh();
        }
      }
    }
  }
  this.markDirty();
}

Fixed version (ground truth):
public void stepDown(){
  TreeItem item;
  TreeItem[] items=viewer.getTree().getSelection();
  for (int i=items.length - 1; i >= 0; i--) {
    item=items[i];
    XSDConcreteComponent component=(XSDConcreteComponent)item.getData();
    if (!(component instanceof XSDParticle))     continue;
 else {
      XSDParticle particle=(XSDParticle)component;
      if (particle.getContainer() instanceof XSDModelGroup) {
        XSDModelGroup mp=(XSDModelGroup)particle.getContainer();
        int index=mp.getContents().indexOf(particle);
        if (index < mp.getContents().size() - 1) {
          mp.getContents().move(index,index + 1);
          this.refresh();
        }
      }
    }
  }
  this.markDirtyWithoutCommit();
}
Program: 148629
Project: 148629
Buggy source:
protected void addOrDelLanguage(boolean isAdd){
  TreeItem[] items=viewer.getTree().getItems();
  addLabelForTheItem(items,isAdd);
  if (isChange) {
    this.markDirty();
    this.refresh();
  }
}

Fixed version (ground truth):
protected void addOrDelLanguage(boolean isAdd){
  TreeItem[] items=viewer.getTree().getItems();
  addLabelForTheItem(items,isAdd);
  if (isChange) {
    this.markDirtyWithoutCommit();
    this.refresh();
  }
}
Program: 148630
Project: 148630
Buggy source:
public void stepUp(){
  TreeItem item;
  TreeItem[] items=viewer.getTree().getSelection();
  for (int i=0; i < items.length; i++) {
    item=items[i];
    XSDConcreteComponent component=(XSDConcreteComponent)item.getData();
    if (!(component instanceof XSDParticle))     continue;
 else {
      XSDParticle particle=(XSDParticle)component;
      if (particle.getContainer() instanceof XSDModelGroup) {
        XSDModelGroup mp=(XSDModelGroup)particle.getContainer();
        int index=mp.getContents().indexOf(particle);
        if (index > 0) {
          mp.getContents().move(index - 1,index);
          this.refresh();
        }
      }
    }
  }
  this.markDirty();
}

Fixed version (ground truth):
public void stepUp(){
  TreeItem item;
  TreeItem[] items=viewer.getTree().getSelection();
  for (int i=0; i < items.length; i++) {
    item=items[i];
    XSDConcreteComponent component=(XSDConcreteComponent)item.getData();
    if (!(component instanceof XSDParticle))     continue;
 else {
      XSDParticle particle=(XSDParticle)component;
      if (particle.getContainer() instanceof XSDModelGroup) {
        XSDModelGroup mp=(XSDModelGroup)particle.getContainer();
        int index=mp.getContents().indexOf(particle);
        if (index > 0) {
          mp.getContents().move(index - 1,index);
          this.refresh();
        }
      }
    }
  }
  this.markDirtyWithoutCommit();
}
Program: 148631
Project: 148631
Buggy source:
private void inferXsdFromXml(String xmlFile){
  int infer=0;
  String xsd="String_Node_Str";
  try {
    String inputType=xmlFile.substring(xmlFile.lastIndexOf("String_Node_Str"));
    if (inputType.equals("String_Node_Str")) {
      xsd=Util.getXML(xmlFile);
      xsdSchema=Util.createXsdSchema(xsd,getXObject());
      xsdSchema.setTargetNamespace(null);
      xsd=Util.nodeToString(xsdSchema.getDocument());
    }
 else {
      XSDDriver d=new XSDDriver();
      infer=d.doMain(new String[]{xmlFile,"String_Node_Str"});
      if (infer == 0) {
        xsd=d.outputXSD();
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    infer=2;
  }
 finally {
    if (infer == 0 && !xsd.equals("String_Node_Str")) {
      WSDataModel wsObj=(WSDataModel)(getXObject().getWsObject());
      wsObj.setXsdSchema(xsd);
      validateSchema(xsd);
      refreshData();
      markDirty();
    }
 else     if (infer != 0) {
      MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void inferXsdFromXml(String xmlFile){
  int infer=0;
  String xsd="String_Node_Str";
  try {
    String inputType=xmlFile.substring(xmlFile.lastIndexOf("String_Node_Str"));
    if (inputType.equals("String_Node_Str")) {
      xsd=Util.getXML(xmlFile);
      xsdSchema=Util.createXsdSchema(xsd,getXObject());
      xsdSchema.setTargetNamespace(null);
      xsd=Util.nodeToString(xsdSchema.getDocument());
    }
 else {
      XSDDriver d=new XSDDriver();
      infer=d.doMain(new String[]{xmlFile,"String_Node_Str"});
      if (infer == 0) {
        xsd=d.outputXSD();
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    infer=2;
  }
 finally {
    if (infer == 0 && !xsd.equals("String_Node_Str")) {
      WSDataModel wsObj=(WSDataModel)(getXObject().getWsObject());
      wsObj.setXsdSchema(xsd);
      validateSchema(xsd);
      refreshData();
      markDirtyWithoutCommit();
    }
 else     if (infer != 0) {
      MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str");
    }
  }
}
Program: 148633
Project: 148633
Buggy source:
protected void doImportSchema(final List<String> addList,final List<String> delList){
  TimerTask task=new TimerTask(){
    public void run(){
      getSite().getShell().getDisplay().asyncExec(new Runnable(){
        public void run(){
          XSDSchema schemaCpy=null;
          try {
            schemaCpy=Util.createXsdSchema(Util.nodeToString(xsdSchema.getDocument()),getXObject());
            xsdSchema.clearDiagnostics();
            performImport(addList);
            performDeletion(delList);
            validateSchema();
            markDirty();
            setXsdSchema(xsdSchema);
            commit();
            refreshData();
            XSDSchema mc=xsdSchema;
            MessageDialog.openInformation(getSite().getShell(),"String_Node_Str","String_Node_Str");
          }
 catch (          Exception ex) {
            ex.printStackTrace();
            String detail="String_Node_Str";
            if (ex.getMessage() != null && !ex.getMessage().equals("String_Node_Str")) {
              detail+="String_Node_Str" + "String_Node_Str" + ex.getMessage();
            }
            setXsdSchema(schemaCpy);
            commit();
            refresh();
            MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str" + detail);
          }
        }
      }
);
    }
  }
;
  Timer timer=new Timer(true);
  timer.schedule(task,0);
}

Fixed version (ground truth):
protected void doImportSchema(final List<String> addList,final List<String> delList){
  TimerTask task=new TimerTask(){
    public void run(){
      getSite().getShell().getDisplay().asyncExec(new Runnable(){
        public void run(){
          XSDSchema schemaCpy=null;
          try {
            schemaCpy=Util.createXsdSchema(Util.nodeToString(xsdSchema.getDocument()),getXObject());
            xsdSchema.clearDiagnostics();
            performImport(addList);
            performDeletion(delList);
            validateSchema();
            markDirtyWithoutCommit();
            setXsdSchema(xsdSchema);
            commit();
            refreshData();
            XSDSchema mc=xsdSchema;
            MessageDialog.openInformation(getSite().getShell(),"String_Node_Str","String_Node_Str");
          }
 catch (          Exception ex) {
            ex.printStackTrace();
            String detail="String_Node_Str";
            if (ex.getMessage() != null && !ex.getMessage().equals("String_Node_Str")) {
              detail+="String_Node_Str" + "String_Node_Str" + ex.getMessage();
            }
            setXsdSchema(schemaCpy);
            commit();
            refresh();
            MessageDialog.openError(getSite().getShell(),"String_Node_Str","String_Node_Str" + detail);
          }
        }
      }
);
    }
  }
;
  Timer timer=new Timer(true);
  timer.schedule(task,0);
}
Program: 148634
Project: 148634
Buggy source:
public void drop(DropTargetEvent event){
  Control control=((DropTarget)event.widget).getControl();
  if ((control instanceof List) && ((event.operations & DND.DROP_COPY) == DND.DROP_COPY))   if (TextTransfer.getInstance().isSupportedType(event.currentDataType))   if (!Arrays.asList(((List)control).getItems()).contains(event.data)) {
    ((List)control).add((String)event.data);
    MenuMainPage.this.markDirty();
  }
}

Fixed version (ground truth):
public void drop(DropTargetEvent event){
  Control control=((DropTarget)event.widget).getControl();
  if ((control instanceof List) && ((event.operations & DND.DROP_COPY) == DND.DROP_COPY))   if (TextTransfer.getInstance().isSupportedType(event.currentDataType))   if (!Arrays.asList(((List)control).getItems()).contains(event.data)) {
    ((List)control).add((String)event.data);
    MenuMainPage.this.markDirtyWithoutCommit();
  }
}
Program: 148635
Project: 148635
Buggy source:
public void run(){
  try {
    if (treeEntry.getParentTreeEntry() == null) {
      WSMenu menu=((WSMenu)viewer.getInput());
      if (menu.getMenuEntries().length == 1) {
        MessageDialog.openWarning(MenuMainPage.this.getSite().getShell(),"String_Node_Str","String_Node_Str");
        return;
      }
      ArrayList<WSMenuEntry> subMenus=new ArrayList(Arrays.asList(menu.getMenuEntries()));
      subMenus.remove(treeEntry.getWsMenuEntry());
      menu.setMenuEntries(subMenus.toArray(new WSMenuEntry[subMenus.size()]));
    }
 else {
      ArrayList<WSMenuEntry> subMenus=new ArrayList(Arrays.asList(treeEntry.getParentTreeEntry().getWsMenuEntry().getSubMenus()));
      subMenus.remove(treeEntry.getWsMenuEntry());
      treeEntry.getParentTreeEntry().getWsMenuEntry().setSubMenus(subMenus.toArray(new WSMenuEntry[subMenus.size()]));
    }
    viewer.setExpandedState(treeEntry.getParentTreeEntry(),true);
    viewer.refresh(treeEntry.getParentTreeEntry(),false);
    markDirty();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(viewer.getControl().getShell(),"String_Node_Str","String_Node_Str" + treeEntry.getWsMenuEntry().getId() + "String_Node_Str"+ e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    if (treeEntry.getParentTreeEntry() == null) {
      WSMenu menu=((WSMenu)viewer.getInput());
      if (menu.getMenuEntries().length == 1) {
        MessageDialog.openWarning(MenuMainPage.this.getSite().getShell(),"String_Node_Str","String_Node_Str");
        return;
      }
      ArrayList<WSMenuEntry> subMenus=new ArrayList(Arrays.asList(menu.getMenuEntries()));
      subMenus.remove(treeEntry.getWsMenuEntry());
      menu.setMenuEntries(subMenus.toArray(new WSMenuEntry[subMenus.size()]));
    }
 else {
      ArrayList<WSMenuEntry> subMenus=new ArrayList(Arrays.asList(treeEntry.getParentTreeEntry().getWsMenuEntry().getSubMenus()));
      subMenus.remove(treeEntry.getWsMenuEntry());
      treeEntry.getParentTreeEntry().getWsMenuEntry().setSubMenus(subMenus.toArray(new WSMenuEntry[subMenus.size()]));
    }
    viewer.setExpandedState(treeEntry.getParentTreeEntry(),true);
    viewer.refresh(treeEntry.getParentTreeEntry(),false);
    markDirtyWithoutCommit();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(viewer.getControl().getShell(),"String_Node_Str","String_Node_Str" + treeEntry.getWsMenuEntry().getId() + "String_Node_Str"+ e.getLocalizedMessage());
  }
}
Program: 148636
Project: 148636
Buggy source:
public void dragFinished(DragSourceEvent event){
  Control control=((DragSource)event.widget).getControl();
  if ((control instanceof List) && ((event.detail & DND.DROP_MOVE) == DND.DROP_MOVE)) {
    ((List)control).remove(selected);
    MenuMainPage.this.markDirty();
  }
}

Fixed version (ground truth):
public void dragFinished(DragSourceEvent event){
  Control control=((DragSource)event.widget).getControl();
  if ((control instanceof List) && ((event.detail & DND.DROP_MOVE) == DND.DROP_MOVE)) {
    ((List)control).remove(selected);
    MenuMainPage.this.markDirtyWithoutCommit();
  }
}
Program: 148638
Project: 148638
Buggy source:
protected void performAdd(){
  try {
    if (stepText.getText().trim().length() == 0)     return;
    TransformerMainPage.this.comitting=true;
    TransformerMainPage.this.stepsList.add(TransformerMainPage.this.stepText.getText());
    WSTransformerV2 wsTransformer=transformer;
    ArrayList<WSTransformerProcessStep> list=new ArrayList<WSTransformerProcessStep>();
    if (wsTransformer.getProcessSteps() != null) {
      list=new ArrayList<WSTransformerProcessStep>(Arrays.asList(wsTransformer.getProcessSteps()));
    }
    list.add(new WSTransformerProcessStep("String_Node_Str",TransformerMainPage.this.stepText.getText(),"String_Node_Str",new WSTransformerVariablesMapping[0],new WSTransformerVariablesMapping[0],false));
    wsTransformer.setProcessSteps(list.toArray(new WSTransformerProcessStep[list.size()]));
    TransformerMainPage.this.comitting=false;
    int index=TransformerMainPage.this.stepsList.getItemCount() - 1;
    TransformerMainPage.this.stepsList.select(index);
    refreshStep(index);
    TransformerMainPage.this.stepsList.forceFocus();
    markDirty();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
protected void performAdd(){
  try {
    if (stepText.getText().trim().length() == 0)     return;
    TransformerMainPage.this.comitting=true;
    TransformerMainPage.this.stepsList.add(TransformerMainPage.this.stepText.getText());
    WSTransformerV2 wsTransformer=transformer;
    ArrayList<WSTransformerProcessStep> list=new ArrayList<WSTransformerProcessStep>();
    if (wsTransformer.getProcessSteps() != null) {
      list=new ArrayList<WSTransformerProcessStep>(Arrays.asList(wsTransformer.getProcessSteps()));
    }
    list.add(new WSTransformerProcessStep("String_Node_Str",TransformerMainPage.this.stepText.getText(),"String_Node_Str",new WSTransformerVariablesMapping[0],new WSTransformerVariablesMapping[0],false));
    wsTransformer.setProcessSteps(list.toArray(new WSTransformerProcessStep[list.size()]));
    TransformerMainPage.this.comitting=false;
    int index=TransformerMainPage.this.stepsList.getItemCount() - 1;
    TransformerMainPage.this.stepsList.select(index);
    refreshStep(index);
    TransformerMainPage.this.stepsList.forceFocus();
    markDirtyWithoutCommit();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}
Program: 148639
Project: 148639
Buggy source:
protected void removeStep(int index){
  WSTransformerV2 wsTransformer=transformer;
  pluginsCombo.setText("String_Node_Str");
  pluginsCombo.select(-1);
  parametersTextViewer.setDocument(new Document("String_Node_Str"));
  TransformerMainPage.this.comitting=true;
  TransformerMainPage.this.stepsList.remove(index);
  TransformerMainPage.this.stepsList.select(index - 1);
  refreshStep(stepsList.getSelectionIndex());
  TransformerMainPage.this.stepsList.forceFocus();
  ArrayList<WSTransformerProcessStep> list=new ArrayList<WSTransformerProcessStep>(Arrays.asList(wsTransformer.getProcessSteps()));
  list.remove(index);
  currentPlugin=stepsList.getSelectionIndex();
  wsTransformer.setProcessSteps(list.toArray(new WSTransformerProcessStep[list.size()]));
  TransformerMainPage.this.comitting=false;
  markDirty();
}

Fixed version (ground truth):
protected void removeStep(int index){
  WSTransformerV2 wsTransformer=transformer;
  pluginsCombo.setText("String_Node_Str");
  pluginsCombo.select(-1);
  parametersTextViewer.setDocument(new Document("String_Node_Str"));
  TransformerMainPage.this.comitting=true;
  TransformerMainPage.this.stepsList.remove(index);
  TransformerMainPage.this.stepsList.select(index - 1);
  refreshStep(stepsList.getSelectionIndex());
  TransformerMainPage.this.stepsList.forceFocus();
  ArrayList<WSTransformerProcessStep> list=new ArrayList<WSTransformerProcessStep>(Arrays.asList(wsTransformer.getProcessSteps()));
  list.remove(index);
  currentPlugin=stepsList.getSelectionIndex();
  wsTransformer.setProcessSteps(list.toArray(new WSTransformerProcessStep[list.size()]));
  TransformerMainPage.this.comitting=false;
  markDirtyWithoutCommit();
}
Program: 148640
Project: 148640
Buggy source:
public void create() throws Exception {
  mainComposite=toolkit.createComposite(parent,SWT.BORDER);
  mainComposite.setLayoutData(new GridData(SWT.FILL,SWT.RIGHT,true,true,4,1));
  mainComposite.setLayout(new GridLayout(3,false));
  variableListener=new KeyListener(){
    public void keyPressed(    KeyEvent e){
      if (e.keyCode == '/' && e.stateMask == SWT.ALT) {
        VariableDefinitionDialog dlg=new VariableDefinitionDialog(mainComposite.getShell(),TransformerMainPage.this.getPartName(),e.widget == inputVariables ? true : false,pluginsCombo.getText());
        dlg.setBlockOnOpen(true);
        dlg.open();
        if (dlg.getReturnCode() == Window.OK) {
          Widget wdg=e.widget;
          if (wdg instanceof CCombo) {
            CCombo combo=(CCombo)wdg;
            if (!Arrays.asList(combo.getItems()).contains(dlg.outPutVariable())) {
              combo.add(dlg.outPutVariable());
              TransformerMainPage.this.markDirty();
            }
            for (int idx=0; idx < combo.getItems().length; idx++) {
              if (dlg.outPutVariable().equals(combo.getItem(idx))) {
                combo.select(idx);
                break;
              }
            }
          }
          dlg.close();
        }
      }
    }
    public void keyReleased(    KeyEvent e){
    }
  }
;
  mouseListener=new MouseTrackAdapter(){
    public void mouseEnter(    MouseEvent e){
      ((Text)e.getSource()).setToolTipText("String_Node_Str");
    }
  }
;
  createInput();
  createPlugin();
  createOutput();
}

Fixed version (ground truth):
public void create() throws Exception {
  mainComposite=toolkit.createComposite(parent,SWT.BORDER);
  mainComposite.setLayoutData(new GridData(SWT.FILL,SWT.RIGHT,true,true,4,1));
  mainComposite.setLayout(new GridLayout(3,false));
  variableListener=new KeyListener(){
    public void keyPressed(    KeyEvent e){
      if (e.keyCode == '/' && e.stateMask == SWT.ALT) {
        VariableDefinitionDialog dlg=new VariableDefinitionDialog(mainComposite.getShell(),TransformerMainPage.this.getPartName(),e.widget == inputVariables ? true : false,pluginsCombo.getText());
        dlg.setBlockOnOpen(true);
        dlg.open();
        if (dlg.getReturnCode() == Window.OK) {
          Widget wdg=e.widget;
          if (wdg instanceof CCombo) {
            CCombo combo=(CCombo)wdg;
            if (!Arrays.asList(combo.getItems()).contains(dlg.outPutVariable())) {
              combo.add(dlg.outPutVariable());
              TransformerMainPage.this.markDirtyWithoutCommit();
            }
            for (int idx=0; idx < combo.getItems().length; idx++) {
              if (dlg.outPutVariable().equals(combo.getItem(idx))) {
                combo.select(idx);
                break;
              }
            }
          }
          dlg.close();
        }
      }
    }
    public void keyReleased(    KeyEvent e){
    }
  }
;
  mouseListener=new MouseTrackAdapter(){
    public void mouseEnter(    MouseEvent e){
      ((Text)e.getSource()).setToolTipText("String_Node_Str");
    }
  }
;
  createInput();
  createPlugin();
  createOutput();
}
Program: 148641
Project: 148641
Buggy source:
public void keyPressed(KeyEvent e){
  if (e.keyCode == '/' && e.stateMask == SWT.ALT) {
    VariableDefinitionDialog dlg=new VariableDefinitionDialog(mainComposite.getShell(),TransformerMainPage.this.getPartName(),e.widget == inputVariables ? true : false,pluginsCombo.getText());
    dlg.setBlockOnOpen(true);
    dlg.open();
    if (dlg.getReturnCode() == Window.OK) {
      Widget wdg=e.widget;
      if (wdg instanceof CCombo) {
        CCombo combo=(CCombo)wdg;
        if (!Arrays.asList(combo.getItems()).contains(dlg.outPutVariable())) {
          combo.add(dlg.outPutVariable());
          TransformerMainPage.this.markDirty();
        }
        for (int idx=0; idx < combo.getItems().length; idx++) {
          if (dlg.outPutVariable().equals(combo.getItem(idx))) {
            combo.select(idx);
            break;
          }
        }
      }
      dlg.close();
    }
  }
}

Fixed version (ground truth):
public void keyPressed(KeyEvent e){
  if (e.keyCode == '/' && e.stateMask == SWT.ALT) {
    VariableDefinitionDialog dlg=new VariableDefinitionDialog(mainComposite.getShell(),TransformerMainPage.this.getPartName(),e.widget == inputVariables ? true : false,pluginsCombo.getText());
    dlg.setBlockOnOpen(true);
    dlg.open();
    if (dlg.getReturnCode() == Window.OK) {
      Widget wdg=e.widget;
      if (wdg instanceof CCombo) {
        CCombo combo=(CCombo)wdg;
        if (!Arrays.asList(combo.getItems()).contains(dlg.outPutVariable())) {
          combo.add(dlg.outPutVariable());
          TransformerMainPage.this.markDirtyWithoutCommit();
        }
        for (int idx=0; idx < combo.getItems().length; idx++) {
          if (dlg.outPutVariable().equals(combo.getItem(idx))) {
            combo.select(idx);
            break;
          }
        }
      }
      dlg.close();
    }
  }
}
Program: 148642
Project: 148642
Buggy source:
private void deleteItems(Object view){
  if (view == stepsList) {
    int[] index=stepsList.getSelectionIndices();
    boolean firstPos=false;
    for (int i=index.length - 1; i >= 0; i--) {
      if (index[i] == 0) {
        firstPos=true;
      }
      removeStep(index[i]);
    }
    if (stepsList.getItemCount() == 0) {
      section.setVisible(false);
    }
    if (stepsList.getItemCount() >= 1 && firstPos) {
      stepsList.select(0);
      refreshStep(0);
    }
  }
 else   if (view == stepWidget.inputViewer || view == stepWidget.outputViewer) {
    TableViewer viewer=(TableViewer)view;
    IStructuredSelection selections=(IStructuredSelection)viewer.getSelection();
    java.util.List list=(java.util.List)Arrays.asList(selections.toArray());
    if (list.size() == 0)     return;
    java.util.List<WSTransformerVariablesMapping> items=(java.util.List<WSTransformerVariablesMapping>)viewer.getInput();
    items.removeAll(list);
    if (view == stepWidget.inputViewer)     stepWidget.processStep.setInputMappings(items.toArray(new WSTransformerVariablesMapping[items.size()]));
 else     stepWidget.processStep.setOutputMappings(items.toArray(new WSTransformerVariablesMapping[items.size()]));
    viewer.refresh();
    markDirty();
  }
}

Fixed version (ground truth):
private void deleteItems(Object view){
  if (view == stepsList) {
    int[] index=stepsList.getSelectionIndices();
    boolean firstPos=false;
    for (int i=index.length - 1; i >= 0; i--) {
      if (index[i] == 0) {
        firstPos=true;
      }
      removeStep(index[i]);
    }
    if (stepsList.getItemCount() == 0) {
      section.setVisible(false);
    }
    if (stepsList.getItemCount() >= 1 && firstPos) {
      stepsList.select(0);
      refreshStep(0);
    }
  }
 else   if (view == stepWidget.inputViewer || view == stepWidget.outputViewer) {
    TableViewer viewer=(TableViewer)view;
    IStructuredSelection selections=(IStructuredSelection)viewer.getSelection();
    java.util.List list=(java.util.List)Arrays.asList(selections.toArray());
    if (list.size() == 0)     return;
    java.util.List<WSTransformerVariablesMapping> items=(java.util.List<WSTransformerVariablesMapping>)viewer.getInput();
    items.removeAll(list);
    if (view == stepWidget.inputViewer)     stepWidget.processStep.setInputMappings(items.toArray(new WSTransformerVariablesMapping[items.size()]));
 else     stepWidget.processStep.setOutputMappings(items.toArray(new WSTransformerVariablesMapping[items.size()]));
    viewer.refresh();
    markDirtyWithoutCommit();
  }
}
Program: 148643
Project: 148643
Buggy source:
public void textChanged(TextEvent event){
  markDirty();
}

Fixed version (ground truth):
public void textChanged(TextEvent event){
  markDirtyWithoutCommit();
}
Program: 148647
Project: 148647
Buggy source:
public void drop(DropTargetEvent event){
  Control control=((DropTarget)event.widget).getControl();
  if ((control instanceof List) && ((event.operations & DND.DROP_COPY) == DND.DROP_COPY))   if (TextTransfer.getInstance().isSupportedType(event.currentDataType))   if (!Arrays.asList(((List)control).getItems()).contains(event.data)) {
    ((List)control).add((String)event.data);
    ViewMainPage.this.markDirty();
  }
}

Fixed version (ground truth):
public void drop(DropTargetEvent event){
  Control control=((DropTarget)event.widget).getControl();
  if ((control instanceof List) && ((event.operations & DND.DROP_COPY) == DND.DROP_COPY))   if (TextTransfer.getInstance().isSupportedType(event.currentDataType))   if (!Arrays.asList(((List)control).getItems()).contains(event.data)) {
    ((List)control).add((String)event.data);
    ViewMainPage.this.markDirtyWithoutCommit();
  }
}
Program: 148648
Project: 148648
Buggy source:
public void dragFinished(DragSourceEvent event){
  Control control=((DragSource)event.widget).getControl();
  if ((control instanceof List) && ((event.detail & DND.DROP_MOVE) == DND.DROP_MOVE)) {
    ((List)control).remove(selected);
    ViewMainPage.this.markDirty();
  }
}

Fixed version (ground truth):
public void dragFinished(DragSourceEvent event){
  Control control=((DragSource)event.widget).getControl();
  if ((control instanceof List) && ((event.detail & DND.DROP_MOVE) == DND.DROP_MOVE)) {
    ((List)control).remove(selected);
    markDirtyWithoutCommit();
  }
}
Program: 148649
Project: 148649
Buggy source:
public void textChanged(TextEvent event){
  markDirty();
}

Fixed version (ground truth):
public void textChanged(TextEvent event){
  markDirtyWithoutCommit();
}
Program: 148651
Project: 148651
Buggy source:
private void setAnnotationActions2(Object obj,IMenuManager manager){
  if (obj instanceof XSDElementDeclaration) {
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLookupFieldsAction);
  }
  manager.add(setAnnotationWriteAction);
  if (obj instanceof XSDParticle) {
    manager.add(setAnnotationLabelAction);
  }
  if (Util.IsEnterPrise()) {
    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(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLookupFieldsAction);
  }
  if (obj instanceof XSDParticle) {
    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: 148653
Project: 148653
Buggy source:
public void addTreeObjects(XtentisPort port,IProgressMonitor monitor,TreeParent serverRoot){
  monitor.subTask("String_Node_Str");
  TreeParent jobs=serverRoot.findServerFolder(TreeObject.JOB_REGISTRY);
  if (jobs == null)   jobs=new TreeParent(EXtentisObjects.JobRegistry.getDisplayName(),serverRoot,TreeObject.JOB_REGISTRY,null,null);
  TreeParent deployedJob=new TreeParent("String_Node_Str",serverRoot,TreeObject.CATEGORY_FOLDER,null,null);
  try {
    WSMDMJob[] jobPKs=port.getMDMJob(new WSMDMNULL()).getWsMDMJob();
    if (jobPKs != null) {
      for (int i=0; i < jobPKs.length; i++) {
        String name=jobPKs[i].getJobName() + "String_Node_Str" + jobPKs[i].getJobVersion()+ jobPKs[i].getSuffix();
        TreeObject obj=new TreeObject(name,serverRoot,TreeObject.JOB,name,null);
        deployedJob.addChild(obj);
      }
    }
  }
 catch (  Exception e) {
  }
  jobs.addChild(deployedJob);
  serverRoot.addChild(jobs);
  monitor.worked(1);
}

Fixed version (ground truth):
public void addTreeObjects(XtentisPort port,IProgressMonitor monitor,TreeParent serverRoot){
  monitor.subTask("String_Node_Str");
  TreeParent jobs=serverRoot.findServerFolder(TreeObject.JOB_REGISTRY);
  if (jobs == null)   jobs=new TreeParent(EXtentisObjects.JobRegistry.getDisplayName(),serverRoot,TreeObject.JOB_REGISTRY,null,null);
  TreeParent deployedJob=new TreeParent("String_Node_Str",serverRoot,TreeObject.BUILT_IN_CATEGORY_FOLDER,null,null);
  try {
    WSMDMJob[] jobPKs=port.getMDMJob(new WSMDMNULL()).getWsMDMJob();
    if (jobPKs != null) {
      for (int i=0; i < jobPKs.length; i++) {
        String name=jobPKs[i].getJobName() + "String_Node_Str" + jobPKs[i].getJobVersion()+ jobPKs[i].getSuffix();
        TreeObject obj=new TreeObject(name,serverRoot,TreeObject.JOB,name,null);
        deployedJob.addChild(obj);
      }
    }
  }
 catch (  Exception e) {
  }
  jobs.addChild(deployedJob);
  serverRoot.addChild(jobs);
  monitor.worked(1);
}
Program: 148656
Project: 148656
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.getViewableBusinessElements().length == 0) {
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str");
    return false;
  }
  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;
  }
  WSView wsObject=(WSView)(getWsViewObject());
  if (wsObject.getSearchableBusinessElements().length == 0) {
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str");
    return false;
  }
  return true;
}
Program: 148657
Project: 148657
Buggy source:
private void setAnnotationActions(Object obj,IMenuManager manager){
  if (obj instanceof XSDElementDeclaration) {
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLookupFieldsAction);
  }
  if (obj instanceof XSDParticle) {
    manager.add(setAnnotationLabelAction);
    manager.add(setAnnotationForeignKeyAction);
    manager.add(setAnnotationFKFilterAction);
    manager.add(setAnnotationForeignKeyInfoAction);
  }
  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 setAnnotationActions(Object obj,IMenuManager manager){
  if (obj instanceof XSDElementDeclaration) {
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLookupFieldsAction);
  }
  if (obj instanceof XSDParticle) {
    manager.add(setAnnotationDescriptionsAction);
    manager.add(setAnnotationLabelAction);
    manager.add(setAnnotationForeignKeyAction);
    manager.add(setAnnotationFKFilterAction);
    manager.add(setAnnotationForeignKeyInfoAction);
  }
  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: 148658
Project: 148658
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(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(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: 148659
Project: 148659
Buggy source:
public void addTreeObjects(XtentisPort port,IProgressMonitor monitor,TreeParent serverRoot){
  monitor.subTask("String_Node_Str");
  TreeParent jobs=serverRoot.findServerFolder(TreeObject.JOB_REGISTRY);
  if (jobs == null)   jobs=new TreeParent(EXtentisObjects.JobRegistry.getDisplayName(),serverRoot,TreeObject.JOB_REGISTRY,null,null);
  try {
    WSMDMJob[] jobPKs=port.getMDMJob(new WSMDMNULL()).getWsMDMJob();
    if (jobPKs != null) {
      for (int i=0; i < jobPKs.length; i++) {
        String name=jobPKs[i].getJobName() + "String_Node_Str" + jobPKs[i].getJobVersion()+ jobPKs[i].getSuffix();
        TreeObject obj=new TreeObject(name,serverRoot,TreeObject.JOB,name,null);
        jobs.addChild(obj);
      }
    }
  }
 catch (  Exception e) {
  }
  serverRoot.addChild(jobs);
  monitor.worked(1);
}

Fixed version (ground truth):
public void addTreeObjects(XtentisPort port,IProgressMonitor monitor,TreeParent serverRoot){
  monitor.subTask("String_Node_Str");
  TreeParent jobs=serverRoot.findServerFolder(TreeObject.JOB_REGISTRY);
  if (jobs == null)   jobs=new TreeParent(EXtentisObjects.JobRegistry.getDisplayName(),serverRoot,TreeObject.JOB_REGISTRY,null,null);
  TreeParent deployedJob=new TreeParent("String_Node_Str",serverRoot,TreeObject.CATEGORY_FOLDER,null,null);
  try {
    WSMDMJob[] jobPKs=port.getMDMJob(new WSMDMNULL()).getWsMDMJob();
    if (jobPKs != null) {
      for (int i=0; i < jobPKs.length; i++) {
        String name=jobPKs[i].getJobName() + "String_Node_Str" + jobPKs[i].getJobVersion()+ jobPKs[i].getSuffix();
        TreeObject obj=new TreeObject(name,serverRoot,TreeObject.JOB,name,null);
        deployedJob.addChild(obj);
      }
    }
  }
 catch (  Exception e) {
  }
  jobs.addChild(deployedJob);
  serverRoot.addChild(jobs);
  monitor.worked(1);
}