nus-yam/ex-repair huggingface dataset:
Program: 148660
Project: 148660
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str" + IConstants.TALEND + "String_Node_Str","String_Node_Str".equals(username) ? 12 : 9);
  try {
switch (parentObject.getType()) {
case TreeObject.WORKFLOW:
      objectName="String_Node_Str";
    break;
case TreeObject.JOB_REGISTRY:
  objectName="String_Node_Str";
break;
}
XtentisPort port=Util.getPort(new URL(endpointaddress),universe,username,password);
parentObject.getServerRoot().removeChild(parentObject);
List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
for (IAvailableModel model : availablemodels) {
if (model.toString().indexOf(objectName) > 0) {
model.addTreeObjects(port,monitor,parentObject.getServerRoot());
}
}
}
 catch (MalformedURLException e) {
e.printStackTrace();
}
catch (XtentisException e) {
e.printStackTrace();
}
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str" + IConstants.TALEND + "String_Node_Str","String_Node_Str".equals(username) ? 12 : 9);
  try {
switch (parentObject.getType()) {
case TreeObject.WORKFLOW:
      objectName="String_Node_Str";
    break;
case TreeObject.JOB_REGISTRY:
  objectName="String_Node_Str";
break;
}
XtentisPort port=Util.getPort(new URL(endpointaddress),universe,username,password);
List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
for (IAvailableModel model : availablemodels) {
if (model.toString().indexOf(objectName) > 0) {
parentObject.getServerRoot().removeChildFromUI(parentObject);
model.addTreeObjects(port,monitor,parentObject.getServerRoot());
}
}
}
 catch (MalformedURLException e) {
e.printStackTrace();
}
catch (XtentisException e) {
e.printStackTrace();
}
}
Program: 148661
Project: 148661
Buggy source:
/** 
 * Selection Listener on OK Button
 */
public void widgetSelected(SelectionEvent e){
  int buttonId=((Integer)e.widget.getData()).intValue();
  if (IDialogConstants.OK_ID != buttonId)   return;
  String url=dialog.getServer();
  String username=dialog.getUsernameText();
  String password=dialog.getPasswordText();
  String universe=dialog.getUniverse();
  dialog.close();
  String cmp=Util.checkOnVersionCompatibility(username,password,universe);
  if (cmp != null) {
    MessageDialog.openError(null,"String_Node_Str","String_Node_Str" + cmp);
    return;
  }
  view.initServerTree(url,username,password,universe);
}

Fixed version (ground truth):
/** 
 * Selection Listener on OK Button
 */
public void widgetSelected(SelectionEvent e){
  int buttonId=((Integer)e.widget.getData()).intValue();
  if (IDialogConstants.OK_ID != buttonId)   return;
  String url=dialog.getServer();
  String username=dialog.getUsernameText();
  String password=dialog.getPasswordText();
  String universe=dialog.getUniverse();
  dialog.close();
  String cmp=Util.checkOnVersionCompatibility(url,username,password,universe);
  if (cmp != null) {
    MessageDialog.openError(null,"String_Node_Str","String_Node_Str" + cmp);
    return;
  }
  view.initServerTree(url,username,password,universe);
}
Program: 148663
Project: 148663
Buggy source:
public static String checkOnVersionCompatibility(String username,String password,String universe){
  IProduct product=Platform.getProduct();
  String versionComp="String_Node_Str";
  try {
    URL resourceURL=product.getDefiningBundle().getResource("String_Node_Str");
    PropertyResourceBundle bundle=new PropertyResourceBundle(resourceURL.openStream());
    String studioVersion=bundle.getString("String_Node_Str").trim();
    Pattern vsnPtn=Pattern.compile("String_Node_Str");
    Matcher match=vsnPtn.matcher(studioVersion);
    if (!match.find()) {
      return null;
    }
    versionComp="String_Node_Str" + studioVersion + "String_Node_Str";
    int major=Integer.parseInt(match.group(1));
    int minor=Integer.parseInt(match.group(2));
    int rev=match.group(4) != null && !match.group(4).equals("String_Node_Str") ? Integer.parseInt(match.group(4)) : 0;
    XtentisPort port=Util.getPort(universe,username,password);
    WSVersion wsVersion=port.getComponentVersion(new WSGetComponentVersion(WSComponent.DataManager,null));
    versionComp+="String_Node_Str" + wsVersion.getMajor() + "String_Node_Str"+ wsVersion.getMinor()+ "String_Node_Str"+ wsVersion.getRevision();
    if (major != wsVersion.getMajor() || minor != wsVersion.getMinor())     return versionComp;
    if (rev == 0) {
      if (wsVersion.getRevision() != 0)       return versionComp;
    }
  }
 catch (  Exception e) {
  }
  return null;
}

Fixed version (ground truth):
public static String checkOnVersionCompatibility(String url,String username,String password,String universe){
  IProduct product=Platform.getProduct();
  String versionComp="String_Node_Str";
  try {
    URL resourceURL=product.getDefiningBundle().getResource("String_Node_Str");
    PropertyResourceBundle bundle=new PropertyResourceBundle(resourceURL.openStream());
    String studioVersion=bundle.getString("String_Node_Str").trim();
    Pattern vsnPtn=Pattern.compile("String_Node_Str");
    Matcher match=vsnPtn.matcher(studioVersion);
    if (!match.find()) {
      return null;
    }
    versionComp="String_Node_Str" + studioVersion + "String_Node_Str";
    int major=Integer.parseInt(match.group(1));
    int minor=Integer.parseInt(match.group(2));
    int rev=match.group(4) != null && !match.group(4).equals("String_Node_Str") ? Integer.parseInt(match.group(4)) : 0;
    XtentisPort port=Util.getPort(new URL(url),universe,username,password);
    WSVersion wsVersion=port.getComponentVersion(new WSGetComponentVersion(WSComponent.DataManager,null));
    versionComp+="String_Node_Str" + wsVersion.getMajor() + "String_Node_Str"+ wsVersion.getMinor()+ "String_Node_Str"+ wsVersion.getRevision();
    if (major != wsVersion.getMajor() || minor != wsVersion.getMinor())     return versionComp;
    if (rev == 0) {
      if (wsVersion.getRevision() != 0)       return versionComp;
    }
  }
 catch (  Exception e) {
  }
  return null;
}
Program: 148666
Project: 148666
Buggy source:
private void importClusterContents(TreeObject item,XtentisPort port){
  if (dataClusterContent.containsKey(item.getDisplayName())) {
    FileReader reader;
    String[] paths=dataClusterContent.get(item.getDisplayName());
    for (int i=0; i < paths.length; i++) {
      try {
        String path=paths[i];
        reader=new FileReader(importFolder + "String_Node_Str" + path);
        WSItem wsItem=(WSItem)Unmarshaller.unmarshal(WSItem.class,reader);
        if (wsItem.getDataModelName() == null) {
        }
 else {
          port.putItem(new WSPutItem(wsItem.getWsDataClusterPK(),wsItem.getContent(),new WSDataModelPK(wsItem.getDataModelName()),false));
        }
      }
 catch (      Exception e1) {
        e1.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
private void importClusterContents(TreeObject item,XtentisPort port){
  if (dataClusterContent.containsKey(item.getDisplayName())) {
    FileReader reader=null;
    String[] paths=dataClusterContent.get(item.getDisplayName());
    for (int i=0; i < paths.length; i++) {
      try {
        String path=paths[i];
        reader=new FileReader(importFolder + "String_Node_Str" + path);
        WSItem wsItem=(WSItem)Unmarshaller.unmarshal(WSItem.class,reader);
        if (wsItem.getDataModelName() == null) {
        }
 else {
          port.putItem(new WSPutItem(wsItem.getWsDataClusterPK(),wsItem.getContent(),new WSDataModelPK(wsItem.getDataModelName()),false));
        }
      }
 catch (      Exception e1) {
        e1.printStackTrace();
      }
 finally {
        try {
          if (reader != null)           reader.close();
        }
 catch (        Exception e) {
        }
      }
    }
  }
}
Program: 148669
Project: 148669
Buggy source:
public void forceAllSiteToRefresh(){
  TreeObject[] childs=getTreeContentProvider().getInvisibleRoot().getChildren();
  for (  TreeObject child : childs) {
    (new ServerRefreshAction(this,child.getServerRoot())).run();
  }
}

Fixed version (ground truth):
public void forceAllSiteToRefresh(){
}
Program: 148670
Project: 148670
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();
  }
 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);
    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();
  }
}
Program: 148671
Project: 148671
Buggy source:
public static String getResponseFromURL(String url,TreeObject treeObj) throws Exception {
  BASE64Encoder encoder=new BASE64Encoder();
  StringBuffer buffer=new StringBuffer();
  String credentials=encoder.encode(new String(treeObj.getServerRoot().getUsername() + "String_Node_Str" + treeObj.getServerRoot().getPassword()).getBytes());
  URL urlCn=new URL(url);
  URLConnection conn=urlCn.openConnection();
  conn.setAllowUserInteraction(true);
  conn.setDoOutput(true);
  conn.setDoInput(true);
  conn.setRequestProperty("String_Node_Str","String_Node_Str" + credentials);
  conn.setRequestProperty("String_Node_Str","String_Node_Str");
  InputStreamReader doc=new InputStreamReader(conn.getInputStream());
  BufferedReader reader=new BufferedReader(doc);
  String line=reader.readLine();
  while (line != null) {
    buffer.append(line);
    line=reader.readLine();
  }
  return buffer.toString();
}

Fixed version (ground truth):
public static String getResponseFromURL(String url,TreeObject treeObj) throws Exception {
  InputStreamReader doc=null;
  try {
    BASE64Encoder encoder=new BASE64Encoder();
    StringBuffer buffer=new StringBuffer();
    String credentials=encoder.encode(new String(treeObj.getServerRoot().getUsername() + "String_Node_Str" + treeObj.getServerRoot().getPassword()).getBytes());
    URL urlCn=new URL(url);
    URLConnection conn=urlCn.openConnection();
    conn.setAllowUserInteraction(true);
    conn.setDoOutput(true);
    conn.setDoInput(true);
    conn.setRequestProperty("String_Node_Str","String_Node_Str" + credentials);
    conn.setRequestProperty("String_Node_Str","String_Node_Str");
    doc=new InputStreamReader(conn.getInputStream());
    BufferedReader reader=new BufferedReader(doc);
    String line=reader.readLine();
    while (line != null) {
      buffer.append(line);
      line=reader.readLine();
    }
    return buffer.toString();
  }
  finally {
    if (doc != null)     doc.close();
  }
}
Program: 148672
Project: 148672
Buggy source:
public static Document parse(String fileName) throws DocumentException {
  InputStream is=null;
  is=XmlUtil.class.getResourceAsStream("String_Node_Str" + fileName);
  Document document=parse(is);
  return document;
}

Fixed version (ground truth):
public static Document parse(String fileName) throws DocumentException {
  InputStream is=null;
  try {
    is=XmlUtil.class.getResourceAsStream("String_Node_Str" + fileName);
    Document document=parse(is);
    return document;
  }
  finally {
    if (is != null)     try {
      is.close();
    }
 catch (    IOException e) {
    }
  }
}
Program: 148675
Project: 148675
Buggy source:
private void dropTargetHandleDrop(DropTargetEvent event){
  TreeObject remoteObj=(TreeObject)event.item.getData();
  TreeParent parent=null;
  if (remoteObj instanceof TreeParent)   parent=(TreeParent)remoteObj;
 else   parent=remoteObj.getParent();
  if (parent.getParent().getType() == TreeObject.RESOURCES)   return;
  ArrayList<TreeObject> subDdnList=new ArrayList<TreeObject>();
  if (parent != null) {
    for (    TreeObject xobj : dndTreeObjs) {
      if (xobj.getServerRoot().getDisplayName().equals(remoteObj.getServerRoot().getDisplayName())) {
        if (xobj.getParent() != remoteObj.getParent() && remoteObj.isXObject()) {
          subDdnList.add(xobj);
        }
 else         if (xobj.getParent() != remoteObj && remoteObj instanceof TreeParent) {
          subDdnList.add(xobj);
        }
      }
    }
    dndTreeObjs.removeAll(subDdnList);
  }
  transformCatalog(remoteObj,subDdnList);
  if (!dndTreeObjs.isEmpty()) {
    WorkbenchClipboard.getWorkbenchClipboard().get().clear();
    WorkbenchClipboard.getWorkbenchClipboard().get().addAll(dndTreeObjs);
    ((PasteXObjectAction)pasteAction).setXtentisPort(remoteObj);
    ((PasteXObjectAction)pasteAction).setParent(remoteObj instanceof TreeParent ? (TreeParent)remoteObj : remoteObj.getParent());
    pasteAction.run();
  }
}

Fixed version (ground truth):
private void dropTargetHandleDrop(DropTargetEvent event){
  TreeObject remoteObj=(TreeObject)event.item.getData();
  TreeParent parent=null;
  if (remoteObj instanceof TreeParent)   parent=(TreeParent)remoteObj;
 else   parent=remoteObj.getParent();
  if (parent.getParent().getType() == TreeObject.RESOURCES)   return;
  ArrayList<TreeObject> subDdnList=new ArrayList<TreeObject>();
  if (parent != null) {
    for (    TreeObject xobj : dndTreeObjs) {
      if (xobj.getServerRoot().getDisplayName().equals(remoteObj.getServerRoot().getDisplayName())) {
        if (xobj.getParent() != remoteObj.getParent() && remoteObj.isXObject()) {
          subDdnList.add(xobj);
        }
 else         if (xobj.getParent() != remoteObj && remoteObj instanceof TreeParent) {
          subDdnList.add(xobj);
        }
        if (xobj.getType() == TreeObject.JOB || xobj.getType() == TreeObject.WORKFLOW_PROCESS)         subDdnList.add(xobj);
      }
    }
    dndTreeObjs.removeAll(subDdnList);
  }
  transformCatalog(remoteObj,subDdnList);
  if (!dndTreeObjs.isEmpty()) {
    WorkbenchClipboard.getWorkbenchClipboard().get().clear();
    WorkbenchClipboard.getWorkbenchClipboard().get().addAll(dndTreeObjs);
    ((PasteXObjectAction)pasteAction).setXtentisPort(remoteObj);
    ((PasteXObjectAction)pasteAction).setParent(remoteObj instanceof TreeParent ? (TreeParent)remoteObj : remoteObj.getParent());
    pasteAction.run();
  }
}
Program: 148676
Project: 148676
Buggy source:
public static XSDSchema createXsdSchema(String xsd,TreeObject treeObj) throws Exception {
  List<XSDImport> imports=new ArrayList<XSDImport>();
  List<Exception> exceptons=new ArrayList<Exception>();
  Map<String,Integer> schemaMonitor=new HashMap<String,Integer>();
  Document doc=Util.parse(xsd);
  XSDSchema xsdSchema=Util.getXSDSchema(xsd,imports,treeObj,false,exceptons,schemaMonitor);
  if (exceptons.size() > 0) {
    throw exceptons.get(0);
  }
 else   if (schemaMonitor.containsValue(new Integer(-1))) {
    throw new Exception("String_Node_Str");
  }
  Map<String,String> nsMap=xsdSchema.getQNamePrefixToNamespaceMap();
  int imp=0;
  for (  XSDImport xsdImport : imports) {
    String ns=xsdImport.getNamespace();
    if (ns.equals("String_Node_Str"))     continue;
    int last=ns.lastIndexOf("String_Node_Str");
    if (!nsMap.containsValue(ns)) {
      if (ns.equals("String_Node_Str")) {
        nsMap.put("String_Node_Str",ns);
      }
 else {
        nsMap.put(ns.substring(last + 1).replaceAll("String_Node_Str","String_Node_Str"),ns);
      }
    }
    boolean exist=false;
    for (    XSDSchemaContent cnt : xsdSchema.getContents()) {
      if (cnt instanceof XSDImportImpl) {
        XSDImportImpl cntImpl=(XSDImportImpl)cnt;
        if (cntImpl.getNamespace().equals(xsdImport.getNamespace())) {
          exist=true;
          break;
        }
      }
    }
    if (!exist) {
      xsdSchema.getContents().add(imp++,xsdImport);
    }
  }
  xsdSchema.updateElement();
  return xsdSchema;
}

Fixed version (ground truth):
public static XSDSchema createXsdSchema(String xsd,TreeObject treeObj) throws Exception {
  List<XSDImport> imports=new ArrayList<XSDImport>();
  List<Exception> exceptons=new ArrayList<Exception>();
  Map<String,Integer> schemaMonitor=new HashMap<String,Integer>();
  XSDSchema xsdSchema=Util.getXSDSchema(xsd,imports,treeObj,false,exceptons,schemaMonitor);
  if (exceptons.size() > 0) {
    throw exceptons.get(0);
  }
 else   if (schemaMonitor.containsValue(new Integer(-1))) {
    throw new Exception("String_Node_Str");
  }
  Map<String,String> nsMap=xsdSchema.getQNamePrefixToNamespaceMap();
  int imp=0;
  for (  XSDImport xsdImport : imports) {
    String ns=xsdImport.getNamespace();
    if (ns.equals("String_Node_Str"))     continue;
    int last=ns.lastIndexOf("String_Node_Str");
    if (!nsMap.containsValue(ns)) {
      if (ns.equals("String_Node_Str")) {
        nsMap.put("String_Node_Str",ns);
      }
 else {
        nsMap.put(ns.substring(last + 1).replaceAll("String_Node_Str","String_Node_Str"),ns);
      }
    }
    boolean exist=false;
    for (    XSDSchemaContent cnt : xsdSchema.getContents()) {
      if (cnt instanceof XSDImportImpl) {
        XSDImportImpl cntImpl=(XSDImportImpl)cnt;
        if (cntImpl.getNamespace().equals(xsdImport.getNamespace())) {
          exist=true;
          break;
        }
      }
    }
    if (!exist) {
      xsdSchema.getContents().add(imp++,xsdImport);
    }
  }
  xsdSchema.updateElement();
  return xsdSchema;
}
Program: 148677
Project: 148677
Buggy source:
/** 
 * LOCAL FILE UTILS
 */
public static String getXML(String filename) throws Exception {
  BufferedReader in=null;
  in=new BufferedReader(new InputStreamReader(new FileInputStream(filename),"String_Node_Str"));
  String xml="String_Node_Str";
  String line;
  while ((line=in.readLine()) != null)   xml+=line + "String_Node_Str";
  return xml;
}

Fixed version (ground truth):
/** 
 * LOCAL FILE UTILS
 */
public static String getXML(String filename) throws Exception {
  InputStream in=null;
  try {
    in=new FileInputStream(filename);
    return IOUtils.toString(in);
  }
  finally {
    if (in != null)     in.close();
  }
}
Program: 148679
Project: 148679
Buggy source:
@Override public void run(){
  ISelection selection=view.getViewer().getSelection();
  TreeObject xobject=(TreeObject)((IStructuredSelection)selection).getFirstElement();
  try {
    if (TreeObjectUtil.renameTreeOjects(xobject,view))     TreeObjectUtil.deleteTreeObject(xobject,view);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  ISelection selection=view.getViewer().getSelection();
  TreeObject xobject=(TreeObject)((IStructuredSelection)selection).getFirstElement();
  this.page=view.getSite().getWorkbenchWindow().getActivePage();
  page.closeEditor(page.findEditor(new XObjectEditorInput(xobject,xobject.getDisplayName())),true);
  try {
    if (TreeObjectUtil.renameTreeOjects(xobject,view))     TreeObjectUtil.deleteTreeObject(xobject,view);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 148682
Project: 148682
Buggy source:
protected WSWhereOperator(java.lang.String value){
  this.value=value;
  valueMap.put(this.toString(),this);
}

Fixed version (ground truth):
public WSWhereOperator(){
}
Program: 148683
Project: 148683
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str" + IConstants.TALEND + "String_Node_Str","String_Node_Str".equals(username) ? 12 : 9);
  try {
switch (parentObject.getType()) {
case TreeObject.WORKFLOW:
      objectName="String_Node_Str";
    break;
case TreeObject.JOB_REGISTRY:
  objectName="String_Node_Str";
break;
}
XtentisPort port=Util.getPort(new URL(endpointaddress),universe,username,password);
List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
for (IAvailableModel model : availablemodels) {
if (model.toString().indexOf(objectName) > 0) {
parentObject.getServerRoot().removeChildFromUI(parentObject);
model.addTreeObjects(port,monitor,parentObject.getServerRoot());
}
}
}
 catch (MalformedURLException e) {
e.printStackTrace();
}
catch (XtentisException e) {
e.printStackTrace();
}
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str" + IConstants.TALEND + "String_Node_Str","String_Node_Str".equals(username) ? 12 : 9);
  try {
switch (parentObject.getType()) {
case TreeObject.WORKFLOW:
      objectName="String_Node_Str";
    break;
case TreeObject.JOB_REGISTRY:
  objectName="String_Node_Str";
break;
}
XtentisPort port=Util.getPort(new URL(endpointaddress),universe,username,password);
parentObject.getServerRoot().removeChildFromUI(parentObject);
List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
for (IAvailableModel model : availablemodels) {
if (model.toString().indexOf(objectName) > 0) {
model.addTreeObjects(port,monitor,parentObject.getServerRoot());
}
}
}
 catch (MalformedURLException e) {
e.printStackTrace();
}
catch (XtentisException e) {
e.printStackTrace();
}
}
Program: 148684
Project: 148684
Buggy source:
public void makeUpDocWithImportCategory(String[] schemas,TreeParent serverRoot){
  Document orgDoc=credentials.get(UnifyUrl(serverRoot.getServerRoot().getWsKey().toString())).doc;
  spareDoc=(Document)orgDoc.clone();
  if (schemas != null) {
    for (    String schema : schemas) {
      Element subRoot=parseElements(schema);
      String subRootXquery="String_Node_Str" + subRoot.getName() + "String_Node_Str"+ subRoot.getTextTrim()+ "String_Node_Str";
      Element division=pingElement(subRootXquery,spareDoc.getRootElement());
      if (division == null || division.getParent() == null)       return;
      Element divisionParent=division.getParent();
      divisionParent.remove(division);
      divisionParent.add((Element)subRoot.clone());
    }
    String url=getURLFromTreeObject(serverRoot);
    String Universe=getUniverseFromTreeObject(serverRoot);
    String urlXquery="String_Node_Str" + url + "String_Node_Str";
    List<Element> elems=spareDoc.selectNodes(urlXquery);
    for (    Element elem : elems) {
      elem.attributeValue("String_Node_Str",url);
      elem.attributeValue("String_Node_Str",Universe);
    }
  }
  credentials.get(UnifyUrl(serverRoot.getServerRoot().getWsKey().toString())).doc=spareDoc;
  spareDoc=orgDoc;
  importCategories=schemas;
}

Fixed version (ground truth):
public void makeUpDocWithImportCategory(String[] schemas,TreeParent serverRoot){
  Document orgDoc=credentials.get(UnifyUrl(serverRoot.getServerRoot().getWsKey().toString())).doc;
  spareDoc=(Document)orgDoc.clone();
  if (schemas != null) {
    for (    String schema : schemas) {
      Element subRoot=parseElements(schema);
      String subRootXquery="String_Node_Str" + subRoot.getName() + "String_Node_Str"+ subRoot.getTextTrim()+ "String_Node_Str";
      Element division=pingElement(subRootXquery,spareDoc.getRootElement());
      if (division == null || division.getParent() == null)       return;
      Element divisionParent=division.getParent();
      divisionParent.remove(division);
      divisionParent.add((Element)subRoot.clone());
    }
    String url=getURLFromTreeObject(serverRoot);
    String Universe=getUniverseFromTreeObject(serverRoot);
    String urlXquery="String_Node_Str" + url + "String_Node_Str";
    List<Element> elems=spareDoc.selectNodes(urlXquery);
    for (    Element elem : elems) {
      elem.addAttribute("String_Node_Str",url);
      elem.addAttribute("String_Node_Str",Universe);
    }
  }
  credentials.get(UnifyUrl(serverRoot.getServerRoot().getWsKey().toString())).doc=spareDoc;
  spareDoc=orgDoc;
  importCategories=schemas;
}
Program: 148689
Project: 148689
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str" + IConstants.TALEND + "String_Node_Str","String_Node_Str".equals(username) ? 12 : 9);
  try {
switch (parentObject.getType()) {
case TreeObject.WORKFLOW:
      objectName="String_Node_Str";
    break;
case TreeObject.JOB_REGISTRY:
  objectName="String_Node_Str";
break;
}
XtentisPort port=Util.getPort(new URL(endpointaddress),universe,username,password);
parentObject.getServerRoot().removeChild(parentObject);
List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
for (IAvailableModel model : availablemodels) {
if (model.toString().indexOf(objectName) > 0) {
model.addTreeObjects(port,monitor,parentObject.getServerRoot());
}
}
}
 catch (MalformedURLException e) {
e.printStackTrace();
}
catch (XtentisException e) {
e.printStackTrace();
}
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str" + IConstants.TALEND + "String_Node_Str","String_Node_Str".equals(username) ? 12 : 9);
  try {
switch (parentObject.getType()) {
case TreeObject.WORKFLOW:
      objectName="String_Node_Str";
    break;
case TreeObject.JOB_REGISTRY:
  objectName="String_Node_Str";
break;
}
XtentisPort port=Util.getPort(new URL(endpointaddress),universe,username,password);
List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
for (IAvailableModel model : availablemodels) {
if (model.toString().indexOf(objectName) > 0) {
parentObject.getServerRoot().removeChildForUI(parentObject);
model.addTreeObjects(port,monitor,parentObject.getServerRoot());
}
}
}
 catch (MalformedURLException e) {
e.printStackTrace();
}
catch (XtentisException e) {
e.printStackTrace();
}
}
Program: 148690
Project: 148690
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str" + IConstants.TALEND + "String_Node_Str","String_Node_Str".equals(username) ? 12 : 9);
  try {
switch (parentObject.getType()) {
case TreeObject.WORKFLOW:
      objectName="String_Node_Str";
    break;
case TreeObject.JOB_REGISTRY:
  objectName="String_Node_Str";
break;
}
XtentisPort port=Util.getPort(new URL(endpointaddress),universe,username,password);
List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
for (IAvailableModel model : availablemodels) {
if (model.toString().indexOf(objectName) > 0) {
parentObject.getServerRoot().removeChildForUI(parentObject);
model.addTreeObjects(port,monitor,parentObject.getServerRoot());
}
}
}
 catch (MalformedURLException e) {
e.printStackTrace();
}
catch (XtentisException e) {
e.printStackTrace();
}
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("String_Node_Str" + IConstants.TALEND + "String_Node_Str","String_Node_Str".equals(username) ? 12 : 9);
  try {
switch (parentObject.getType()) {
case TreeObject.WORKFLOW:
      objectName="String_Node_Str";
    break;
case TreeObject.JOB_REGISTRY:
  objectName="String_Node_Str";
break;
}
XtentisPort port=Util.getPort(new URL(endpointaddress),universe,username,password);
parentObject.getServerRoot().removeChild(parentObject);
List<IAvailableModel> availablemodels=AvailableModelUtil.getAvailableModels();
for (IAvailableModel model : availablemodels) {
if (model.toString().indexOf(objectName) > 0) {
model.addTreeObjects(port,monitor,parentObject.getServerRoot());
}
}
}
 catch (MalformedURLException e) {
e.printStackTrace();
}
catch (XtentisException e) {
e.printStackTrace();
}
}
Program: 148693
Project: 148693
Buggy source:
public static List<Object> getKeyInfo(Object key){
  if (!((key instanceof XSDElementDeclaration))) {
    return null;
  }
  List<Object> list=new ArrayList<Object>();
  Object parent=getParent(key);
  if (parent != null && parent instanceof XSDElementDeclaration) {
    XSDElementDeclaration top=(XSDElementDeclaration)parent;
    EList<XSDIdentityConstraintDefinition> idtylist=top.getIdentityConstraintDefinitions();
    for (    XSDIdentityConstraintDefinition idty : idtylist) {
      EList<XSDXPathDefinition> fields=idty.getFields();
      for (      XSDXPathDefinition path : fields) {
        if (path.getValue().equals(((XSDElementDeclaration)key).getName())) {
          list.add(idty);
          list.add(path);
          return list;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public static List<Object> getKeyInfo(Object key){
  if (!((key instanceof XSDElementDeclaration))) {
    return null;
  }
  return getTopParent(key);
}
Program: 148695
Project: 148695
Buggy source:
@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) {
      try {
        ZipToFile.zipFile(exportFolder,zipfile);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
      ZipToFile.deleteDirectory(new File(exportFolder));
    }
  }
}

Fixed version (ground truth):
@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));
    }
  }
}
Program: 148697
Project: 148697
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) {
          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()) {
    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;
}
Program: 148702
Project: 148702
Buggy source:
public void run(){
  try {
    if (forcedRoot == null)     serverRoot=(TreeParent)((IStructuredSelection)view.getViewer().getSelection()).getFirstElement();
 else     serverRoot=forcedRoot;
    if (serverRoot == null)     return;
    server=(String)serverRoot.getWsKey();
    XtentisServerObjectsRetriever retriever=new XtentisServerObjectsRetriever(server,serverRoot.getUsername(),serverRoot.getPassword(),serverRoot.getUser().getUniverse(),view);
    new ProgressMonitorDialog(view.getSite().getShell()).run(true,true,retriever);
    ServerRefreshAction.this.serverRoot.synchronizeWith(retriever.getServerRoot());
    ServerView.show().getViewer().refresh();
    LocalTreeObjectRepository.getInstance().setLazySaveStrategy(false,serverRoot);
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(view.getSite().getShell(),"String_Node_Str","String_Node_Str" + IConstants.TALEND + "String_Node_Str"+ e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    doRun();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(view.getSite().getShell(),"String_Node_Str","String_Node_Str" + IConstants.TALEND + "String_Node_Str"+ e.getLocalizedMessage());
  }
}
Program: 148703
Project: 148703
Buggy source:
@Override public IStatus runInUIThread(IProgressMonitor monitor){
  try {
    Cursor wait=new Cursor(getViewSite().getShell().getDisplay(),SWT.CURSOR_WAIT);
    viewer.getControl().setCursor(wait);
    new ServerRefreshAction(view,serverRoot).run();
    viewer.expandToLevel(serverRoot,1);
    viewer.getControl().setCursor(new Cursor(getViewSite().getShell().getDisplay(),SWT.CURSOR_ARROW));
    return Status.OK_STATUS;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return Status.CANCEL_STATUS;
  }
}

Fixed version (ground truth):
@Override public IStatus runInUIThread(IProgressMonitor monitor){
  try {
    Cursor wait=new Cursor(getViewSite().getShell().getDisplay(),SWT.CURSOR_WAIT);
    viewer.getControl().setCursor(wait);
    new ServerRefreshAction(view,serverRoot).doRun();
    viewer.expandToLevel(serverRoot,1);
    return Status.OK_STATUS;
  }
 catch (  Exception e) {
    e.printStackTrace();
    viewer.collapseToLevel(serverRoot,1);
    return Status.CANCEL_STATUS;
  }
 finally {
    viewer.getControl().setCursor(new Cursor(getViewSite().getShell().getDisplay(),SWT.CURSOR_ARROW));
  }
}
Program: 148704
Project: 148704
Buggy source:
/** 
 * @author ymli; fix the bug:0012600. made the refresh as a job run underground
 * @param view
 * @param serverRoot
 * @return
 */
public boolean refreshServerRoot(final ServerView view,final TreeParent serverRoot){
  UIJob job=new UIJob("String_Node_Str"){
    @Override public IStatus runInUIThread(    IProgressMonitor monitor){
      try {
        Cursor wait=new Cursor(getViewSite().getShell().getDisplay(),SWT.CURSOR_WAIT);
        viewer.getControl().setCursor(wait);
        new ServerRefreshAction(view,serverRoot).run();
        viewer.expandToLevel(serverRoot,1);
        viewer.getControl().setCursor(new Cursor(getViewSite().getShell().getDisplay(),SWT.CURSOR_ARROW));
        return Status.OK_STATUS;
      }
 catch (      Exception e) {
        e.printStackTrace();
        return Status.CANCEL_STATUS;
      }
    }
  }
;
  job.setPriority(Job.LONG);
  job.schedule();
  return true;
}

Fixed version (ground truth):
/** 
 * @author ymli; fix the bug:0012600. made the refresh as a job run underground
 * @param view
 * @param serverRoot
 * @return
 */
public boolean refreshServerRoot(final ServerView view,final TreeParent serverRoot){
  UIJob job=new UIJob("String_Node_Str"){
    @Override public IStatus runInUIThread(    IProgressMonitor monitor){
      try {
        Cursor wait=new Cursor(getViewSite().getShell().getDisplay(),SWT.CURSOR_WAIT);
        viewer.getControl().setCursor(wait);
        new ServerRefreshAction(view,serverRoot).doRun();
        viewer.expandToLevel(serverRoot,1);
        return Status.OK_STATUS;
      }
 catch (      Exception e) {
        e.printStackTrace();
        viewer.collapseToLevel(serverRoot,1);
        return Status.CANCEL_STATUS;
      }
 finally {
        viewer.getControl().setCursor(new Cursor(getViewSite().getShell().getDisplay(),SWT.CURSOR_ARROW));
      }
    }
  }
;
  job.setPriority(Job.LONG);
  job.schedule();
  return true;
}
Program: 148705
Project: 148705
Buggy source:
protected void commit(){
  try {
    WSDataModel wsObject=(WSDataModel)(getXObject().getWsObject());
    wsObject.setDescription(descriptionText.getText() == null ? "String_Node_Str" : descriptionText.getText());
    String 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));
  }
}

Fixed version (ground truth):
protected void commit(){
  save(null);
}
Program: 148706
Project: 148706
Buggy source:
public void validateSchema() throws IllegalAccessException {
  final String maxoccurs_omit="String_Node_Str";
  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 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();
}
Program: 148707
Project: 148707
Buggy source:
@Override public void doSave(IProgressMonitor progressMonitor){
  WSDataModel wsObject=(WSDataModel)(xobject.getWsObject());
  IDocument doc=((XMLEditorInput)this.getEditorInput()).getDocument();
  String schema=doc.get();
  wsObject.setXsdSchema(Util.formatXsdSource(schema));
  setModified(true);
  SaveXObjectAction action=new SaveXObjectAction(editor);
  action.run();
  state=action.getState();
  super.doSave(progressMonitor);
}

Fixed version (ground truth):
@Override public void doSave(IProgressMonitor progressMonitor){
  IDocument doc=((XMLEditorInput)this.getEditorInput()).getDocument();
  String schema=doc.get();
  DataModelMainPage page=(DataModelMainPage)editor.formPages.get(0);
  page.setXsdSchema(null);
  int ret=page.save(schema);
  if (ret != 0)   return;
  setModified(true);
  SaveXObjectAction action=new SaveXObjectAction(editor);
  action.run();
  state=action.getState();
  super.doSave(progressMonitor);
}
Program: 148708
Project: 148708
Buggy source:
private void saveDocument(String url){
  if (credentials.get(url) != null) {
    XtentisPort port=credentials.get(url).port;
    Document doc=credentials.get(url).doc;
    try {
      port.getMDMCategory(new WSCategoryData(doc.asXML()));
    }
 catch (    RemoteException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private void saveDocument(String url){
  if (credentials.get(url) != null) {
    XtentisPort port=credentials.get(url).port;
    Document doc=credentials.get(url).doc;
    if (doc != null) {
      try {
        port.getMDMCategory(new WSCategoryData(doc.asXML()));
      }
 catch (      RemoteException e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 148709
Project: 148709
Buggy source:
protected void commit(){
  try {
    WSDataModel wsObject=(WSDataModel)(getXObject().getWsObject());
    wsObject.setDescription(descriptionText.getText() == null ? "String_Node_Str" : descriptionText.getText());
    String schema=((XSDTreeContentProvider)viewer.getContentProvider()).getXSDSchemaAsString();
    schema=schema.replaceAll("String_Node_Str","String_Node_Str");
    schema=schema.replaceAll("String_Node_Str","String_Node_Str");
    schema=Util.convertBaseType(schema);
    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()));
    }
    XMLEditor xmleditor=(getEditor()).getXmlEditor();
    xmleditor.refresh(getXObject());
  }
 catch (  Exception e) {
    e.printStackTrace();
    ErrorExceptionDialog.openError(this.getSite().getShell(),"String_Node_Str",CommonUtil.getErrMsgFromException(e));
  }
}

Fixed version (ground truth):
protected void commit(){
  try {
    WSDataModel wsObject=(WSDataModel)(getXObject().getWsObject());
    wsObject.setDescription(descriptionText.getText() == null ? "String_Node_Str" : descriptionText.getText());
    String schema=((XSDTreeContentProvider)viewer.getContentProvider()).getXSDSchemaAsString();
    schema=schema.replaceAll("String_Node_Str","String_Node_Str");
    schema=schema.replaceAll("String_Node_Str","String_Node_Str");
    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));
  }
}
Program: 148712
Project: 148712
Buggy source:
public void selectionChanged(SelectionChangedEvent e){
  StructuredSelection sel=(StructuredSelection)e.getSelection();
  xpath=getXpath(sel);
  xpathText.setText(xpath);
  getButton(IDialogConstants.OK_ID).setEnabled(xpath.length() > 0);
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent e){
  StructuredSelection sel=(StructuredSelection)e.getSelection();
  xpath=getXpath(sel);
  xpathText.setText(xpath);
  if (getButton(IDialogConstants.OK_ID) != null)   getButton(IDialogConstants.OK_ID).setEnabled(xpath.length() > 0);
}
Program: 148713
Project: 148713
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)) {
        conceptElement=el;
      }
      if (((el.getTargetNamespace() != null && !el.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) || (el.getTargetNamespace() == null)))       list.add(el);
    }
  }
  return list.toArray();
}
Program: 148715
Project: 148715
Buggy source:
private boolean checkMandatoryElement(Object obj){
  if (obj instanceof XSDParticle)   if (((XSDParticle)obj).getMinOccurs() > 0)   return false;
  return true;
}

Fixed version (ground truth):
private boolean checkMandatoryElement(Object[] objArray){
  for (  Object obj : objArray) {
    if (obj instanceof XSDParticle)     if (((XSDParticle)obj).getMinOccurs() > 0)     return false;
 else     continue;
  }
  return true;
}