nus-yam/ex-repair huggingface dataset:
Program: 128306
Project: 128306
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: 128307
Project: 128307
Buggy source:
/** 
 * Open an Error dialog with a details area (title = "Error Message").
 * @param shell
 * @param String (Product ID -> Activator.PLUGIN_ID)
 * @param mainMessage
 * @param detailMessage (\n an \t are interpreted ; \r are deleted)
 */
public ErrorDialogWidthDetailArea(Shell shell,String pid,String mainMessage,String detailMessage){
  MultiStatus info=new MultiStatus(pid,1,mainMessage,null);
  if (detailMessage != null) {
    String[] lines=detailMessage.split("String_Node_Str");
    for (int i=0; i < lines.length; i++) {
      info.add(new Status(IStatus.INFO,pid,1,lines[i].replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str"),null));
    }
  }
  codeOfButton=ErrorDialog.openError(shell,Messages.getString("String_Node_Str"),null,info);
}

Fixed version (ground truth):
public ErrorDialogWidthDetailArea(Shell shell,String pid,String mainMessage,String detailMessage,int status){
  MultiStatus info=new MultiStatus(pid,1,mainMessage,null);
  if (detailMessage != null) {
    String[] lines=detailMessage.split("String_Node_Str");
    for (    String line : lines) {
      info.add(new Status(status,pid,1,line.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str"),null));
    }
  }
  codeOfButton=ErrorDialog.openError(shell,Messages.getString("String_Node_Str"),null,info);
}
Program: 128309
Project: 128309
Buggy source:
/** 
 * Open an Error dialog with a details area (title = "Error Message").
 * @param shell
 * @param String (Product ID -> Activator.PLUGIN_ID)
 * @param mainMessage
 * @param detailMessage (\n an \t are interpreted ; \r are deleted)
 */
public ErrorDialogWidthDetailArea(Shell shell,String pid,String mainMessage,String detailMessage){
  MultiStatus info=new MultiStatus(pid,1,mainMessage,null);
  if (detailMessage != null) {
    String[] lines=detailMessage.split("String_Node_Str");
    for (int i=0; i < lines.length; i++) {
      info.add(new Status(IStatus.INFO,pid,1,lines[i].replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str"),null));
    }
  }
  codeOfButton=ErrorDialog.openError(shell,Messages.getString("String_Node_Str"),null,info);
}

Fixed version (ground truth):
public ErrorDialogWidthDetailArea(Shell shell,String pid,String mainMessage,String detailMessage,int status){
  MultiStatus info=new MultiStatus(pid,1,mainMessage,null);
  if (detailMessage != null) {
    String[] lines=detailMessage.split("String_Node_Str");
    for (    String line : lines) {
      info.add(new Status(status,pid,1,line.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str"),null));
    }
  }
  codeOfButton=ErrorDialog.openError(shell,Messages.getString("String_Node_Str"),null,info);
}
Program: 128310
Project: 128310
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: 128313
Project: 128313
Buggy source:
public static Image getComponentIcon(IComponent component,ICON_SIZE iconSize){
  if (component != null && iconSize != null) {
    String name=component.getName();
    Image image=null;
    if (iconSize == ICON_SIZE.ICON_32 && CorePlugin.getDefault().getDesignerCoreService().isDummyComponent(component)) {
      image=component.getIcon32().createImage();
    }
 else {
      image=(Image)componentCachedImages.get(name,iconSize);
    }
    if (image == null || image.isDisposed()) {
      ImageDescriptor icon=null;
switch (iconSize) {
case ICON_16:
        icon=component.getIcon16();
case ICON_24:
      icon=component.getIcon24();
case ICON_32:
default :
    icon=component.getIcon32();
}
if (icon == null) {
  icon=component.getIcon32();
}
image=icon.createImage();
componentCachedImages.put(name,iconSize,image);
}
return image;
}
return null;
}

Fixed version (ground truth):
public static Image getComponentIcon(IComponent component,ICON_SIZE iconSize){
  if (component != null && iconSize != null) {
    String name=component.getName();
    Image image=null;
    if (iconSize == ICON_SIZE.ICON_32 && CorePlugin.getDefault().getDesignerCoreService().isDummyComponent(component)) {
      image=component.getIcon32().createImage();
    }
 else {
      image=(Image)componentCachedImages.get(name,iconSize);
    }
    if (image == null || image.isDisposed()) {
      ImageDescriptor icon=null;
switch (iconSize) {
case ICON_16:
        icon=component.getIcon16();
      break;
case ICON_24:
    icon=component.getIcon24();
  break;
case ICON_32:
default :
icon=component.getIcon32();
}
if (icon == null) {
icon=component.getIcon32();
}
image=icon.createImage();
componentCachedImages.put(name,iconSize,image);
}
return image;
}
return null;
}
Program: 128314
Project: 128314
Buggy source:
public int compare(IConnection connection1,IConnection connection2){
  EConnectionType lineStyle=connection1.getLineStyle();
  EConnectionType lineStyle2=connection2.getLineStyle();
  if ("String_Node_Str".equals(connection1.getConnectorName())) {
    return -1;
  }
  if ("String_Node_Str".equals(connection2.getConnectorName())) {
    return 1;
  }
  if (lineStyle == EConnectionType.FLOW_MAIN || lineStyle == EConnectionType.FLOW_MERGE) {
    return -1;
  }
  if (lineStyle2 == EConnectionType.FLOW_MAIN || lineStyle2 == EConnectionType.FLOW_MERGE) {
    return 1;
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compare(IConnection connection1,IConnection connection2){
  EConnectionType lineStyle=connection1.getLineStyle();
  EConnectionType lineStyle2=connection2.getLineStyle();
  if ("String_Node_Str".equals(connection1.getConnectorName())) {
    return -1;
  }
  if ("String_Node_Str".equals(connection2.getConnectorName())) {
    return 1;
  }
  if (lineStyle == EConnectionType.FLOW_MAIN || lineStyle == EConnectionType.FLOW_MERGE) {
    return -1;
  }
  if (lineStyle2 == EConnectionType.FLOW_MAIN || lineStyle2 == EConnectionType.FLOW_MERGE) {
    return 1;
  }
  return 0;
}
Program: 128315
Project: 128315
Buggy source:
/** 
 * DOC jyhu <p> function:get the node from generating nodes by unique name. aim:to get the property value from any node. </p> Notice: It is used to get property values from the pointed node.
 * @param node:node from the job @param uniqueName:the unique name of the pointed node.
 * @return 
 */
public static INode getNodeByUniqueName(final IProcess process,String uniqueName){
  List<INode> nodes=(List<INode>)process.getGeneratingNodes();
  INode return_node=null;
  for (  INode current_node : nodes) {
    if (uniqueName.equals(current_node.getUniqueName())) {
      return_node=current_node;
    }
  }
  return return_node;
}

Fixed version (ground truth):
/** 
 * DOC jyhu <p> function:get the node from generating nodes by unique name. aim:to get the property value from any node. </p> Notice: It is used to get property values from the pointed node.
 * @param node:node from the job @param uniqueName:the unique name of the pointed node.
 * @return
 */
public static INode getNodeByUniqueName(final IProcess process,String uniqueName){
  List<INode> nodes=(List<INode>)process.getGeneratingNodes();
  INode return_node=null;
  for (  INode current_node : nodes) {
    if (uniqueName.equals(current_node.getUniqueName())) {
      return_node=current_node;
    }
  }
  return return_node;
}
Program: 128317
Project: 128317
Buggy source:
public static boolean checkConnectionAfterNode(INode node,EConnectionType connectionType,List<INode> checkedNodes){
  if (checkedNodes.contains(node)) {
    return false;
  }
 else {
    checkedNodes.add(node);
  }
  boolean result=false;
  List<? extends IConnection> onErrorConns=getOutgoingConnections(node,EConnectionType.ON_COMPONENT_ERROR);
  if (onErrorConns == null || onErrorConns.size() == 0) {
    List<? extends IConnection> conns=getOutgoingSortedConnections(node);
    if (conns != null && conns.size() > 0) {
      for (      IConnection conn : conns) {
        result=checkConnectionAfterNode(conn.getTarget(),EConnectionType.ON_COMPONENT_ERROR,checkedNodes);
        if (result) {
          break;
        }
      }
    }
 else {
      result=false;
    }
  }
 else {
    result=true;
  }
  return result;
}

Fixed version (ground truth):
public static boolean checkConnectionAfterNode(INode node,EConnectionType connectionType,List<INode> checkedNodes){
  if (checkedNodes.contains(node)) {
    return false;
  }
 else {
    checkedNodes.add(node);
  }
  boolean result=false;
  List<? extends IConnection> outConns=getOutgoingConnections(node,connectionType);
  if (outConns == null || outConns.size() == 0) {
    List<? extends IConnection> conns=getOutgoingSortedConnections(node);
    if (conns != null && conns.size() > 0) {
      for (      IConnection conn : conns) {
        result=checkConnectionAfterNode(conn.getTarget(),connectionType,checkedNodes);
        if (result) {
          break;
        }
      }
    }
 else {
      result=false;
    }
  }
 else {
    result=true;
  }
  return result;
}
Program: 128318
Project: 128318
Buggy source:
public static List<? extends IConnection> getOutgoingSortedConnections(INode node){
  List<IConnection> conns=null;
  List<? extends IConnection> outgoingConnections=node.getOutgoingConnections();
  if (outgoingConnections != null) {
    conns=new ArrayList<IConnection>(outgoingConnections);
    Collections.sort(conns,new Comparator<IConnection>(){
      public int compare(      IConnection connection1,      IConnection connection2){
        EConnectionType lineStyle=connection1.getLineStyle();
        EConnectionType lineStyle2=connection2.getLineStyle();
        if ("String_Node_Str".equals(connection1.getConnectorName())) {
          return -1;
        }
        if ("String_Node_Str".equals(connection2.getConnectorName())) {
          return 1;
        }
        if (lineStyle == EConnectionType.FLOW_MAIN || lineStyle == EConnectionType.FLOW_MERGE) {
          return -1;
        }
        if (lineStyle2 == EConnectionType.FLOW_MAIN || lineStyle2 == EConnectionType.FLOW_MERGE) {
          return 1;
        }
        return 0;
      }
    }
);
  }
  return conns;
}

Fixed version (ground truth):
public static List<? extends IConnection> getOutgoingSortedConnections(INode node){
  List<IConnection> conns=null;
  List<? extends IConnection> outgoingConnections=node.getOutgoingConnections();
  if (outgoingConnections != null) {
    conns=new ArrayList<IConnection>(outgoingConnections);
    Collections.sort(conns,new Comparator<IConnection>(){
      @Override public int compare(      IConnection connection1,      IConnection connection2){
        EConnectionType lineStyle=connection1.getLineStyle();
        EConnectionType lineStyle2=connection2.getLineStyle();
        if ("String_Node_Str".equals(connection1.getConnectorName())) {
          return -1;
        }
        if ("String_Node_Str".equals(connection2.getConnectorName())) {
          return 1;
        }
        if (lineStyle == EConnectionType.FLOW_MAIN || lineStyle == EConnectionType.FLOW_MERGE) {
          return -1;
        }
        if (lineStyle2 == EConnectionType.FLOW_MAIN || lineStyle2 == EConnectionType.FLOW_MERGE) {
          return 1;
        }
        return 0;
      }
    }
);
  }
  return conns;
}
Program: 128319
Project: 128319
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: 128320
Project: 128320
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: 128321
Project: 128321
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: 128322
Project: 128322
Buggy source:
public T next(){
  current=internalListIterator.next();
  return current;
}

Fixed version (ground truth):
@Override public T next(){
  current=internalListIterator.next();
  return current;
}
Program: 128323
Project: 128323
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: 128324
Project: 128324
Buggy source:
public int nextIndex(){
  return internalListIterator.nextIndex();
}

Fixed version (ground truth):
@Override public int nextIndex(){
  return internalListIterator.nextIndex();
}
Program: 128325
Project: 128325
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: 128326
Project: 128326
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: 128327
Project: 128327
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: 128328
Project: 128328
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: 128329
Project: 128329
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: 128330
Project: 128330
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: 128331
Project: 128331
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: 128332
Project: 128332
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: 128333
Project: 128333
Buggy source:
public boolean hasPrevious(){
  return internalListIterator.hasPrevious();
}

Fixed version (ground truth):
@Override public boolean hasPrevious(){
  return internalListIterator.hasPrevious();
}
Program: 128334
Project: 128334
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: 128335
Project: 128335
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: 128336
Project: 128336
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: 128337
Project: 128337
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: 128338
Project: 128338
Buggy source:
public T previous(){
  current=internalListIterator.previous();
  return current;
}

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

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

Fixed version (ground truth):
@Override public boolean hasNext(){
  return internalListIterator.hasNext();
}
Program: 128344
Project: 128344
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: 128345
Project: 128345
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: 128346
Project: 128346
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: 128347
Project: 128347
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: 128348
Project: 128348
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: 128349
Project: 128349
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: 128350
Project: 128350
Buggy source:
public int previousIndex(){
  return internalListIterator.previousIndex();
}

Fixed version (ground truth):
@Override public int previousIndex(){
  return internalListIterator.previousIndex();
}
Program: 128351
Project: 128351
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: 128352
Project: 128352
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: 128353
Project: 128353
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: 128354
Project: 128354
Buggy source:
public synchronized void wakeup(){
  notify();
}

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

Fixed version (ground truth):
@Override public void manipulateData(String path,String value){
}
Program: 128360
Project: 128360
Buggy source:
public boolean populateTree(XSDSchema schema,ATreeNode selectedNode,List<ATreeNode> treeNodes){
  availableXmlTree.removeAll();
  xPathToTreeItem.clear();
  ATreeNode treeNode=null;
  if (schema != null) {
    try {
      treeNode=SchemaPopulationUtil.getSchemaTree(schema,selectedNode);
      if (treeNodes != null) {
        treeNodes.add(treeNode);
      }
    }
 catch (    MalformedURLException e) {
      ExceptionHandler.process(e);
    }
catch (    OdaException e) {
      ExceptionHandler.process(e);
    }
catch (    URISyntaxException e) {
      ExceptionHandler.process(e);
    }
catch (    Exception e) {
      ExceptionHandler.process(e);
      return false;
    }
    if (treeNode == null || treeNode.getChildren().length == 0) {
      return false;
    }
 else {
      populateTreeItems(availableXmlTree,new Object[]{treeNode},0,"String_Node_Str","String_Node_Str");
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean populateTree(XSDPopulationUtil2 popUtil,XSDSchema schema,ATreeNode selectedNode,List<ATreeNode> treeNodes){
  availableXmlTree.removeAll();
  xPathToTreeItem.clear();
  ATreeNode treeNode=null;
  if (schema != null) {
    try {
      if (popUtil == null) {
        treeNode=SchemaPopulationUtil.getSchemaTree(schema,selectedNode);
      }
 else {
        treeNode=SchemaPopulationUtil.getSchemaTree(popUtil,schema,selectedNode);
      }
      if (treeNodes != null) {
        treeNodes.add(treeNode);
      }
    }
 catch (    MalformedURLException e) {
      ExceptionHandler.process(e);
    }
catch (    OdaException e) {
      ExceptionHandler.process(e);
    }
catch (    URISyntaxException e) {
      ExceptionHandler.process(e);
    }
catch (    Exception e) {
      ExceptionHandler.process(e);
      return false;
    }
    if (treeNode == null || treeNode.getChildren().length == 0) {
      return false;
    }
 else {
      populateTreeItems(availableXmlTree,new Object[]{treeNode},0,"String_Node_Str","String_Node_Str");
      return true;
    }
  }
  return false;
}
Program: 128362
Project: 128362
Buggy source:
private void getTreeNode(XSDSchema xsdSchema){
  List<ATreeNode> rootNodes;
  try {
    rootNodes=new XSDPopulationUtil2().getAllRootNodes(xsdSchema);
    if (rootNodes.size() > 0) {
      ATreeNode rootNode=getDefaultRootNode(rootNodes);
      List<ATreeNode> treeNodes=new ArrayList<ATreeNode>();
      if (rootNode == null) {
        valid=treePopulator.populateTree(xsdSchema,rootNodes.get(0),treeNodes);
      }
 else {
        valid=treePopulator.populateTree(xsdSchema,rootNode,treeNodes);
        if (treeNodes.size() > 0) {
          treeNode=treeNodes.get(0);
        }
      }
    }
  }
 catch (  OdaException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void getTreeNode(XSDPopulationUtil2 xsdPopulationUtil,XSDSchema xsdSchema){
  List<ATreeNode> rootNodes;
  try {
    rootNodes=xsdPopulationUtil.getAllRootNodes(xsdSchema);
    if (rootNodes.size() > 0) {
      ATreeNode rootNode=getDefaultRootNode(rootNodes);
      List<ATreeNode> treeNodes=new ArrayList<ATreeNode>();
      if (rootNode == null) {
        valid=treePopulator.populateTree(xsdPopulationUtil,xsdSchema,rootNodes.get(0),treeNodes);
      }
 else {
        valid=treePopulator.populateTree(xsdPopulationUtil,xsdSchema,rootNode,treeNodes);
        if (treeNodes.size() > 0) {
          treeNode=treeNodes.get(0);
        }
      }
    }
  }
 catch (  OdaException e) {
    e.printStackTrace();
  }
}
Program: 128364
Project: 128364
Buggy source:
public T next(){
  current=internalListIterator.next();
  return current;
}

Fixed version (ground truth):
@Override public T next(){
  current=internalListIterator.next();
  return current;
}
Program: 128365
Project: 128365
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: 128366
Project: 128366
Buggy source:
public int nextIndex(){
  return internalListIterator.nextIndex();
}

Fixed version (ground truth):
@Override public int nextIndex(){
  return internalListIterator.nextIndex();
}
Program: 128367
Project: 128367
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: 128368
Project: 128368
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);
  }
}