nus-yam/ex-repair huggingface dataset:
Program: 128238
Project: 128238
Buggy source:
private boolean pageComplete(){
  if (parentWizardPage instanceof SelectorTableWizardPage) {
    List<MetadataTable> list=new ArrayList<MetadataTable>();
    Set<MetadataTable> oldTables=((SelectorTableWizardPage)parentWizardPage).getOldTables();
    Set<MetadataTable> tables=ConnectionHelper.getTables(getConnection());
    if (oldTables != null && oldTables.size() > 0) {
      for (      MetadataTable table : tables) {
        boolean found=false;
        for (        MetadataTable oldtable : oldTables) {
          if (table != null && oldtable != null && table.getLabel().equals(oldtable.getLabel())) {
            found=true;
            break;
          }
        }
        if (table != null && !found) {
          list.add(table);
        }
      }
    }
 else {
      list.addAll(tables);
    }
    if (forTemplate && list.size() <= 0) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean pageComplete(){
  if (parentWizardPage instanceof SelectorTableWizardPage) {
    List<MetadataTable> list=new ArrayList<MetadataTable>();
    Set<MetadataTable> oldTables=((SelectorTableWizardPage)parentWizardPage).getOldTables();
    Set<MetadataTable> tables=ConnectionHelper.getTables(getConnection());
    if (oldTables != null && oldTables.size() > 0) {
      for (      MetadataTable table : tables) {
        boolean found=false;
        for (        MetadataTable oldtable : oldTables) {
          if (table != null && oldtable != null && table.getLabel().equals(oldtable.getLabel())) {
            found=true;
            break;
          }
        }
        if (table != null && !found) {
          list.add(table);
        }
      }
    }
 else {
      list.addAll(tables);
    }
    if (forTemplate || list.size() <= 0) {
      return true;
    }
  }
  return false;
}
Program: 128239
Project: 128239
Buggy source:
public void run(){
  if (errorMessage.equals("String_Node_Str")) {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str",newValue,originalValue == null ? "String_Node_Str" : originalValue.toString()));
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText(originalValue == null ? "String_Node_Str" : originalValue.toString());
    text.setSelection(selection.x,selection.y);
  }
 else {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),errorMessage);
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText("String_Node_Str");
    text.setSelection(selection.x,selection.y);
  }
}

Fixed version (ground truth):
public void run(){
  if (errorMessage.equals("String_Node_Str")) {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str",newValue,originalValue == null ? "String_Node_Str" : originalValue.toString()));
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText(originalValue == null ? "String_Node_Str" : originalValue.toString());
    text.setSelection(selection.x,selection.y);
  }
 else {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),errorMessage);
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText(originalValue == null ? "String_Node_Str" : originalValue.toString());
    text.setSelection(selection.x,selection.y);
  }
}
Program: 128242
Project: 128242
Buggy source:
public Property loadProperty(IResource iResource){
  URI propertyUri=URIHelper.convert(iResource.getFullPath());
  URI itemResourceURI=getItemResourceURI(propertyUri);
  List<Resource> resources=new ArrayList<Resource>(resourceSet.getResources());
  for (  Resource res : resources) {
    if (res != null) {
      if (propertyUri.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
      if (itemResourceURI.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
    }
  }
  Resource propertyResource=resourceSet.getResource(propertyUri,true);
  Property property=(Property)EcoreUtil.getObjectByType(propertyResource.getContents(),PropertiesPackage.eINSTANCE.getProperty());
  return property;
}

Fixed version (ground truth):
public synchronized Property loadProperty(IResource iResource){
  URI propertyUri=URIHelper.convert(iResource.getFullPath());
  URI itemResourceURI=getItemResourceURI(propertyUri);
  List<Resource> resources=new ArrayList<Resource>(resourceSet.getResources());
  for (  Resource res : resources) {
    if (res != null) {
      if (propertyUri.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
      if (itemResourceURI.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
    }
  }
  Resource propertyResource=resourceSet.getResource(propertyUri,true);
  Property property=(Property)EcoreUtil.getObjectByType(propertyResource.getContents(),PropertiesPackage.eINSTANCE.getProperty());
  return property;
}
Program: 128243
Project: 128243
Buggy source:
public void run(){
  if (errorMessage.equals("String_Node_Str")) {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str",newValue,originalValue == null ? "String_Node_Str" : originalValue.toString()));
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText(originalValue == null ? "String_Node_Str" : originalValue.toString());
    text.setSelection(selection.x,selection.y);
  }
 else {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),errorMessage);
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText("String_Node_Str");
    text.setSelection(selection.x,selection.y);
  }
}

Fixed version (ground truth):
public void run(){
  if (errorMessage.equals("String_Node_Str")) {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str",newValue,originalValue == null ? "String_Node_Str" : originalValue.toString()));
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText(originalValue == null ? "String_Node_Str" : originalValue.toString());
    text.setSelection(selection.x,selection.y);
  }
 else {
    MessageDialog.openError(text.getShell(),Messages.getString("String_Node_Str"),errorMessage);
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    text.setText(originalValue == null ? "String_Node_Str" : originalValue.toString());
    text.setSelection(selection.x,selection.y);
  }
}
Program: 128245
Project: 128245
Buggy source:
public Property loadProperty(IResource iResource){
  URI propertyUri=URIHelper.convert(iResource.getFullPath());
  URI itemResourceURI=getItemResourceURI(propertyUri);
  List<Resource> resources=new ArrayList<Resource>(resourceSet.getResources());
  for (  Resource res : resources) {
    if (res != null) {
      if (propertyUri.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
      if (itemResourceURI.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
    }
  }
  Resource propertyResource=resourceSet.getResource(propertyUri,true);
  Property property=(Property)EcoreUtil.getObjectByType(propertyResource.getContents(),PropertiesPackage.eINSTANCE.getProperty());
  return property;
}

Fixed version (ground truth):
public synchronized Property loadProperty(IResource iResource){
  URI propertyUri=URIHelper.convert(iResource.getFullPath());
  URI itemResourceURI=getItemResourceURI(propertyUri);
  List<Resource> resources=new ArrayList<Resource>(resourceSet.getResources());
  for (  Resource res : resources) {
    if (res != null) {
      if (propertyUri.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
      if (itemResourceURI.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
    }
  }
  Resource propertyResource=resourceSet.getResource(propertyUri,true);
  Property property=(Property)EcoreUtil.getObjectByType(propertyResource.getContents(),PropertiesPackage.eINSTANCE.getProperty());
  return property;
}
Program: 128249
Project: 128249
Buggy source:
/** 
 * Substitutes an element of a string with a replacement element. {talendTypes} String {Category} StringHandling {param} string("hello world!") oldStr: The whole string. {param} string("world") newStr: Regx. {param} string("guy") replacement: Replacement. {example} EREPLACE("hello world!","world","guy") # hello world
 */
public static String EREPLACE(String oldStr,String newStr,String replacement){
  if (oldStr == null || newStr == null || replacement == null)   return oldStr;
 else   return oldStr.replaceAll(newStr,replacement);
}

Fixed version (ground truth):
/** 
 * Substitutes an element of a string with a replacement element. {talendTypes} String {Category} StringHandling {param} string("hello world!") oldStr: The whole string. {param} string("world") newStr: Regx. {param} string("guy") replacement: Replacement. {example} EREPLACE("hello world!","world","guy") # hello world
 */
public static String EREPLACE(String oldStr,String newStr,String replacement){
  return CHANGE(oldStr,newStr,replacement);
}
Program: 128251
Project: 128251
Buggy source:
/** 
 * Substitutes an element of a string with a replacement element. {talendTypes} String {Category} StringHandling {param} string("hello world!") oldStr: The whole string. {param} string("world") newStr: Regx. {param} string("guy") replacement: Replacement. {example} EREPLACE("hello world!","world","guy") # hello world
 */
public static String EREPLACE(String oldStr,String newStr,String replacement){
  if (oldStr == null || newStr == null || replacement == null)   return oldStr;
 else   return oldStr.replaceAll(newStr,replacement);
}

Fixed version (ground truth):
/** 
 * Substitutes an element of a string with a replacement element. {talendTypes} String {Category} StringHandling {param} string("hello world!") oldStr: The whole string. {param} string("world") newStr: Regx. {param} string("guy") replacement: Replacement. {example} EREPLACE("hello world!","world","guy") # hello world
 */
public static String EREPLACE(String oldStr,String newStr,String replacement){
  return CHANGE(oldStr,newStr,replacement);
}
Program: 128253
Project: 128253
Buggy source:
/** 
 * Substitutes an element of a string with a replacement element. {talendTypes} String {Category} StringHandling {param} string("hello world!") oldStr: The whole string. {param} string("world") newStr: Regx. {param} string("guy") replacement: Replacement. {example} EREPLACE("hello world!","world","guy") # hello world
 */
public static String EREPLACE(String oldStr,String newStr,String replacement){
  if (oldStr == null || newStr == null || replacement == null)   return oldStr;
 else   return oldStr.replaceAll(newStr,replacement);
}

Fixed version (ground truth):
/** 
 * Substitutes an element of a string with a replacement element. {talendTypes} String {Category} StringHandling {param} string("hello world!") oldStr: The whole string. {param} string("world") newStr: Regx. {param} string("guy") replacement: Replacement. {example} EREPLACE("hello world!","world","guy") # hello world
 */
public static String EREPLACE(String oldStr,String newStr,String replacement){
  return CHANGE(oldStr,newStr,replacement);
}
Program: 128257
Project: 128257
Buggy source:
/** 
 * ggu Comment method "getEBCDICFieldValue".
 */
private static Object getEBCDICFieldValue(EbcdicConnection connection,String value){
  if ("String_Node_Str".equals(value)) {
    if (isContextMode(connection,connection.getDataFile())) {
      return connection.getDataFile();
    }
 else {
      Path p=new Path("String_Node_Str");
      if (connection.getDataFile() != null) {
        p=new Path(connection.getDataFile());
      }
      return TalendQuoteUtils.addQuotes(p.toPortableString());
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * ggu Comment method "getEBCDICFieldValue".
 */
private static Object getEBCDICFieldValue(EbcdicConnection connection,String value){
  if ("String_Node_Str".equals(value)) {
    if (isContextMode(connection,connection.getDataFile())) {
      return connection.getDataFile();
    }
 else {
      Path p=new Path("String_Node_Str");
      if (connection.getDataFile() != null) {
        p=new Path(connection.getDataFile());
      }
      return TalendQuoteUtils.addQuotes(p.toPortableString());
    }
  }
  if ("String_Node_Str".equals(value)) {
    if (connection.getCodePage() == null) {
      return null;
    }
    if (isContextMode(connection,connection.getCodePage())) {
      return connection.getCodePage();
    }
 else {
      Path p=new Path("String_Node_Str");
      if (connection.getCodePage() != null) {
        p=new Path(connection.getCodePage());
      }
      return TalendQuoteUtils.addQuotes(p.toPortableString());
    }
  }
  return null;
}
Program: 128259
Project: 128259
Buggy source:
/** 
 * ggu Comment method "getEBCDICFieldValue".
 */
private static Object getEBCDICFieldValue(EbcdicConnection connection,String value){
  if ("String_Node_Str".equals(value)) {
    if (isContextMode(connection,connection.getDataFile())) {
      return connection.getDataFile();
    }
 else {
      Path p=new Path("String_Node_Str");
      if (connection.getDataFile() != null) {
        p=new Path(connection.getDataFile());
      }
      return TalendQuoteUtils.addQuotes(p.toPortableString());
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * ggu Comment method "getEBCDICFieldValue".
 */
private static Object getEBCDICFieldValue(EbcdicConnection connection,String value){
  if ("String_Node_Str".equals(value)) {
    if (isContextMode(connection,connection.getDataFile())) {
      return connection.getDataFile();
    }
 else {
      Path p=new Path("String_Node_Str");
      if (connection.getDataFile() != null) {
        p=new Path(connection.getDataFile());
      }
      return TalendQuoteUtils.addQuotes(p.toPortableString());
    }
  }
  if ("String_Node_Str".equals(value)) {
    if (connection.getCodePage() == null) {
      return null;
    }
    if (isContextMode(connection,connection.getCodePage())) {
      return connection.getCodePage();
    }
 else {
      Path p=new Path("String_Node_Str");
      if (connection.getCodePage() != null) {
        p=new Path(connection.getCodePage());
      }
      return TalendQuoteUtils.addQuotes(p.toPortableString());
    }
  }
  return null;
}
Program: 128260
Project: 128260
Buggy source:
/** 
 * ggu Comment method "getEBCDICFieldValue".
 */
private static Object getEBCDICFieldValue(EbcdicConnection connection,String value){
  if ("String_Node_Str".equals(value)) {
    if (isContextMode(connection,connection.getDataFile())) {
      return connection.getDataFile();
    }
 else {
      Path p=new Path("String_Node_Str");
      if (connection.getDataFile() != null) {
        p=new Path(connection.getDataFile());
      }
      return TalendQuoteUtils.addQuotes(p.toPortableString());
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * ggu Comment method "getEBCDICFieldValue".
 */
private static Object getEBCDICFieldValue(EbcdicConnection connection,String value){
  if ("String_Node_Str".equals(value)) {
    if (isContextMode(connection,connection.getDataFile())) {
      return connection.getDataFile();
    }
 else {
      Path p=new Path("String_Node_Str");
      if (connection.getDataFile() != null) {
        p=new Path(connection.getDataFile());
      }
      return TalendQuoteUtils.addQuotes(p.toPortableString());
    }
  }
  if ("String_Node_Str".equals(value)) {
    if (connection.getCodePage() == null) {
      return null;
    }
    if (isContextMode(connection,connection.getCodePage())) {
      return connection.getCodePage();
    }
 else {
      Path p=new Path("String_Node_Str");
      if (connection.getCodePage() != null) {
        p=new Path(connection.getCodePage());
      }
      return TalendQuoteUtils.addQuotes(p.toPortableString());
    }
  }
  return null;
}
Program: 128261
Project: 128261
Buggy source:
public Resource getReferenceFileResource(Resource itemResource,String extension,boolean needLoad){
  URI referenceFileURI=getReferenceFileURI(itemResource.getURI(),extension);
  URIConverter converter=resourceSet.getURIConverter();
  Resource referenceResource=new ByteArrayResource(referenceFileURI);
  InputStream inputStream=null;
  List<Resource> resources=new ArrayList<Resource>(resourceSet.getResources());
  for (  Resource res : resources) {
    if (res != null && referenceFileURI.toString().equals(res.getURI().toString())) {
      res.unload();
      resourceSet.getResources().remove(res);
    }
  }
  resourceSet.getResources().add(referenceResource);
  try {
    if (needLoad) {
      inputStream=converter.createInputStream(referenceFileURI);
      referenceResource.load(inputStream,null);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    try {
      if (inputStream != null) {
        inputStream.close();
      }
    }
 catch (    IOException e) {
      ExceptionHandler.process(e);
    }
  }
  return referenceResource;
}

Fixed version (ground truth):
public Resource getReferenceFileResource(Resource itemResource,ReferenceFileItem refFile,boolean needLoad){
  URI referenceFileURI=getReferenceFileURI(itemResource.getURI(),refFile.getExtension());
  URIConverter converter=resourceSet.getURIConverter();
  Resource referenceResource=new ByteArrayResource(referenceFileURI);
  InputStream inputStream=null;
  List<Resource> resources=new ArrayList<Resource>(resourceSet.getResources());
  if (refFile.isReloadFromFile()) {
    for (    Resource res : resources) {
      if (res != null && referenceFileURI.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
    }
    resourceSet.getResources().add(referenceResource);
    try {
      if (needLoad) {
        inputStream=converter.createInputStream(referenceFileURI);
        referenceResource.load(inputStream,null);
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
 finally {
      try {
        if (inputStream != null) {
          inputStream.close();
        }
      }
 catch (      IOException e) {
        ExceptionHandler.process(e);
      }
    }
  }
 else {
    referenceResource=resourceSet.getResource(referenceFileURI,true);
  }
  return referenceResource;
}
Program: 128262
Project: 128262
Buggy source:
private static void populateRoot(ATreeNode root,ATreeNode selectedNode){
  Object[] toBeIterated=root.getChildren();
  for (int i=0; i < toBeIterated.length; i++) {
    ATreeNode node=((ATreeNode)toBeIterated[i]);
    Object nodeValue=node.getValue();
    if (nodeValue != null && !nodeValue.equals(selectedNode.getValue()) && !nodeValue.equals(selectedNode.getDataType())) {
      continue;
    }
    Object value=node.getDataType();
    List container=new ArrayList();
    findNodeWithValue(root,value.toString(),container,new VisitingRecorder());
    for (int j=0; j < container.size(); j++) {
      if (((ATreeNode)container.get(j)).getChildren().length == 0) {
        Object[] os=((ATreeNode)toBeIterated[i]).getChildren();
        for (int k=0; k < os.length; k++) {
          if (os[k] instanceof ATreeNode) {
            if (!(((ATreeNode)os[k]).getDataType() != null && ((ATreeNode)os[k]).getDataType().equals(((ATreeNode)container.get(j)).getDataType()))) {
              ((ATreeNode)container.get(j)).addChild(os[k]);
            }
          }
        }
      }
    }
    break;
  }
}

Fixed version (ground truth):
private static void populateRoot(ATreeNode root,ATreeNode selectedNode){
  Object[] toBeIterated=root.getChildren();
  for (  Object element : toBeIterated) {
    ATreeNode node=((ATreeNode)element);
    Object nodeValue=node.getValue();
    if (nodeValue != null && !nodeValue.equals(selectedNode.getValue()) && !nodeValue.equals(selectedNode.getDataType())) {
      continue;
    }
    Object value=node.getDataType();
    List container=new ArrayList();
    findNodeWithValue(root,value.toString(),container,new VisitingRecorder());
    for (int j=0; j < container.size(); j++) {
      if (((ATreeNode)container.get(j)).getChildren().length == 0) {
        Object[] os=((ATreeNode)element).getChildren();
        for (int k=0; k < os.length; k++) {
          if (os[k] instanceof ATreeNode) {
            if (!(((ATreeNode)os[k]).getDataType() != null && ((ATreeNode)os[k]).getDataType().equals(((ATreeNode)container.get(j)).getDataType()))) {
              ((ATreeNode)container.get(j)).addChild(os[k]);
            }
          }
        }
      }
    }
    break;
  }
}
Program: 128263
Project: 128263
Buggy source:
/** 
 * Return the tree node instance that represents to the ComplexElement that featured by the given value.
 * @param root the tree node from which the search begin
 * @param value the name of the ComplexElement
 * @return
 */
private static ATreeNode findComplexElement(ATreeNode root,String value){
  Object[] os=root.getChildren();
  for (int i=0; i < os.length; i++) {
    if (((ATreeNode)os[i]).getValue().equals(value)) {
      return (ATreeNode)os[i];
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return the tree node instance that represents to the ComplexElement that featured by the given value.
 * @param root the tree node from which the search begin
 * @param value the name of the ComplexElement
 * @return
 */
private static ATreeNode findComplexElement(ATreeNode root,String value){
  Object[] os=root.getChildren();
  for (  Object element : os) {
    if (((ATreeNode)element).getValue().equals(value)) {
      return (ATreeNode)element;
    }
  }
  return null;
}
Program: 128264
Project: 128264
Buggy source:
public synchronized void wakeup(){
  notify();
}

Fixed version (ground truth):
@Override public synchronized void wakeup(){
  notify();
}
Program: 128265
Project: 128265
Buggy source:
/** 
 * Starting from a tree node, find all nodes with given value, and put it to container.
 * @param root
 * @param value
 * @param container
 */
private static void findNodeWithValue(ATreeNode root,String value,List container,VisitingRecorder vr){
  if (root.getType() == ATreeNode.ELEMENT_TYPE && !vr.visit(root.getValue().toString())) {
    return;
  }
  if (root.getDataType() != null && root.getDataType().equals(value)) {
    container.add(root);
  }
  Object[] children=root.getChildren();
  for (int i=0; i < children.length; i++) {
    if (children[i] instanceof ATreeNode) {
      findNodeWithValue((ATreeNode)children[i],value,container,vr);
    }
  }
}

Fixed version (ground truth):
/** 
 * Starting from a tree node, find all nodes with given value, and put it to container.
 * @param root
 * @param value
 * @param container
 */
private static void findNodeWithValue(ATreeNode root,String value,List container,VisitingRecorder vr){
  if (root.getType() == ATreeNode.ELEMENT_TYPE && !vr.visit(root.getValue().toString())) {
    return;
  }
  if (root.getDataType() != null && root.getDataType().equals(value)) {
    container.add(root);
  }
  Object[] children=root.getChildren();
  for (  Object element : children) {
    if (element instanceof ATreeNode) {
      findNodeWithValue((ATreeNode)element,value,container,vr);
    }
  }
}
Program: 128266
Project: 128266
Buggy source:
public void detectNewRow(String path,String prefix,String uri,boolean start){
}

Fixed version (ground truth):
@Override public void detectNewRow(String path,String prefix,String uri,boolean start){
}
Program: 128267
Project: 128267
Buggy source:
public void manipulateData(String path,String value){
}

Fixed version (ground truth):
@Override public void manipulateData(String path,String value){
}
Program: 128269
Project: 128269
Buggy source:
public XSDSchema getXSDSchema(String fileName) throws URISyntaxException, MalformedURLException {
  XSDResourceImpl mainXsdResource=(XSDResourceImpl)resourceSet.getResource(URI.createFileURI(fileName),true);
  boolean haveExternalDependenciesWithoutLocation=false;
  for (  Resource resource : resourceSet.getResources()) {
    if (resource instanceof XSDResourceImpl) {
      XSDResourceImpl xsdResource=(XSDResourceImpl)resource;
      for (      EObject object : xsdResource.getSchema().getContents()) {
        if (object instanceof XSDImport) {
          XSDImport xsdImport=(XSDImport)object;
          if (StringUtils.isEmpty(xsdImport.getSchemaLocation())) {
            for (            Resource resource2 : resourceSet.getResources()) {
              if (resource2 instanceof XSDResourceImpl) {
                XSDResourceImpl xsdResource2=(XSDResourceImpl)resource2;
                if (xsdResource2.getSchema().getTargetNamespace() != null && xsdResource2.getSchema().getTargetNamespace().equals(xsdImport.getNamespace())) {
                  xsdImport.setSchemaLocation(xsdResource2.getSchema().getSchemaLocation());
                  haveExternalDependenciesWithoutLocation=true;
                }
              }
            }
          }
        }
      }
    }
  }
  XSDSchema xsdSchema=mainXsdResource.getSchema();
  if (haveExternalDependenciesWithoutLocation) {
    xsdSchema.setElement(xsdSchema.getDocument().getDocumentElement());
  }
  return xsdSchema;
}

Fixed version (ground truth):
public XSDSchema getXSDSchema(String fileName,boolean forceReload) throws URISyntaxException, MalformedURLException {
  XSDResourceImpl mainXsdResource=(XSDResourceImpl)resourceSet.getResource(URI.createFileURI(fileName),true);
  boolean haveExternalDependenciesWithoutLocation=false;
  for (  Resource resource : resourceSet.getResources()) {
    if (resource instanceof XSDResourceImpl) {
      XSDResourceImpl xsdResource=(XSDResourceImpl)resource;
      for (      EObject object : xsdResource.getSchema().getContents()) {
        if (object instanceof XSDImport) {
          XSDImport xsdImport=(XSDImport)object;
          if (StringUtils.isEmpty(xsdImport.getSchemaLocation())) {
            for (            Resource resource2 : resourceSet.getResources()) {
              if (resource2 instanceof XSDResourceImpl) {
                XSDResourceImpl xsdResource2=(XSDResourceImpl)resource2;
                if (xsdResource2.getSchema().getTargetNamespace() != null && xsdResource2.getSchema().getTargetNamespace().equals(xsdImport.getNamespace())) {
                  xsdImport.setSchemaLocation(xsdResource2.getSchema().getSchemaLocation());
                  haveExternalDependenciesWithoutLocation=true;
                }
              }
            }
          }
        }
      }
    }
  }
  XSDSchema xsdSchema=mainXsdResource.getSchema();
  if (forceReload || haveExternalDependenciesWithoutLocation) {
    xsdSchema.setElement(xsdSchema.getDocument().getDocumentElement());
  }
  return xsdSchema;
}
Program: 128272
Project: 128272
Buggy source:
public static List<FOXTreeNode> getFoxTreeNodesByRootNode(XSDSchema xsdSchema,ATreeNode selectedRootNode,boolean resolved,boolean supportChoice,boolean supportSubstitution){
  List<FOXTreeNode> list=new ArrayList<FOXTreeNode>();
  if (xsdSchema == null || selectedRootNode == null) {
    return list;
  }
  ATreeNode treeNode=null;
  try {
    if (resolved) {
      treeNode=selectedRootNode;
    }
 else {
      treeNode=SchemaPopulationUtil.getSchemaTree(xsdSchema,selectedRootNode,supportChoice,supportSubstitution);
    }
    if (treeNode == null) {
      return list;
    }
    String rootName="String_Node_Str";
    if (treeNode.getValue() instanceof String) {
      rootName+="String_Node_Str" + treeNode.getValue();
    }
    FOXTreeNode root=cloneATreeNode(treeNode,rootName);
    if (root instanceof Element) {
      root.setParent(null);
      list.add(root);
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  return list;
}

Fixed version (ground truth):
public static List<FOXTreeNode> getFoxTreeNodesByRootNode(XSDSchema xsdSchema,ATreeNode selectedRootNode,boolean resolved,boolean supportChoice,boolean supportSubstitution){
  return getFoxTreeNodesByRootNode(null,xsdSchema,selectedRootNode,resolved,supportChoice,supportSubstitution);
}
Program: 128273
Project: 128273
Buggy source:
public static List<FOXTreeNode> parseMDMUpdateReport(Shell shell,boolean needConfirm){
  boolean fileExist=false;
  String filePath="String_Node_Str";
  try {
    Bundle b=Platform.getBundle("String_Node_Str");
    if (b == null)     return null;
    URL fileUrl=FileLocator.find(b,new Path("String_Node_Str"),null);
    if (fileUrl == null) {
      return null;
    }
    URL url=FileLocator.toFileURL(fileUrl);
    if (url != null) {
      filePath=copyToTempFile(url,"String_Node_Str");
      fileExist=true;
    }
  }
 catch (  IOException e) {
    fileExist=false;
  }
  if (!fileExist) {
    return null;
  }
  boolean pass=true;
  if (needConfirm) {
    pass=MessageDialog.openConfirm(shell,"String_Node_Str","String_Node_Str");
  }
  if (pass) {
    try {
      if (XmlUtil.isXSDFile(filePath)) {
        XSDSchema xsdSchema=getXSDSchema(filePath);
        List<ATreeNode> allTreeNodes=new XSDPopulationUtil2().getAllRootNodes(xsdSchema);
        if (!allTreeNodes.isEmpty()) {
          return getFoxTreeNodesByRootNode(xsdSchema,allTreeNodes.get(0));
        }
      }
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
  }
  return null;
}

Fixed version (ground truth):
public static List<FOXTreeNode> parseMDMUpdateReport(Shell shell,boolean needConfirm){
  boolean fileExist=false;
  String filePath="String_Node_Str";
  try {
    Bundle b=Platform.getBundle("String_Node_Str");
    if (b == null) {
      return null;
    }
    URL fileUrl=FileLocator.find(b,new Path("String_Node_Str"),null);
    if (fileUrl == null) {
      return null;
    }
    URL url=FileLocator.toFileURL(fileUrl);
    if (url != null) {
      filePath=copyToTempFile(url,"String_Node_Str");
      fileExist=true;
    }
  }
 catch (  IOException e) {
    fileExist=false;
  }
  if (!fileExist) {
    return null;
  }
  boolean pass=true;
  if (needConfirm) {
    pass=MessageDialog.openConfirm(shell,"String_Node_Str","String_Node_Str");
  }
  if (pass) {
    try {
      if (XmlUtil.isXSDFile(filePath)) {
        XSDSchema xsdSchema=getXSDSchema(filePath);
        List<ATreeNode> allTreeNodes=new XSDPopulationUtil2().getAllRootNodes(xsdSchema);
        if (!allTreeNodes.isEmpty()) {
          return getFoxTreeNodesByRootNode(xsdSchema,allTreeNodes.get(0));
        }
      }
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
  }
  return null;
}
Program: 128275
Project: 128275
Buggy source:
/** 
 * Sets the dbType.
 * @param dbType the dbType to set
 */
public void setDbType(String dbType){
  if (dbType != null) {
    this.dbType=TextUtil.removeQuots(EDatabaseTypeName.getTypeFromDbType(dbType).getDisplayName());
  }
 else {
    this.dbType="String_Node_Str";
  }
}

Fixed version (ground truth):
/** 
 * Sets the dbType.
 * @param dbType the dbType to set
 */
public void setDbType(String dbType){
  if (dbType != null && !"String_Node_Str".equals(dbType)) {
    this.dbType=TextUtil.removeQuots(EDatabaseTypeName.getTypeFromDbType(dbType).getDisplayName());
  }
 else {
    this.dbType="String_Node_Str";
  }
}
Program: 128277
Project: 128277
Buggy source:
public T next(){
  current=internalListIterator.next();
  return current;
}

Fixed version (ground truth):
@Override public T next(){
  current=internalListIterator.next();
  return current;
}
Program: 128278
Project: 128278
Buggy source:
public void swapElement(T object1,T object2){
  swap(indexOf(object1),indexOf(object2));
}

Fixed version (ground truth):
@Override public void swapElement(T object1,T object2){
  swap(indexOf(object1),indexOf(object2));
}
Program: 128279
Project: 128279
Buggy source:
public int nextIndex(){
  return internalListIterator.nextIndex();
}

Fixed version (ground truth):
@Override public int nextIndex(){
  return internalListIterator.nextIndex();
}
Program: 128280
Project: 128280
Buggy source:
public T remove(int index){
  fireBeforeRemovedEvent(index);
  T removedObject=this.list.remove(index);
  fireRemovedEvent(index,removedObject);
  return removedObject;
}

Fixed version (ground truth):
@Override public T remove(int index){
  fireBeforeRemovedEvent(index);
  T removedObject=this.list.remove(index);
  fireRemovedEvent(index,removedObject);
  return removedObject;
}
Program: 128281
Project: 128281
Buggy source:
private void fireBeforeRemovedEvent(int index){
  if (beforeListeners.size() != 0) {
    T removingObject=this.list.get(index);
    List<T> currentList=new ArrayList<T>(1);
    currentList.add((T)removingObject);
    fireRemovedEvent(index,currentList,null,true);
  }
}

Fixed version (ground truth):
private void fireBeforeRemovedEvent(int index){
  if (beforeListeners.size() != 0) {
    T removingObject=this.list.get(index);
    List<T> currentList=new ArrayList<T>(1);
    currentList.add(removingObject);
    fireRemovedEvent(index,currentList,null,true);
  }
}
Program: 128282
Project: 128282
Buggy source:
public void swapElements(List<Integer> indicesOrigin,List<Integer> indicesTarget){
  if (indicesOrigin.size() != indicesTarget.size()) {
    throw new IllegalArgumentException(Messages.getString("String_Node_Str"));
  }
  ArrayList<T> swapedObjects=new ArrayList<T>();
  fireSwapedEvent(indicesOrigin,indicesTarget,null,true);
  int lstSize=indicesOrigin.size();
  for (int i=0; i < lstSize; i++) {
    Integer idxOrigin=indicesOrigin.get(i);
    Integer idxDestination=indicesTarget.get(i);
    swapedObjects.add(list.get(idxOrigin));
    swapedObjects.add(list.get(idxDestination));
    internalSwap(idxOrigin,idxDestination);
  }
  fireSwapedEvent(indicesOrigin,indicesTarget,swapedObjects.toArray(),false);
}

Fixed version (ground truth):
@Override public void swapElements(List<Integer> indicesOrigin,List<Integer> indicesTarget){
  if (indicesOrigin.size() != indicesTarget.size()) {
    throw new IllegalArgumentException(Messages.getString("String_Node_Str"));
  }
  ArrayList<T> swapedObjects=new ArrayList<T>();
  fireSwapedEvent(indicesOrigin,indicesTarget,null,true);
  int lstSize=indicesOrigin.size();
  for (int i=0; i < lstSize; i++) {
    Integer idxOrigin=indicesOrigin.get(i);
    Integer idxDestination=indicesTarget.get(i);
    swapedObjects.add(list.get(idxOrigin));
    swapedObjects.add(list.get(idxDestination));
    internalSwap(idxOrigin,idxDestination);
  }
  fireSwapedEvent(indicesOrigin,indicesTarget,swapedObjects.toArray(),false);
}
Program: 128283
Project: 128283
Buggy source:
public Iterator<T> iterator(){
  return new Iterator<T>(){
    private Iterator<T> internalIterator=list.iterator();
    private T current=null;
    public boolean hasNext(){
      return internalIterator.hasNext();
    }
    public T next(){
      current=internalIterator.next();
      return current;
    }
    public void remove(){
      Integer indexBeforeRemove=indexOf(current);
      fireBeforeRemovedEvent(indexBeforeRemove);
      internalIterator.remove();
      fireRemovedEvent(indexBeforeRemove,current);
    }
  }
;
}

Fixed version (ground truth):
@Override public Iterator<T> iterator(){
  return new Iterator<T>(){
    private Iterator<T> internalIterator=list.iterator();
    private T current=null;
    @Override public boolean hasNext(){
      return internalIterator.hasNext();
    }
    @Override public T next(){
      current=internalIterator.next();
      return current;
    }
    @Override public void remove(){
      Integer indexBeforeRemove=indexOf(current);
      fireBeforeRemovedEvent(indexBeforeRemove);
      internalIterator.remove();
      fireRemovedEvent(indexBeforeRemove,current);
    }
  }
;
}
Program: 128284
Project: 128284
Buggy source:
/** 
 * Removes each object of the collection from the list and returns whether any object was actually contained by the list.
 * @param collection the collection of objects to be removed.
 * @return whether any object was actually contained by the list.
 */
@SuppressWarnings("String_Node_Str") public boolean removeAll(Collection<?> collection){
  List<Integer> indices=getIndices(collection);
  fireRemovedEvent(null,new ArrayList(collection),indices,true);
  if (this.list == null) {
    return false;
  }
  boolean modified=false;
  for (int i=indices.size(); --i >= 0; ) {
    this.list.remove((int)indices.get(i));
    modified=true;
  }
  if (modified) {
    fireRemovedEvent(null,new ArrayList(collection),indices,false);
  }
  return modified;
}

Fixed version (ground truth):
public boolean removeAll(Collection<?> collection,boolean fireBefore,boolean fireAfter){
  List<Integer> indices=getIndices(collection);
  if (fireBefore) {
    fireRemovedEvent(null,new ArrayList(collection),indices,true);
  }
  if (this.list == null) {
    return false;
  }
  boolean modified=false;
  for (int i=indices.size(); --i >= 0; ) {
    this.list.remove((int)indices.get(i));
    modified=true;
  }
  if (modified && fireAfter) {
    fireRemovedEvent(null,new ArrayList(collection),indices,false);
  }
  return modified;
}
Program: 128285
Project: 128285
Buggy source:
/** 
 * Sets the useEquals.
 * @param useEquals the useEquals to set
 */
public void setUseEquals(boolean useEquals){
  this.useEquals=useEquals;
}

Fixed version (ground truth):
/** 
 * Sets the useEquals.
 * @param useEquals the useEquals to set
 */
@Override public void setUseEquals(boolean useEquals){
  this.useEquals=useEquals;
}
Program: 128286
Project: 128286
Buggy source:
public T get(int index){
  return this.list.get(index);
}

Fixed version (ground truth):
@Override public T get(int index){
  return this.list.get(index);
}
Program: 128287
Project: 128287
Buggy source:
@SuppressWarnings("String_Node_Str") public <T>T[] toArray(T[] a){
  if (this.list != null) {
    return this.list.toArray(a);
  }
 else {
    return (T[])new Object[0];
  }
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T>T[] toArray(T[] a){
  if (this.list != null) {
    return this.list.toArray(a);
  }
 else {
    return (T[])new Object[0];
  }
}
Program: 128288
Project: 128288
Buggy source:
public boolean hasPrevious(){
  return internalListIterator.hasPrevious();
}

Fixed version (ground truth):
@Override public boolean hasPrevious(){
  return internalListIterator.hasPrevious();
}
Program: 128289
Project: 128289
Buggy source:
/** 
 * Returns the position of the first occurrence of the object in the list. This implementation uses either <code>equals</code> or <code>"=="</code> depending on   {@link #isUseEquals useEquals}.
 * @param object the object in question.
 * @return the position of the first occurrence of the object in the list.
 */
public int indexOf(Object object){
  int size=list.size();
  if (useEquals && object != null) {
    for (int i=0; i < size; ++i) {
      if (object.equals(this.list.get(i))) {
        return i;
      }
    }
  }
 else {
    for (int i=0; i < size; ++i) {
      if (this.list.get(i) == object) {
        return i;
      }
    }
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Returns the position of the first occurrence of the object in the list. This implementation uses either <code>equals</code> or <code>"=="</code> depending on   {@link #isUseEquals useEquals}.
 * @param object the object in question.
 * @return the position of the first occurrence of the object in the list.
 */
@Override public int indexOf(Object object){
  int size=list.size();
  if (useEquals && object != null) {
    for (int i=0; i < size; ++i) {
      if (object.equals(this.list.get(i))) {
        return i;
      }
    }
  }
 else {
    for (int i=0; i < size; ++i) {
      if (this.list.get(i) == object) {
        return i;
      }
    }
  }
  return -1;
}
Program: 128290
Project: 128290
Buggy source:
public void add(T o){
  internalListIterator.add(o);
  fireAddedEvent(internalListIterator.previousIndex(),o,false);
}

Fixed version (ground truth):
@Override public void add(T o){
  internalListIterator.add(o);
  fireAddedEvent(internalListIterator.previousIndex(),o,false);
}
Program: 128291
Project: 128291
Buggy source:
public List<T> subList(int fromIndex,int toIndex){
  if (this.list != null) {
    return this.list.subList(fromIndex,toIndex);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public List<T> subList(int fromIndex,int toIndex){
  if (this.list != null) {
    return this.list.subList(fromIndex,toIndex);
  }
 else {
    return null;
  }
}
Program: 128292
Project: 128292
Buggy source:
public T set(int index,T element){
  fireReplacedEvent(index,null,element,true);
  T replacedObject=this.list.set(index,element);
  fireReplacedEvent(index,replacedObject,element,false);
  return replacedObject;
}

Fixed version (ground truth):
@Override public T set(int index,T element){
  fireReplacedEvent(index,null,element,true);
  T replacedObject=this.list.set(index,element);
  fireReplacedEvent(index,replacedObject,element,false);
  return replacedObject;
}
Program: 128293
Project: 128293
Buggy source:
public T previous(){
  current=internalListIterator.previous();
  return current;
}

Fixed version (ground truth):
@Override public T previous(){
  current=internalListIterator.previous();
  return current;
}
Program: 128294
Project: 128294
Buggy source:
public void swap(int index1,int index2){
  ArrayList<Integer> indexList1=new ArrayList<Integer>(1);
  ArrayList<Integer> indexList2=new ArrayList<Integer>(1);
  if (beforeListeners.size() != 0) {
    fireSwapedEvent(indexList1,indexList2,new Object[]{this.list.get(index1),this.list.get(index2)},true);
  }
  internalSwap(index1,index2);
  indexList1.add(index1);
  indexList2.add(index2);
  fireSwapedEvent(indexList1,indexList2,new Object[]{this.list.get(index1),this.list.get(index2)},false);
}

Fixed version (ground truth):
@Override public void swap(int index1,int index2){
  ArrayList<Integer> indexList1=new ArrayList<Integer>(1);
  ArrayList<Integer> indexList2=new ArrayList<Integer>(1);
  if (beforeListeners.size() != 0) {
    fireSwapedEvent(indexList1,indexList2,new Object[]{this.list.get(index1),this.list.get(index2)},true);
  }
  internalSwap(index1,index2);
  indexList1.add(index1);
  indexList2.add(index2);
  fireSwapedEvent(indexList1,indexList2,new Object[]{this.list.get(index1),this.list.get(index2)},false);
}
Program: 128295
Project: 128295
Buggy source:
public boolean containsAll(Collection<?> c){
  return this.list.containsAll(c);
}

Fixed version (ground truth):
@Override public boolean containsAll(Collection<?> c){
  return this.list.containsAll(c);
}
Program: 128296
Project: 128296
Buggy source:
public void clear(){
  fireClearedEvent(true);
  this.list.clear();
  fireClearedEvent(false);
}

Fixed version (ground truth):
@Override public void clear(){
  fireClearedEvent(true);
  this.list.clear();
  fireClearedEvent(false);
}
Program: 128297
Project: 128297
Buggy source:
public boolean isEmpty(){
  return this.list.isEmpty();
}

Fixed version (ground truth):
@Override public boolean isEmpty(){
  return this.list.isEmpty();
}
Program: 128298
Project: 128298
Buggy source:
public boolean hasNext(){
  return internalListIterator.hasNext();
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  return internalListIterator.hasNext();
}
Program: 128299
Project: 128299
Buggy source:
public int lastIndexOf(Object o){
  return this.list.lastIndexOf(o);
}

Fixed version (ground truth):
@Override public int lastIndexOf(Object o){
  return this.list.lastIndexOf(o);
}
Program: 128300
Project: 128300
Buggy source:
/** 
 * Getter for useEquals.
 * @return the useEquals
 */
public boolean isUseEquals(){
  return this.useEquals;
}

Fixed version (ground truth):
/** 
 * Getter for useEquals.
 * @return the useEquals
 */
@Override public boolean isUseEquals(){
  return this.useEquals;
}
Program: 128301
Project: 128301
Buggy source:
/** 
 * Returns whether the list contains the object. This implementation uses either <code>equals</code> or <code>"=="</code> depending on   {@link #isUseEquals useEquals}.
 * @param object the object in question.
 * @return whether the list contains the object.
 * @see #useEquals
 */
public boolean contains(Object object){
  int size=list.size();
  if (useEquals && object != null) {
    return this.list.contains(object);
  }
 else {
    for (int i=0; i < size; ++i) {
      if (list.get(i) == object) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns whether the list contains the object. This implementation uses either <code>equals</code> or <code>"=="</code> depending on   {@link #isUseEquals useEquals}.
 * @param object the object in question.
 * @return whether the list contains the object.
 * @see #useEquals
 */
@Override public boolean contains(Object object){
  int size=list.size();
  if (useEquals && object != null) {
    return this.list.contains(object);
  }
 else {
    for (int i=0; i < size; ++i) {
      if (list.get(i) == object) {
        return true;
      }
    }
  }
  return false;
}
Program: 128302
Project: 128302
Buggy source:
public int size(){
  if (this.list != null) {
    return this.list.size();
  }
 else {
    return 0;
  }
}

Fixed version (ground truth):
@Override public int size(){
  if (this.list != null) {
    return this.list.size();
  }
 else {
    return 0;
  }
}
Program: 128303
Project: 128303
Buggy source:
/** 
 */
@SuppressWarnings("String_Node_Str") public void addAll(List<Integer> indices,Collection<? extends T> c){
  fireAddedEvent(null,(Collection<T>)c,indices,true);
  Iterator<Integer> iterIndice=indices.iterator();
  for (  T t : c) {
    Integer indice=null;
    if (iterIndice.hasNext()) {
      indice=iterIndice.next();
    }
    if (indice != null) {
      this.list.add(indice,t);
    }
 else {
      this.list.add(t);
    }
  }
  fireAddedEvent(null,(Collection<T>)c,indices,false);
}

Fixed version (ground truth):
/** 
 */
@Override @SuppressWarnings("String_Node_Str") public void addAll(List<Integer> indices,Collection<? extends T> c){
  fireAddedEvent(null,(Collection<T>)c,indices,true);
  Iterator<Integer> iterIndice=indices.iterator();
  for (  T t : c) {
    Integer indice=null;
    if (iterIndice.hasNext()) {
      indice=iterIndice.next();
    }
    if (indice != null) {
      this.list.add(indice,t);
    }
 else {
      this.list.add(t);
    }
  }
  fireAddedEvent(null,(Collection<T>)c,indices,false);
}
Program: 128304
Project: 128304
Buggy source:
public ListIterator<T> listIterator(int index){
  return this.list.listIterator(index);
}

Fixed version (ground truth):
@Override public ListIterator<T> listIterator(int index){
  return this.list.listIterator(index);
}
Program: 128305
Project: 128305
Buggy source:
public int previousIndex(){
  return internalListIterator.previousIndex();
}

Fixed version (ground truth):
@Override public int previousIndex(){
  return internalListIterator.previousIndex();
}