nus-yam/ex-repair huggingface dataset:
Program: 128369
Project: 128369
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: 128370
Project: 128370
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: 128371
Project: 128371
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: 128372
Project: 128372
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: 128373
Project: 128373
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: 128374
Project: 128374
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: 128375
Project: 128375
Buggy source:
public boolean hasPrevious(){
  return internalListIterator.hasPrevious();
}

Fixed version (ground truth):
@Override public boolean hasPrevious(){
  return internalListIterator.hasPrevious();
}
Program: 128376
Project: 128376
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: 128377
Project: 128377
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: 128378
Project: 128378
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: 128379
Project: 128379
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: 128380
Project: 128380
Buggy source:
public T previous(){
  current=internalListIterator.previous();
  return current;
}

Fixed version (ground truth):
@Override public T previous(){
  current=internalListIterator.previous();
  return current;
}
Program: 128381
Project: 128381
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: 128382
Project: 128382
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: 128383
Project: 128383
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: 128384
Project: 128384
Buggy source:
public boolean isEmpty(){
  return this.list.isEmpty();
}

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

Fixed version (ground truth):
@Override public boolean hasNext(){
  return internalListIterator.hasNext();
}
Program: 128386
Project: 128386
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: 128387
Project: 128387
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: 128388
Project: 128388
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: 128389
Project: 128389
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: 128390
Project: 128390
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: 128391
Project: 128391
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: 128392
Project: 128392
Buggy source:
public int previousIndex(){
  return internalListIterator.previousIndex();
}

Fixed version (ground truth):
@Override public int previousIndex(){
  return internalListIterator.previousIndex();
}
Program: 128393
Project: 128393
Buggy source:
public boolean retainAll(Collection<?> c){
  List<T> all=new ArrayList<T>();
  all.addAll(this.list);
  boolean isListChanged=this.list.retainAll(c);
  if (isListChanged) {
    int size=all.size();
    List<T> removedObjects=new ArrayList<T>();
    for (int i=0; i < size; i++) {
      T removedObject=all.get(i);
      if (indexOf(removedObject) < 0) {
        removedObjects.add(removedObject);
      }
    }
    fireRemovedEvent(null,removedObjects,null,false);
  }
  return isListChanged;
}

Fixed version (ground truth):
@Override public boolean retainAll(Collection<?> c){
  List<T> all=new ArrayList<T>();
  all.addAll(this.list);
  boolean isListChanged=this.list.retainAll(c);
  if (isListChanged) {
    int size=all.size();
    List<T> removedObjects=new ArrayList<T>();
    for (int i=0; i < size; i++) {
      T removedObject=all.get(i);
      if (indexOf(removedObject) < 0) {
        removedObjects.add(removedObject);
      }
    }
    fireRemovedEvent(null,removedObjects,null,false);
  }
  return isListChanged;
}
Program: 128394
Project: 128394
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: 128395
Project: 128395
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: 128396
Project: 128396
Buggy source:
public synchronized void wakeup(){
  notify();
}

Fixed version (ground truth):
@Override public synchronized void wakeup(){
  notify();
}
Program: 128397
Project: 128397
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: 128398
Project: 128398
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: 128399
Project: 128399
Buggy source:
public void manipulateData(String path,String value){
}

Fixed version (ground truth):
@Override public void manipulateData(String path,String value){
}
Program: 128401
Project: 128401
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: 128402
Project: 128402
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: 128404
Project: 128404
Buggy source:
private static void generateBuildInfo(JobInfo jobInfo,IProgressMonitor progressMonitor,boolean isMainJob,IProcess currentProcess,String currentJobName) throws ProcessorException {
  if (isMainJob) {
    progressMonitor.subTask(Messages.getString("String_Node_Str") + currentJobName);
    Set<String> jarList=new HashSet<String>();
    Set<ModuleNeeded> neededModules=LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion());
    for (    ModuleNeeded module : neededModules) {
      jarList.add(module.getModuleName());
    }
    CorePlugin.getDefault().getRunProcessService().updateLibraries(jarList,currentProcess);
    if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA && codeModified) {
      try {
        ((IJavaProject)CorePlugin.getDefault().getRunProcessService().getJavaProject()).getProject().build(IncrementalProjectBuilder.AUTO_BUILD,null);
      }
 catch (      CoreException e) {
        throw new ProcessorException(e);
      }
    }
    codeModified=false;
  }
}

Fixed version (ground truth):
private static void generateBuildInfo(JobInfo jobInfo,IProgressMonitor progressMonitor,boolean isMainJob,IProcess currentProcess,String currentJobName) throws ProcessorException {
  if (isMainJob) {
    progressMonitor.subTask(Messages.getString("String_Node_Str") + currentJobName);
    Set<String> jarList=new HashSet<String>();
    Set<ModuleNeeded> neededModules=LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion());
    for (    ModuleNeeded module : neededModules) {
      jarList.add(module.getModuleName());
    }
    CorePlugin.getDefault().getRunProcessService().updateLibraries(jarList,currentProcess);
    if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA && codeModified) {
      try {
        CorePlugin.getDefault().getRunProcessService().getJavaProject().getProject().build(IncrementalProjectBuilder.AUTO_BUILD,null);
      }
 catch (      CoreException e) {
        throw new ProcessorException(e);
      }
    }
    needContextInCurrentGeneration=true;
    codeModified=false;
  }
}
Program: 128405
Project: 128405
Buggy source:
/** 
 * This method is used to reset the tRunJob component's context,see feature 1625.
 * @param jobInfo
 * @param currentProcess
 * @param selectedContextName
 */
private static void resetRunJobComponentParameterForContextApply(JobInfo jobInfo,IProcess currentProcess,String selectedContextName){
  if (jobInfo.isApplyContextToChildren()) {
    for (Iterator<? extends INode> iter=currentProcess.getGeneratingNodes().iterator(); iter.hasNext(); ) {
      INode node=iter.next();
      if ((node != null) && node.getComponent().getName().equals("String_Node_Str")) {
        node.getElementParameter("String_Node_Str").setValue(selectedContextName);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * This method is used to reset the tRunJob component's context,see feature 1625.
 * @param jobInfo
 * @param currentProcess
 * @param selectedContextName
 */
private static void resetRunJobComponentParameterForContextApply(JobInfo jobInfo,IProcess currentProcess,String selectedContextName){
  if (jobInfo.isApplyContextToChildren()) {
    for (    INode node : currentProcess.getGeneratingNodes()) {
      if ((node != null) && node.getComponent().getName().equals("String_Node_Str")) {
        node.getElementParameter("String_Node_Str").setValue(selectedContextName);
      }
    }
  }
}
Program: 128406
Project: 128406
Buggy source:
public static String[] getMainCommand(String processName,String processVersion,String contextName,int statisticPort,int tracePort,String... codeOptions) throws ProcessorException {
  IProcess currentProcess=null;
  ProcessItem selectedProcessItem=null;
  selectedProcessItem=ItemCacheManager.getProcessItem(processName,processVersion);
  if (selectedProcessItem != null) {
    IDesignerCoreService service=CorePlugin.getDefault().getDesignerCoreService();
    currentProcess=service.getProcessFromProcessItem(selectedProcessItem);
  }
  if (currentProcess == null) {
    return new String[]{};
  }
  IContext currentContext=getContext(currentProcess,contextName);
  IProcessor processor=getProcessor(currentProcess,selectedProcessItem.getProperty(),currentContext);
  String[] cmd=new String[]{processor.getCodePath().removeFirstSegments(1).toString().replace("String_Node_Str","String_Node_Str")};
  if (codeOptions != null) {
    for (int i=0; i < codeOptions.length; i++) {
      String string=codeOptions[i];
      if (string != null) {
        cmd=(String[])ArrayUtils.add(cmd,string);
      }
    }
  }
  if (contextName != null && !contextName.equals("String_Node_Str")) {
    cmd=(String[])ArrayUtils.add(cmd,"String_Node_Str" + contextName);
  }
  if (statisticPort != -1) {
    cmd=(String[])ArrayUtils.add(cmd,"String_Node_Str" + statisticPort);
  }
  if (tracePort != -1) {
    cmd=(String[])ArrayUtils.add(cmd,"String_Node_Str" + tracePort);
  }
  return cmd;
}

Fixed version (ground truth):
public static String[] getMainCommand(String processName,String processVersion,String contextName,int statisticPort,int tracePort,String... codeOptions) throws ProcessorException {
  IProcess currentProcess=null;
  ProcessItem selectedProcessItem=null;
  selectedProcessItem=ItemCacheManager.getProcessItem(processName,processVersion);
  if (selectedProcessItem != null) {
    IDesignerCoreService service=CorePlugin.getDefault().getDesignerCoreService();
    currentProcess=service.getProcessFromProcessItem(selectedProcessItem);
  }
  if (currentProcess == null) {
    return new String[]{};
  }
  IContext currentContext=getContext(currentProcess,contextName);
  IProcessor processor=getProcessor(currentProcess,selectedProcessItem.getProperty(),currentContext);
  String[] cmd=new String[]{processor.getCodePath().removeFirstSegments(1).toString().replace("String_Node_Str","String_Node_Str")};
  if (codeOptions != null) {
    for (    String string : codeOptions) {
      if (string != null) {
        cmd=(String[])ArrayUtils.add(cmd,string);
      }
    }
  }
  if (needContextInCurrentGeneration && contextName != null && !contextName.equals("String_Node_Str")) {
    cmd=(String[])ArrayUtils.add(cmd,"String_Node_Str" + contextName);
  }
  if (statisticPort != -1) {
    cmd=(String[])ArrayUtils.add(cmd,"String_Node_Str" + statisticPort);
  }
  if (tracePort != -1) {
    cmd=(String[])ArrayUtils.add(cmd,"String_Node_Str" + tracePort);
  }
  return cmd;
}
Program: 128408
Project: 128408
Buggy source:
private int parseSize(String numStr){
  return new Integer(numStr.substring(4)).intValue();
}

Fixed version (ground truth):
private int parseSize(String numStr){
  if (numStr.contains("String_Node_Str")) {
    return new Integer(numStr.substring(5)).intValue();
  }
  return new Integer(numStr.substring(4)).intValue();
}
Program: 128409
Project: 128409
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"));
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    if (!("String_Node_Str").equals(newValue)) {
      text.setText(newValue);
    }
    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(newValue);
    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"));
    final int columnPosition=tableViewerCreator.getColumns().indexOf(column);
    tableViewerCreator.getTableViewer().editElement(currentModifiedBean,columnPosition);
    if (!("String_Node_Str").equals(newValue)) {
      text.setText(newValue);
    }
    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);
  }
}
Program: 128411
Project: 128411
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: 128416
Project: 128416
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: 128417
Project: 128417
Buggy source:
public void focusGained(FocusEvent e){
}

Fixed version (ground truth):
@Override public void focusGained(FocusEvent e){
}
Program: 128418
Project: 128418
Buggy source:
public void widgetDefaultSelected(SelectionEvent e){
}

Fixed version (ground truth):
@Override public void widgetDefaultSelected(SelectionEvent e){
}
Program: 128420
Project: 128420
Buggy source:
public void modifyText(ModifyEvent e){
  getConnection().setOutputFilePath(PathUtils.getPortablePath(outputFilePath.getText()));
  checkFieldsValue();
}

Fixed version (ground truth):
@Override public void modifyText(ModifyEvent e){
  getConnection().setOutputFilePath(PathUtils.getPortablePath(outputFilePath.getText()));
  checkFieldsValue();
}
Program: 128421
Project: 128421
Buggy source:
public void focusLost(FocusEvent e){
  commonNodesLimitation.setText(String.valueOf(TreePopulator.getLimit()));
}

Fixed version (ground truth):
@Override public void focusLost(FocusEvent e){
  commonNodesLimitation.setText(String.valueOf(TreePopulator.getLimit()));
}
Program: 128423
Project: 128423
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: 128426
Project: 128426
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: 128429
Project: 128429
Buggy source:
public Resource getScreenshotResource(Item item,boolean createIfNotExist){
  URI itemResourceURI=null;
  itemResourceURI=getScreenshotResourceURI(getItemURI(item));
  IPath path=URIHelper.convert(itemResourceURI);
  IFile file=ResourcesPlugin.getWorkspace().getRoot().getFile(path);
  Resource itemResource=null;
  if (file.exists()) {
    try {
      itemResource=resourceSet.getResource(itemResourceURI,true);
    }
 catch (    Exception e) {
      itemResource=null;
    }
  }
  if (itemResource == null && createIfNotExist) {
    itemResource=resourceSet.createResource(itemResourceURI);
  }
  return itemResource;
}

Fixed version (ground truth):
public Resource getScreenshotResource(Item item,boolean createIfNotExist){
  URI itemResourceURI=null;
  itemResourceURI=getScreenshotResourceURI(getItemURI(item));
  boolean fileExist=false;
  if (itemResourceURI.isFile()) {
    fileExist=new File(itemResourceURI.toFileString()).exists();
  }
 else {
    IPath path=URIHelper.convert(itemResourceURI);
    if (path != null) {
      IFile file=ResourcesPlugin.getWorkspace().getRoot().getFile(path);
      if (file.exists()) {
        fileExist=true;
      }
    }
 else {
      fileExist=false;
    }
  }
  Resource itemResource=null;
  if (fileExist) {
    try {
      itemResource=resourceSet.getResource(itemResourceURI,true);
    }
 catch (    Exception e) {
      itemResource=null;
    }
  }
  if (itemResource == null && createIfNotExist) {
    itemResource=resourceSet.createResource(itemResourceURI);
  }
  return itemResource;
}
Program: 128432
Project: 128432
Buggy source:
/** 
 * Returns all   {@link HiveConnVersionInfo} objects with the given level. Added by Marvin Wang on Aug 9, 2012.
 * @param level
 * @return
 */
protected static List<HiveConnVersionInfo> getObjectsByLevel(int level){
  HiveConnVersionInfo[] beans=HiveConnVersionInfo.values();
  if (beans != null && beans.length > 0) {
    List<HiveConnVersionInfo> list=new ArrayList<HiveConnVersionInfo>();
    for (    HiveConnVersionInfo bean : beans) {
      int beanLevel=bean.getLevel();
      if (level == beanLevel) {
        list.add(bean);
      }
    }
    if (PluginChecker.isOnlyTopLoaded() && level == 0) {
      list.remove(0);
    }
    return list;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns all   {@link HiveConnVersionInfo} objects with the given level. Added by Marvin Wang on Aug 9, 2012.
 * @param level
 * @return
 */
protected static List<HiveConnVersionInfo> getObjectsByLevel(int level){
  HiveConnVersionInfo[] beans=HiveConnVersionInfo.values();
  if (beans != null && beans.length > 0) {
    List<HiveConnVersionInfo> list=new ArrayList<HiveConnVersionInfo>();
    for (    HiveConnVersionInfo bean : beans) {
      int beanLevel=bean.getLevel();
      if (level == beanLevel) {
        list.add(bean);
      }
    }
    if (PluginChecker.isOnlyTopLoaded() && (level == 0 || level == 2)) {
      list.remove(0);
    }
    return list;
  }
  return null;
}
Program: 128433
Project: 128433
Buggy source:
public void loadScreenshots(Property property,ProcessType processType){
  Resource screenshotResource=getScreenshotResource(property.getItem());
  processType.getScreenshots().addAll(screenshotResource.getContents());
}

Fixed version (ground truth):
public void loadScreenshots(Property property,ProcessType processType){
  Resource screenshotResource=getScreenshotResource(property.getItem());
  if (screenshotResource != null) {
    processType.getScreenshots().addAll(screenshotResource.getContents());
  }
}
Program: 128434
Project: 128434
Buggy source:
public Resource getScreenshotResource(Item item){
  URI itemResourceURI=null;
  itemResourceURI=getScreenshotResourceURI(getItemURI(item));
  Resource itemResource;
  try {
    itemResource=resourceSet.getResource(itemResourceURI,true);
  }
 catch (  Exception e) {
    itemResource=resourceSet.createResource(itemResourceURI);
  }
  return itemResource;
}

Fixed version (ground truth):
public Resource getScreenshotResource(Item item,boolean createIfNotExist){
  URI itemResourceURI=null;
  itemResourceURI=getScreenshotResourceURI(getItemURI(item));
  IPath path=URIHelper.convert(itemResourceURI);
  IFile file=ResourcesPlugin.getWorkspace().getRoot().getFile(path);
  Resource itemResource=null;
  if (file.exists()) {
    try {
      itemResource=resourceSet.getResource(itemResourceURI,true);
    }
 catch (    Exception e) {
      itemResource=null;
    }
  }
  if (itemResource == null && createIfNotExist) {
    itemResource=resourceSet.createResource(itemResourceURI);
  }
  return itemResource;
}
Program: 128435
Project: 128435
Buggy source:
private Resource saveScreenshots(Item item){
  Resource itemResource=xmiResourceManager.getScreenshotResource(item);
  itemResource.getContents().clear();
  EMap screenshots=null;
  if (item instanceof ProcessItem) {
    screenshots=((ProcessItem)item).getProcess().getScreenshots();
    itemResource.getContents().addAll(EcoreUtil.copyAll(screenshots));
  }
 else   if (item instanceof JobletProcessItem) {
    screenshots=((JobletProcessItem)item).getJobletProcess().getScreenshots();
    itemResource.getContents().addAll(screenshots);
  }
  return itemResource;
}

Fixed version (ground truth):
private Resource saveScreenshots(Item item){
  Resource itemResource=xmiResourceManager.getScreenshotResource(item,true);
  itemResource.getContents().clear();
  EMap screenshots=null;
  if (item instanceof ProcessItem) {
    screenshots=((ProcessItem)item).getProcess().getScreenshots();
    itemResource.getContents().addAll(EcoreUtil.copyAll(screenshots));
  }
 else   if (item instanceof JobletProcessItem) {
    screenshots=((JobletProcessItem)item).getJobletProcess().getScreenshots();
    itemResource.getContents().addAll(screenshots);
  }
  return itemResource;
}
Program: 128437
Project: 128437
Buggy source:
public int compare(SortedComponentSetting o1,SortedComponentSetting o2){
  return o1.getLevel() - o2.getLevel();
}

Fixed version (ground truth):
@Override public int compare(SortedComponentSetting o1,SortedComponentSetting o2){
  return o1.getLevel() - o2.getLevel();
}
Program: 128438
Project: 128438
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private static Class<Item>[] retrieveClasses(IConfigurationElement parent){
  IConfigurationElement[] children=parent.getChildren("String_Node_Str");
  List<Class<Item>> list=new ArrayList<Class<Item>>();
  for (  IConfigurationElement ce : children) {
    String className=ce.getAttribute("String_Node_Str");
    try {
      Class clazz=Class.forName(className);
      list.add(clazz);
    }
 catch (    ClassNotFoundException e) {
      ExceptionHandler.process(e);
    }
  }
  return list.toArray(new Class[0]);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private static Class<Item>[] retrieveClasses(IConfigurationElement parent){
  IConfigurationElement[] children=parent.getChildren("String_Node_Str");
  List<Class<Item>> list=new ArrayList<Class<Item>>();
  for (  IConfigurationElement ce : children) {
    String className=ce.getAttribute("String_Node_Str");
    try {
      IContributor contributor=ce.getContributor();
      Bundle bundle=ContributorFactoryOSGi.resolve(contributor);
      Class clazz=bundle.loadClass(className);
      list.add(clazz);
    }
 catch (    ClassNotFoundException e) {
      ExceptionHandler.process(e);
    }
  }
  return list.toArray(new Class[0]);
}