nus-yam/ex-repair huggingface dataset:
Program: 148515
Project: 148515
Buggy source:
public ForeignKeyFilterCellModifier(Viewer viewer){
  this.viewer=viewer;
  prop2ValueIndexExtractor.put(COL_PROP_XPATH,new CellEditorValueExtractor<ForeignKeyFilterAnnoInfoDefUnit>("String_Node_Str"));
  prop2ValueIndexExtractor.put(COL_PROP_OPERATOR,new ArrayComboCellEditorIndexExtractor<ForeignKeyFilterAnnoInfoDefUnit>(IConstants.VIEW_CONDITION_OPERATORS,"String_Node_Str"));
  prop2ValueIndexExtractor.put(COL_PROP_VALUE,new CellEditorValueExtractor<ForeignKeyFilterAnnoInfoDefUnit>("String_Node_Str"));
  prop2ValueIndexExtractor.put(COL_PROP_PREDICATE,new ArrayComboCellEditorIndexExtractor<ForeignKeyFilterAnnoInfoDefUnit>(IConstants.PREDICATES,"String_Node_Str"));
}

Fixed version (ground truth):
public ForeignKeyFilterCellModifier(Viewer viewer){
  this.viewer=viewer;
  prop2ValueIndexExtractor.put(COL_PROP_XPATH,new CellEditorValueExtractor<ForeignKeyFilterAnnoInfoDefUnit>("String_Node_Str"));
  prop2ValueIndexExtractor.put(COL_PROP_OPERATOR,new ArrayComboCellEditorIndexExtractor<ForeignKeyFilterAnnoInfoDefUnit>(IConstants.VIEW_CONDITION_OPERATORS,"String_Node_Str"));
  prop2ValueIndexExtractor.put(COL_PROP_VALUE,new CellEditorValueExtractor<ForeignKeyFilterAnnoInfoDefUnit>("String_Node_Str"));
  prop2ValueIndexExtractor.put(COL_PROP_PREDICATE,new ArrayComboCellEditorIndexExtractor<ForeignKeyFilterAnnoInfoDefUnit>(IConstants.PREDICATES,"String_Node_Str"));
  prop2ValueModifier.put(COL_PROP_XPATH,new CellEditorValueModifier<ForeignKeyFilterAnnoInfoDefUnit>("String_Node_Str","String_Node_Str"));
  prop2ValueModifier.put(COL_PROP_OPERATOR,new ArrayComboCellEditorValueModifier<ForeignKeyFilterAnnoInfoDefUnit>(IConstants.VIEW_CONDITION_OPERATORS,"String_Node_Str","String_Node_Str"));
  prop2ValueModifier.put(COL_PROP_VALUE,new CellEditorValueModifier<ForeignKeyFilterAnnoInfoDefUnit>("String_Node_Str","String_Node_Str"));
  prop2ValueModifier.put(COL_PROP_PREDICATE,new ArrayComboCellEditorValueModifier<ForeignKeyFilterAnnoInfoDefUnit>(IConstants.PREDICATES,"String_Node_Str","String_Node_Str"));
}
Program: 148516
Project: 148516
Buggy source:
public boolean canModify(Object element,String property){
  return (element instanceof ForeignKeyAnnoInfo) && Arrays.asList(COLPROPS).contains(property);
}

Fixed version (ground truth):
public boolean canModify(Object element,String property){
  return (element instanceof ForeignKeyFilterAnnoInfoDefUnit) && Arrays.asList(COLPROPS).contains(property);
}
Program: 148517
Project: 148517
Buggy source:
private void refresh(String content){
  XSDSchema xsd;
  try {
    xsd=Util.createXsdSchema(content,page.getXObject());
  }
 catch (  Exception e) {
    e.printStackTrace();
    return;
  }
  page.setXsdSchema(xsd);
  page.refresh();
  page.markDirty();
}

Fixed version (ground truth):
private void refresh(String content){
  XSDSchema xsd;
  try {
    xsd=Util.createXsdSchema(content,page.getXObject());
  }
 catch (  Exception e) {
    e.printStackTrace();
    return;
  }
  page.setXsdSchema(xsd);
  page.refresh();
  page.markDirtyWithoutCommit();
}
Program: 148519
Project: 148519
Buggy source:
@Override public void doSave(IProgressMonitor monitor){
  super.doSave(monitor);
  try {
    if (getSelectedPage() instanceof DataModelMainPage) {
      DataModelMainPage mainPage=(DataModelMainPage)getSelectedPage();
      String xsd=mainPage.getXSDSchemaString();
      WSDataModel wsDataModel=(WSDataModel)xobject.getWsObject();
      wsDataModel.setXsdSchema(xsd);
      XSDEditorUtil.createFile(xobject);
    }
    IDocument doc=getTextEditor().getTextViewer().getDocument();
    String xsd=doc.get();
    IEditorPart[] editors=findEditors(xsdInput);
    if (editors.length == 1 && editors[0] instanceof DataModelMainPage) {
      DataModelMainPage mainPage=(DataModelMainPage)editors[0];
      mainPage.save(xsd);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void doSave(IProgressMonitor monitor){
  super.doSave(monitor);
  try {
    if (getSelectedPage() instanceof DataModelMainPage) {
      DataModelMainPage mainPage=(DataModelMainPage)getSelectedPage();
      String xsd=mainPage.getXSDSchemaString();
      WSDataModel wsDataModel=(WSDataModel)xobject.getWsObject();
      wsDataModel.setXsdSchema(xsd);
      IFile file=XSDEditorUtil.createFile(xobject);
      file.setContents(new ByteArrayInputStream(xsd.getBytes()),IFile.FORCE,null);
    }
    IDocument doc=getTextEditor().getTextViewer().getDocument();
    String xsd=doc.get();
    IEditorPart[] editors=findEditors(xsdInput);
    if (editors.length == 1 && editors[0] instanceof DataModelMainPage) {
      DataModelMainPage mainPage=(DataModelMainPage)editors[0];
      mainPage.save(xsd);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 148521
Project: 148521
Buggy source:
public void widgetSelected(SelectionEvent e){
  if (dialog.getReturnCode() == -1)   return;
  keyName=dialog.getKeyName();
  fieldName=dialog.getFieldName();
  type=dialog.getType();
  EList list=schema.getIdentityConstraintDefinitions();
  for (Iterator iter=list.iterator(); iter.hasNext(); ) {
    XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)iter.next();
    if ((type.equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) && (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) && (icd.getContainer().equals(decl.getContainer()))) {
      MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str");
      return;
    }
    if (icd.getName().equals(keyName)) {
      MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + keyName + "String_Node_Str");
      return;
    }
  }
  dialog.close();
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  if (dialog.getReturnCode() == -1)   return;
  keyName=dialog.getKeyName();
  fieldName=dialog.getFieldName();
  type=dialog.getType();
  EList list=schema.getIdentityConstraintDefinitions();
  for (Iterator iter=list.iterator(); iter.hasNext(); ) {
    XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)iter.next();
    if ((type.equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) && (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) && (icd.getContainer().equals(decl))) {
      MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str");
      return;
    }
    if (icd.getName().equals(keyName)) {
      MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + keyName + "String_Node_Str");
      return;
    }
  }
  dialog.close();
}
Program: 148525
Project: 148525
Buggy source:
@Override public boolean performFinish(){
  if (zipBtn.getSelection()) {
    exportFolder=new File(System.getProperty("String_Node_Str") + "String_Node_Str").getAbsolutePath();
    zipfile=zip.getText().getText();
  }
  if (folderBtn.getSelection()) {
    exportFolder=folder.getText().getText();
  }
  final TreeObject[] objs=treeViewer.getCheckNodes();
  Job job=new Job("String_Node_Str"){
    @Override public IStatus run(    IProgressMonitor monitor){
      try {
        doexport(objs,monitor);
        return Status.OK_STATUS;
      }
 catch (      Exception e) {
        e.printStackTrace();
        return Status.CANCEL_STATUS;
      }
 finally {
        if (zipfile != null && new File(exportFolder).exists()) {
          try {
            ZipToFile.zipFile(exportFolder,zipfile);
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
          ZipToFile.deleteDirectory(new File(exportFolder));
        }
      }
    }
  }
;
  job.setPriority(Job.INTERACTIVE);
  job.schedule();
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  if (zipBtn.getSelection()) {
    File tempFile=new File(System.getProperty("String_Node_Str") + "String_Node_Str");
    if (tempFile.exists()) {
      File[] tempFiles=tempFile.listFiles();
      for (      File file : tempFiles) {
        file.delete();
      }
    }
    exportFolder=tempFile.getAbsolutePath();
    zipfile=zip.getText().getText();
  }
  if (folderBtn.getSelection()) {
    exportFolder=folder.getText().getText();
  }
  final TreeObject[] objs=treeViewer.getCheckNodes();
  Job job=new Job("String_Node_Str"){
    @Override public IStatus run(    IProgressMonitor monitor){
      try {
        doexport(objs,monitor);
        return Status.OK_STATUS;
      }
 catch (      Exception e) {
        e.printStackTrace();
        return Status.CANCEL_STATUS;
      }
 finally {
        if (zipfile != null && new File(exportFolder).exists()) {
          try {
            ZipToFile.zipFile(exportFolder,zipfile);
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
          ZipToFile.deleteDirectory(new File(exportFolder));
        }
      }
    }
  }
;
  job.setPriority(Job.INTERACTIVE);
  job.schedule();
  return true;
}
Program: 148526
Project: 148526
Buggy source:
@Test public void canSetRoleMenu() throws Exception {
  SWTBotTreeItem node=serverTree.expandNode("String_Node_Str").getNode("String_Node_Str");
  node.expand();
  node=node.expandNode("String_Node_Str").getNode("String_Node_Str");
  node.doubleClick();
  final SWTBotEditor editor=bot.editorByTitle("String_Node_Str");
  XObjectEditor ep=(XObjectEditor)editor.getReference().getPart(true);
  DataModelMainPage mainpage=(DataModelMainPage)ep.getPage(0);
  Tree conceptTree=mainpage.getTreeViewer().getTree();
  SWTBotTree tree=new SWTBotTree(conceptTree);
  SWTBotTreeItem node1=tree.getTreeItem("String_Node_Str");
  node1.expand();
  node1.getNode(0).expand();
  SWTBotTreeItem userNode=node1.getNode(0).getNode("String_Node_Str");
  userNode.setFocus();
  SWTBotMenu ctxMenu=userNode.select().contextMenu("String_Node_Str").click();
  SWTBotShell newViewShell=bot.shell("String_Node_Str");
  newViewShell.activate();
  sleep();
  bot.button("String_Node_Str").click();
  sleep();
  ctxMenu=userNode.select().contextMenu("String_Node_Str").click();
  sleep();
  bot.button("String_Node_Str").click();
  sleep();
  ctxMenu=userNode.select().contextMenu("String_Node_Str").click();
  sleep();
  bot.button("String_Node_Str").click();
  sleep();
}

Fixed version (ground truth):
@Test public void canSetRoleMenu() throws Exception {
  SWTBotTreeItem node=serverTree.expandNode("String_Node_Str").getNode("String_Node_Str");
  node.expand();
  node=node.expandNode("String_Node_Str").getNode("String_Node_Str");
  node.doubleClick();
  final SWTBotEditor editor=bot.editorByTitle("String_Node_Str");
  XObjectEditor ep=(XObjectEditor)editor.getReference().getPart(true);
  DataModelMainPage mainpage=(DataModelMainPage)ep.getPage(0);
  Tree conceptTree=mainpage.getTreeViewer().getTree();
  SWTBotTree conceptBotTree=new SWTBotTree(conceptTree);
  mainpage.setSchemaSelected(false);
  Tree typesTree=mainpage.getTreeViewer().getTree();
  SWTBotTree typesBotTree=new SWTBotTree(typesTree);
  SWTBotTreeItem conceptNode=conceptBotTree.getTreeItem("String_Node_Str");
  conceptNode.expand();
  conceptNode.getNode(0).expand();
  SWTBotTreeItem userNode=conceptNode.getNode(0).getNode("String_Node_Str");
  userNode.setFocus();
  checkAccessTest(userNode);
  SWTBotTreeItem typeNode=conceptNode.getNode("String_Node_Str");
  typeNode.setFocus();
  addElementTest(typeNode,"String_Node_Str");
  SWTBotTreeItem conceptTypesNode=typesBotTree.getTreeItem("String_Node_Str");
  conceptTypesNode.expand();
  addElementTest(conceptTypesNode,"String_Node_Str");
}
Program: 148529
Project: 148529
Buggy source:
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e){
  changeDomTree(tree);
}

Fixed version (ground truth):
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e){
  changeDomTree(tree,"String_Node_Str");
}
Program: 148531
Project: 148531
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 {
    String schema=wsDataModel.getXsdSchema();
    XSDSchema xsd=Util.createXsdSchema(schema,pObject);
    provideViwerContent(xsd);
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
private void changeDomTree(final TreeParent pObject,String filter){
  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,filter);
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}
Program: 148532
Project: 148532
Buggy source:
public XPathTreeContentProvider(IWorkbenchPartSite site,XSDSchema invisibleRoot,TreeObject treeObject){
  super(site,invisibleRoot,treeObject);
}

Fixed version (ground truth):
public XPathTreeContentProvider(IWorkbenchPartSite site,XSDSchema invisibleRoot,TreeObject treeObject,String filter){
  super(site,invisibleRoot,treeObject);
  this.filter=filter;
}
Program: 148533
Project: 148533
Buggy source:
private Object[] filterOutDuplicatedElems(List<XSDElementDeclaration> xsdElementDeclarations){
  List<XSDElementDeclaration> list=new ArrayList<XSDElementDeclaration>();
  for (  XSDElementDeclaration el : (XSDElementDeclaration[])xsdElementDeclarations.toArray(new XSDElementDeclaration[xsdElementDeclarations.size()])) {
    boolean exist=false;
    for (    XSDElementDeclaration xsdEl : list) {
      if (xsdEl.getName().equals(el.getName()) && xsdEl.getTargetNamespace() != null && el.getTargetNamespace() != null && xsdEl.getTargetNamespace().equals(el.getTargetNamespace())) {
        exist=true;
        break;
      }
 else       if (xsdEl.getName().equals(el.getName()) && xsdEl.getTargetNamespace() == null && el.getTargetNamespace() == null) {
        exist=true;
        break;
      }
    }
    if (!exist) {
      if ((conceptName != null && el.getName().equals(conceptName)) || (conceptName == null && (el.getTargetNamespace() != null && !el.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) || (conceptName == null && el.getTargetNamespace() == null)))       list.add(el);
    }
  }
  return list.toArray();
}

Fixed version (ground truth):
private Object[] filterOutDuplicatedElems(List<XSDElementDeclaration> xsdElementDeclarations){
  List<XSDElementDeclaration> list=new ArrayList<XSDElementDeclaration>();
  for (  XSDElementDeclaration el : (XSDElementDeclaration[])xsdElementDeclarations.toArray(new XSDElementDeclaration[xsdElementDeclarations.size()])) {
    boolean exist=false;
    for (    XSDElementDeclaration xsdEl : list) {
      if (xsdEl.getName().equals(el.getName()) && xsdEl.getTargetNamespace() != null && el.getTargetNamespace() != null && xsdEl.getTargetNamespace().equals(el.getTargetNamespace())) {
        exist=true;
        break;
      }
 else       if (xsdEl.getName().equals(el.getName()) && xsdEl.getTargetNamespace() == null && el.getTargetNamespace() == null) {
        exist=true;
        break;
      }
    }
    if (!exist) {
      if ((conceptName != null && el.getName().equals(conceptName)) || (conceptName == null && (el.getTargetNamespace() != null && !el.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) || (conceptName == null && el.getTargetNamespace() == null))) {
        if (filter.equalsIgnoreCase("String_Node_Str") || el.getName().toLowerCase().startsWith(filter.toLowerCase()))         list.add(el);
      }
    }
  }
  return list.toArray();
}
Program: 148534
Project: 148534
Buggy source:
@Override protected void okPressed(){
  setReturnCode(OK);
  getButton(IDialogConstants.OK_ID).setData("String_Node_Str",MenuEntryDialog.this);
  try {
    String icon="String_Node_Str";
    if (wsMenuEntry.getIcon() != null) {
      if (!wsMenuEntry.getIcon().equalsIgnoreCase(getIconPathText().getText())) {
        Util.uploadImageFile(uripre + "String_Node_Str" + wsMenuEntry.getIcon(),"String_Node_Str","String_Node_Str","String_Node_Str");
        if (!"String_Node_Str".equalsIgnoreCase(getIconPathText().getText()))         icon=Util.uploadImageFile(uripre + "String_Node_Str",getIconPathText().getText(),"String_Node_Str","String_Node_Str");
        getIconPathText().setText(icon);
      }
    }
 else     if (!"String_Node_Str".equalsIgnoreCase(getIconPathText().getText()))     icon=Util.uploadImageFile(uripre + "String_Node_Str",getIconPathText().getText(),"String_Node_Str","String_Node_Str");
    getIconPathText().setText(icon);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override protected void okPressed(){
  setReturnCode(OK);
  getButton(IDialogConstants.OK_ID).setData("String_Node_Str",MenuEntryDialog.this);
  try {
    String icon="String_Node_Str";
    if (wsMenuEntry.getIcon() != null) {
      if (!wsMenuEntry.getIcon().equalsIgnoreCase(getIconPathText().getText())) {
        Util.uploadImageFile(uripre + "String_Node_Str" + wsMenuEntry.getIcon(),"String_Node_Str","String_Node_Str","String_Node_Str",null);
        if (!"String_Node_Str".equalsIgnoreCase(getIconPathText().getText()))         icon=Util.uploadImageFile(uripre + "String_Node_Str",getIconPathText().getText(),"String_Node_Str","String_Node_Str",null);
        getIconPathText().setText(icon);
      }
    }
 else     if (!"String_Node_Str".equalsIgnoreCase(getIconPathText().getText()))     icon=Util.uploadImageFile(uripre + "String_Node_Str",getIconPathText().getText(),"String_Node_Str","String_Node_Str",null);
    getIconPathText().setText(icon);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 148537
Project: 148537
Buggy source:
public static String uploadImageFile(String URL,String localFilename,String username,String password) throws XtentisException {
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  HttpClient client=new HttpClient();
  MultipartPostMethod mppost=new MultipartPostMethod(URL);
  String response=null;
  try {
    client.setConnectionTimeout(60000);
    client.getState().setAuthenticationPreemptive(true);
    client.getState().setCredentials(null,null,new UsernamePasswordCredentials(username,password));
    if (!"String_Node_Str".equalsIgnoreCase(localFilename))     mppost.addParameter("String_Node_Str",new File(localFilename));
    client.executeMethod(mppost);
    if (mppost.getStatusCode() != HttpStatus.SC_OK) {
      throw new XtentisException("String_Node_Str" + mppost.getStatusCode() + "String_Node_Str"+ mppost.getStatusText());
    }
    response=mppost.getResponseBodyAsString();
    mppost.releaseConnection();
    if (response.contains("String_Node_Str"))     return response.substring(response.indexOf("String_Node_Str"),response.indexOf("String_Node_Str") - 1);
 else     return "String_Node_Str";
  }
 catch (  Exception e) {
    mppost.releaseConnection();
    e.printStackTrace();
    throw new XtentisException(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public static String uploadImageFile(String URL,String localFilename,String username,String password,HashMap<String,String> picturePathMap) throws XtentisException {
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  HttpClient client=new HttpClient();
  MultipartPostMethod mppost=new MultipartPostMethod(URL);
  String response=null;
  try {
    client.setConnectionTimeout(60000);
    client.getState().setAuthenticationPreemptive(true);
    client.getState().setCredentials(null,null,new UsernamePasswordCredentials(username,password));
    File file=new File(localFilename);
    if (!"String_Node_Str".equalsIgnoreCase(localFilename))     mppost.addParameter("String_Node_Str",file);
    client.executeMethod(mppost);
    if (mppost.getStatusCode() != HttpStatus.SC_OK) {
      throw new XtentisException("String_Node_Str" + mppost.getStatusCode() + "String_Node_Str"+ mppost.getStatusText());
    }
    response=mppost.getResponseBodyAsString();
    mppost.releaseConnection();
    if (response.contains("String_Node_Str")) {
      String returnValue=response.substring(response.indexOf("String_Node_Str"),response.indexOf("String_Node_Str") - 1);
      if (picturePathMap != null) {
        String fileName1=file.getName();
        picturePathMap.put(fileName1,returnValue);
      }
      return returnValue;
    }
 else     return "String_Node_Str";
  }
 catch (  Exception e) {
    mppost.releaseConnection();
    e.printStackTrace();
    throw new XtentisException(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 148539
Project: 148539
Buggy source:
private static String getComponentName(Object component){
  if (component instanceof XSDElementDeclaration) {
    XSDElementDeclaration decl=(XSDElementDeclaration)component;
    return "String_Node_Str" + decl.getName() + "String_Node_Str";
  }
 else   if (component instanceof XSDParticle) {
    XSDParticle particle=(XSDParticle)component;
    XSDTerm term=(XSDTerm)particle.getTerm();
    if (term instanceof XSDElementDeclaration && !(((XSDElementDeclaration)term).getContainer() instanceof XSDParticle)) {
      return "String_Node_Str" + ((XSDElementDeclaration)term).getName() + "String_Node_Str";
    }
  }
 else   if (component instanceof XSDComplexTypeDefinition) {
    XSDComplexTypeDefinition type=(XSDComplexTypeDefinition)component;
    return type.getName();
  }
 else   if (component instanceof XSDSimpleTypeDefinition) {
    return "String_Node_Str" + ((XSDSimpleTypeDefinition)component).getName() + "String_Node_Str";
  }
 else   if (component instanceof XSDIdentityConstraintDefinition) {
    XSDIdentityConstraintDefinition identify=(XSDIdentityConstraintDefinition)component;
    XSDConcreteComponent c=identify.getContainer();
    return "String_Node_Str" + identify.getName() + "String_Node_Str";
  }
 else   if (component instanceof XSDXPathDefinition) {
    XSDXPathDefinition path=(XSDXPathDefinition)component;
    return "String_Node_Str" + path.getValue() + "String_Node_Str";
  }
  return null;
}

Fixed version (ground truth):
private static String getComponentName(Object component){
  if (component instanceof XSDElementDeclaration) {
    XSDElementDeclaration decl=(XSDElementDeclaration)component;
    return "String_Node_Str" + decl.getName() + "String_Node_Str";
  }
 else   if (component instanceof XSDParticle) {
    XSDParticle particle=(XSDParticle)component;
    XSDTerm term=(XSDTerm)particle.getTerm();
    if (term instanceof XSDElementDeclaration) {
      return "String_Node_Str" + ((XSDElementDeclaration)term).getName() + "String_Node_Str";
    }
  }
 else   if (component instanceof XSDComplexTypeDefinition) {
    XSDComplexTypeDefinition type=(XSDComplexTypeDefinition)component;
    return type.getName();
  }
 else   if (component instanceof XSDSimpleTypeDefinition) {
    return "String_Node_Str" + ((XSDSimpleTypeDefinition)component).getName() + "String_Node_Str";
  }
 else   if (component instanceof XSDIdentityConstraintDefinition) {
    XSDIdentityConstraintDefinition identify=(XSDIdentityConstraintDefinition)component;
    XSDConcreteComponent c=identify.getContainer();
    return "String_Node_Str" + identify.getName() + "String_Node_Str";
  }
 else   if (component instanceof XSDXPathDefinition) {
    XSDXPathDefinition path=(XSDXPathDefinition)component;
    return "String_Node_Str" + path.getValue() + "String_Node_Str";
  }
  return null;
}
Program: 148542
Project: 148542
Buggy source:
private void validateType() throws IllegalAccessException {
  HashMap<String,Boolean> typeCntMap=new HashMap<String,Boolean>();
  EList<XSDTypeDefinition> types=xsdSchema.getTypeDefinitions();
  String tail="String_Node_Str";
  for (  XSDTypeDefinition type : types) {
    if (type instanceof XSDComplexTypeDefinition) {
      tail="String_Node_Str";
    }
 else {
      tail="String_Node_Str";
    }
    if (typeCntMap.get(type.getName() + tail) == Boolean.TRUE) {
      throw new IllegalAccessException("String_Node_Str" + tail + "String_Node_Str"+ type.getName());
    }
    typeCntMap.put(type.getName() + tail,Boolean.TRUE);
  }
}

Fixed version (ground truth):
private void validateType() throws IllegalAccessException {
  HashMap<String,Boolean> typeCntMap=new HashMap<String,Boolean>();
  EList<XSDTypeDefinition> types=xsdSchema.getTypeDefinitions();
  String tail="String_Node_Str";
  for (  XSDTypeDefinition type : types) {
    if (type instanceof XSDComplexTypeDefinition) {
      tail="String_Node_Str";
    }
 else {
      tail="String_Node_Str";
    }
    if (typeCntMap.get(type.getName() + tail + type.getTargetNamespace()) == Boolean.TRUE) {
    }
    typeCntMap.put(type.getName() + tail + type.getTargetNamespace(),Boolean.TRUE);
  }
}
Program: 148543
Project: 148543
Buggy source:
public void validateSchema() throws IllegalAccessException {
  final String maxoccurs_omit="String_Node_Str";
  xsdSchema.clearDiagnostics();
  xsdSchema.validate();
  EList<XSDDiagnostic> diagnoses=xsdSchema.getAllDiagnostics();
  String error="String_Node_Str";
  for (int i=0; i < diagnoses.size(); i++) {
    XSDDiagnostic dia=diagnoses.get(i);
    XSDDiagnosticSeverity servity=dia.getSeverity();
    if (servity == XSDDiagnosticSeverity.ERROR_LITERAL || servity == XSDDiagnosticSeverity.FATAL_LITERAL) {
      if (!dia.getMessage().equals(maxoccurs_omit)) {
        error+=dia.getMessage() + "String_Node_Str";
      }
    }
  }
  if (!error.equals("String_Node_Str")) {
    throw new IllegalAccessException(error);
  }
  validateType();
  validateElementation();
}

Fixed version (ground truth):
public void validateSchema() throws IllegalAccessException {
  final String msg_omit[]={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  xsdSchema.clearDiagnostics();
  xsdSchema.validate();
  EList<XSDDiagnostic> diagnoses=xsdSchema.getAllDiagnostics();
  String error="String_Node_Str";
  for (int i=0; i < diagnoses.size(); i++) {
    XSDDiagnostic dia=diagnoses.get(i);
    XSDDiagnosticSeverity servity=dia.getSeverity();
    if (servity == XSDDiagnosticSeverity.ERROR_LITERAL || servity == XSDDiagnosticSeverity.FATAL_LITERAL) {
      boolean omit=false;
      for (      String msg : msg_omit) {
        if (dia.getMessage().indexOf(msg) != -1) {
          omit=true;
          break;
        }
      }
      if (!omit) {
        error+=dia.getMessage() + "String_Node_Str";
      }
    }
  }
  if (!error.equals("String_Node_Str")) {
    throw new IllegalAccessException(error);
  }
  validateType();
  validateElementation();
}
Program: 148544
Project: 148544
Buggy source:
public int save(String xsd){
  try {
    WSDataModel wsObject=(WSDataModel)(getXObject().getWsObject());
    wsObject.setDescription(descriptionText.getText() == null ? "String_Node_Str" : descriptionText.getText());
    String schema=xsd;
    if (xsd == null) {
      schema=((XSDTreeContentProvider)viewer.getContentProvider()).getXSDSchemaAsString();
    }
    schema=schema.replaceAll("String_Node_Str","String_Node_Str");
    schema=schema.replaceAll("String_Node_Str","String_Node_Str");
    wsObject.setXsdSchema(schema);
    XSDImport xsdImport=XSDFactory.eINSTANCE.createXSDImport();
    xsdImport.setNamespace("String_Node_Str");
    if (xsdSchema == null) {
      xsdSchema=Util.createXsdSchema(schema,getXObject());
    }
    EList<XSDSchemaContent> elist=xsdSchema.getContents();
    for (    XSDSchemaContent cnt : elist) {
      if (cnt instanceof XSDImport) {
        XSDImport imp=(XSDImport)cnt;
        if (imp.getNamespace().equals("String_Node_Str")) {
          xsdImport=null;
          break;
        }
      }
    }
    if (xsdImport != null) {
      xsdSchema.getContents().add(0,xsdImport);
      wsObject.setXsdSchema(Util.nodeToString(xsdSchema.getDocument()));
    }
    validateSchema();
    XMLEditor xmleditor=(getEditor()).getXmlEditor();
    xmleditor.refresh(getXObject());
  }
 catch (  Exception e) {
    e.printStackTrace();
    ErrorExceptionDialog.openError(this.getSite().getShell(),"String_Node_Str",CommonUtil.getErrMsgFromException(e));
    return 1;
  }
  return 0;
}

Fixed version (ground truth):
public int save(String xsd){
  try {
    WSDataModel wsObject=(WSDataModel)(getXObject().getWsObject());
    wsObject.setDescription(descriptionText.getText() == null ? "String_Node_Str" : descriptionText.getText());
    String schema=xsd;
    if (xsd == null) {
      schema=((XSDTreeContentProvider)viewer.getContentProvider()).getXSDSchemaAsString();
    }
    wsObject.setXsdSchema(schema);
    XSDImport xsdImport=XSDFactory.eINSTANCE.createXSDImport();
    xsdImport.setNamespace("String_Node_Str");
    if (xsdSchema == null) {
      xsdSchema=Util.createXsdSchema(schema,getXObject());
    }
    EList<XSDSchemaContent> elist=xsdSchema.getContents();
    for (    XSDSchemaContent cnt : elist) {
      if (cnt instanceof XSDImport) {
        XSDImport imp=(XSDImport)cnt;
        if (imp.getNamespace().equals("String_Node_Str")) {
          xsdImport=null;
          break;
        }
      }
    }
    if (xsdImport != null) {
      xsdSchema.getContents().add(0,xsdImport);
      wsObject.setXsdSchema(Util.nodeToString(xsdSchema.getDocument()));
    }
    validateSchema();
    XMLEditor xmleditor=(getEditor()).getXmlEditor();
    xmleditor.refresh(getXObject());
  }
 catch (  Exception e) {
    e.printStackTrace();
    ErrorExceptionDialog.openError(this.getSite().getShell(),"String_Node_Str",CommonUtil.getErrMsgFromException(e));
    return 1;
  }
  return 0;
}
Program: 148545
Project: 148545
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();
      markDirtyWithoutCommit();
    }
 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());
      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: 148547
Project: 148547
Buggy source:
@Override public void modifyText(ModifyEvent e){
  boolean enable=(instanceNameText.getText().length() > 0) && (!instanceNameText.getText().trim().equals("String_Node_Str"));
  RoleAssignmentDialog.this.getButton(IDialogConstants.OK_ID).setEnabled(enable);
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  boolean enable=(instanceNameText.getText().length() > 0) && (!instanceNameText.getText().trim().equals("String_Node_Str"));
  RoleAssignmentDialog.this.getButton(IDialogConstants.OK_ID).setEnabled(enable);
}
Program: 148549
Project: 148549
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;
  }
  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;
}

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>)viewableViewer.getViewer().getInput();
  if (input != null && input.size() == 0) {
    MessageDialog.openError(this.getSite().getShell(),"String_Node_Str","String_Node_Str");
    return false;
  }
  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: 148550
Project: 148550
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(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);
  }
}

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);
    manager.add(setAnnotationNoAction);
  }
  java.util.List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
  for (  IAvailableModel model : availablemodels) {
    model.fillContextMenu(obj,manager,this,dataModelName);
  }
}
Program: 148551
Project: 148551
Buggy source:
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);
  }
}

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);
    manager.add(setAnnotationNoAction);
  }
  java.util.List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
  for (  IAvailableModel model : availablemodels) {
    model.fillContextMenu(obj,manager,this,dataModelName);
  }
}
Program: 148553
Project: 148553
Buggy source:
@AfterClass public static void sleep(){
  System.out.println("String_Node_Str");
  bot.sleep(2000);
}

Fixed version (ground truth):
protected static void sleep(){
  bot.sleep(1000);
}
Program: 148554
Project: 148554
Buggy source:
@Test public void canSetRoleMenu() throws Exception {
  SWTBotTreeItem node=serverTree.expandNode("String_Node_Str").getNode("String_Node_Str");
  node.expand();
  node=node.expandNode("String_Node_Str").getNode("String_Node_Str");
  node.doubleClick();
  final SWTBotEditor editor=bot.editorByTitle("String_Node_Str");
  bot.getDisplay().syncExec(new Runnable(){
    public void run(){
      XObjectEditor ep=(XObjectEditor)editor.getReference().getPart(true);
      DataModelMainPage mainpage=(DataModelMainPage)ep.getPage(0);
      Tree conceptTree=mainpage.getTreeViewer().getTree();
      SWTBotTree tree=new SWTBotTree(conceptTree);
      SWTBotTreeItem node=tree.getTreeItem("String_Node_Str");
      node.expand();
      node.getNode(0).expand();
      SWTBotTreeItem userNode=node.getNode(0).getNode("String_Node_Str");
      userNode.contextMenu("String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
@Test public void canSetRoleMenu() throws Exception {
  SWTBotTreeItem node=serverTree.expandNode("String_Node_Str").getNode("String_Node_Str");
  node.expand();
  node=node.expandNode("String_Node_Str").getNode("String_Node_Str");
  node.doubleClick();
  final SWTBotEditor editor=bot.editorByTitle("String_Node_Str");
  XObjectEditor ep=(XObjectEditor)editor.getReference().getPart(true);
  DataModelMainPage mainpage=(DataModelMainPage)ep.getPage(0);
  Tree conceptTree=mainpage.getTreeViewer().getTree();
  SWTBotTree tree=new SWTBotTree(conceptTree);
  SWTBotTreeItem node1=tree.getTreeItem("String_Node_Str");
  node1.expand();
  node1.getNode(0).expand();
  SWTBotTreeItem userNode=node1.getNode(0).getNode("String_Node_Str");
  userNode.setFocus();
  SWTBotMenu ctxMenu=userNode.select().contextMenu("String_Node_Str").click();
  SWTBotShell newViewShell=bot.shell("String_Node_Str");
  newViewShell.activate();
  sleep();
  bot.button("String_Node_Str").click();
  sleep();
  ctxMenu=userNode.select().contextMenu("String_Node_Str").click();
  sleep();
  bot.button("String_Node_Str").click();
  sleep();
  ctxMenu=userNode.select().contextMenu("String_Node_Str").click();
  sleep();
  bot.button("String_Node_Str").click();
  sleep();
}
Program: 148555
Project: 148555
Buggy source:
@Test public void canCreateView() throws Exception {
  SWTBotTreeItem viewNode=serverTree.expandNode("String_Node_Str").getNode("String_Node_Str");
  viewNode.contextMenu("String_Node_Str").click();
  SWTBotShell newViewShell=bot.shell("String_Node_Str");
  newViewShell.activate();
  bot.buttonWithTooltip("String_Node_Str").click();
  bot.shell("String_Node_Str").activate();
  bot.comboBoxWithLabel("String_Node_Str").setSelection("String_Node_Str");
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  bot.sleep(1000);
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  bot.sleep(1000);
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  bot.sleep(1000);
  bot.comboBoxWithLabel("String_Node_Str").setSelection("String_Node_Str");
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  bot.sleep(1000);
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  bot.sleep(1000);
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  bot.sleep(1000);
  bot.button("String_Node_Str").click();
  bot.button("String_Node_Str").click();
}

Fixed version (ground truth):
@Test public void canCreateView() throws Exception {
  SWTBotTreeItem viewNode=serverTree.expandNode("String_Node_Str").getNode("String_Node_Str");
  viewNode.contextMenu("String_Node_Str").click();
  SWTBotShell newViewShell=bot.shell("String_Node_Str");
  newViewShell.activate();
  bot.buttonWithTooltip("String_Node_Str").click();
  bot.shell("String_Node_Str").activate();
  bot.comboBoxWithLabel("String_Node_Str").setSelection("String_Node_Str");
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  sleep();
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  sleep();
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  sleep();
  bot.comboBoxWithLabel("String_Node_Str").setSelection("String_Node_Str");
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  sleep();
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  sleep();
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  sleep();
  bot.button("String_Node_Str").click();
  sleep();
  bot.button("String_Node_Str").click();
}
Program: 148556
Project: 148556
Buggy source:
@Test public void canCreateView() throws Exception {
  SWTBotTreeItem viewNode=serverTree.expandNode("String_Node_Str").getNode("String_Node_Str");
  viewNode.contextMenu("String_Node_Str").click();
  bot.shell("String_Node_Str").activate();
  bot.buttonWithLabel("String_Node_Str").click();
  bot.shell("String_Node_Str").activate();
}

Fixed version (ground truth):
@Test public void canCreateView() throws Exception {
  SWTBotTreeItem viewNode=serverTree.expandNode("String_Node_Str").getNode("String_Node_Str");
  viewNode.contextMenu("String_Node_Str").click();
  SWTBotShell newViewShell=bot.shell("String_Node_Str");
  newViewShell.activate();
  bot.buttonWithTooltip("String_Node_Str").click();
  bot.shell("String_Node_Str").activate();
  bot.comboBoxWithLabel("String_Node_Str").setSelection("String_Node_Str");
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  bot.sleep(1000);
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  bot.sleep(1000);
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  bot.sleep(1000);
  bot.comboBoxWithLabel("String_Node_Str").setSelection("String_Node_Str");
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  bot.sleep(1000);
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  bot.sleep(1000);
  bot.textWithLabel("String_Node_Str").setText("String_Node_Str");
  bot.sleep(1000);
  bot.button("String_Node_Str").click();
  bot.button("String_Node_Str").click();
}
Program: 148558
Project: 148558
Buggy source:
public void addAnnotion(XSDAnnotationsStructure struc,XSDAnnotation xsdannotationparent){
  Map infor=new HashMap<String,ArrayList<String>>();
  infor=cloneXSDAnnotation(xsdannotationparent);
  Set keys=infor.keySet();
  for (int i=0; i < infor.size(); i++) {
    ArrayList<String> lists=(ArrayList<String>)infor.get(keys.toArray()[i]);
    try {
      struc.setAccessRole(lists,false,(IStructuredContentProvider)page.getTreeViewer().getContentProvider(),(String)keys.toArray()[i]);
    }
 catch (    XtentisException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void addAnnotion(XSDAnnotationsStructure struc,XSDAnnotation xsdannotationparent){
  Map infor=new HashMap<String,ArrayList<String>>();
  infor=cloneXSDAnnotation(xsdannotationparent);
  Set keys=infor.keySet();
  for (int i=0; i < infor.size(); i++) {
    ArrayList<String> lists=(ArrayList<String>)infor.get(keys.toArray()[i]);
    try {
      struc.setAccessRole(lists,false,(IStructuredContentProvider)page.getTreeViewer().getContentProvider(),(String)keys.toArray()[i]);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 148559
Project: 148559
Buggy source:
public void addAnnotion(XSDAnnotationsStructure struc,XSDAnnotation xsdannotationparent){
  Map infor=new HashMap<String,ArrayList<String>>();
  infor=cloneXSDAnnotation(xsdannotationparent);
  Set keys=infor.keySet();
  for (int i=0; i < infor.size(); i++) {
    ArrayList<String> lists=(ArrayList<String>)infor.get(keys.toArray()[i]);
    try {
      struc.setAccessRole(lists,false,(IStructuredContentProvider)page.getTreeViewer().getContentProvider(),(String)keys.toArray()[i]);
    }
 catch (    XtentisException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void addAnnotion(XSDAnnotationsStructure struc,XSDAnnotation xsdannotationparent){
  Map infor=new HashMap<String,ArrayList<String>>();
  infor=cloneXSDAnnotation(xsdannotationparent);
  Set keys=infor.keySet();
  for (int i=0; i < infor.size(); i++) {
    ArrayList<String> lists=(ArrayList<String>)infor.get(keys.toArray()[i]);
    try {
      struc.setAccessRole(lists,false,(IStructuredContentProvider)page.getTreeViewer().getContentProvider(),(String)keys.toArray()[i]);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 148561
Project: 148561
Buggy source:
public static Object[] getAllObject(Object elem,ArrayList<Object> objList,IStructuredContentProvider provider){
  Object[] elems=provider.getElements(elem);
  for (  Object obj : elems) {
    if (obj == null)     continue;
    if (!objList.contains(obj)) {
      objList.add(obj);
      getAllObject(obj,objList,provider);
    }
 else {
      continue;
    }
  }
  return objList.toArray();
}

Fixed version (ground truth):
public static Object[] getAllObject(Object elem,List<Object> objList,IStructuredContentProvider provider){
  Object[] elems=provider.getElements(elem);
  for (  Object obj : elems) {
    if (obj == null)     continue;
    if (obj instanceof XSDModelGroup || obj instanceof XSDElementDeclaration || obj instanceof XSDParticle|| obj instanceof XSDTypeDefinition) {
      if (!objList.contains(obj)) {
        objList.add(obj);
        getAllObject(obj,objList,provider);
      }
    }
  }
  return objList.toArray();
}
Program: 148562
Project: 148562
Buggy source:
public static boolean IsAImporedElement(XSDConcreteComponent component,XSDSchema schema){
  if (component == null)   return true;
  List<String> buffer=new ArrayList<String>();
  buffer=retrieveXSDComponentPath(component,schema,buffer);
  String path="String_Node_Str";
  for (int i=buffer.size() - 1; i >= 0; i--) {
    if (path.lastIndexOf(buffer.get(i)) == -1)     path+=buffer.get(i);
  }
  try {
    NodeList l=Util.getNodeList(schema.getDocument(),path);
    if (l.getLength() > 0)     return false;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return true;
}

Fixed version (ground truth):
public static boolean IsAImporedElement(XSDConcreteComponent component,String schema){
  if (component == null)   return true;
  String componentName=getComponentName(component);
  try {
    String xsd=schema;
    if (xsd.indexOf(componentName) != -1) {
      return false;
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return true;
}