nus-yam/ex-repair huggingface dataset:
Program: 90960
Project: 90960
Buggy source:
@Override public void graphRebuilt(){
  idToTrackSchemeVertex.clear();
  idToTrackSchemeEdge.clear();
  for (  final V v : modelGraph.vertices()) {
    final int id=idmap.getVertexId(v);
    final int timepoint=v.getTimepoint();
    addVertex(tsv).init(id,timepoint);
    idToTrackSchemeVertex.put(id,tsv);
    if (v.incomingEdges().isEmpty())     roots.add(tsv);
  }
  for (  final E e : modelGraph.edges()) {
    final int id=idmap.getEdgeId(e);
    idToTrackSchemeVertex.get(idmap.getVertexId(e.getSource(mv)),tsv);
    idToTrackSchemeVertex.get(idmap.getVertexId(e.getTarget(mv)),tsv2);
    addEdge(tsv,tsv2,tse).init(id);
    idToTrackSchemeEdge.put(id,tse);
  }
}

Fixed version (ground truth):
@Override public void graphRebuilt(){
  idToTrackSchemeVertex.clear();
  idToTrackSchemeEdge.clear();
  roots.clear();
  for (  final V v : modelGraph.vertices()) {
    final int id=idmap.getVertexId(v);
    final int timepoint=v.getTimepoint();
    addVertex(tsv).init(id,timepoint);
    idToTrackSchemeVertex.put(id,tsv);
    if (v.incomingEdges().isEmpty())     roots.add(tsv);
  }
  for (  final E e : modelGraph.edges()) {
    final int id=idmap.getEdgeId(e);
    idToTrackSchemeVertex.get(idmap.getVertexId(e.getSource(mv)),tsv);
    idToTrackSchemeVertex.get(idmap.getVertexId(e.getTarget(mv)),tsv2);
    addEdge(tsv,tsv2,tse).init(id);
    idToTrackSchemeEdge.put(id,tse);
  }
}
Program: 90961
Project: 90961
Buggy source:
@Override public ScreenTransform concatenate(final ScreenTransform a){
  final double cMinX=a.minX + minX / scaleX;
  final double cMaxX=(screenWidth - 1) / (a.scaleX * scaleX) + cMinX;
  final double cMinY=a.minY + minY / scaleY;
  final double cMaxY=(screenHeight - 1) / (a.scaleY * scaleY) + cMinY;
  return new ScreenTransform(cMinX,cMaxX,cMinY,cMaxY,screenWidth,screenHeight);
}

Fixed version (ground truth):
@Override public ScreenTransform concatenate(final ScreenTransform a){
  final double cMinX=a.minX + minX / a.scaleX;
  final double cMaxX=(screenWidth - 1) / (a.scaleX * scaleX) + cMinX;
  final double cMinY=a.minY + minY / a.scaleY;
  final double cMaxY=(screenHeight - 1) / (a.scaleY * scaleY) + cMinY;
  return new ScreenTransform(cMinX,cMaxX,cMinY,cMaxY,screenWidth,screenHeight);
}
Program: 90962
Project: 90962
Buggy source:
@Override public ScreenTransform preConcatenate(final ScreenTransform a){
  final double cMinX=minX + a.minX / a.scaleX;
  final double cMaxX=(screenWidth - 1) / (scaleX * a.scaleX) + cMinX;
  final double cMinY=minY + a.minY / a.scaleY;
  final double cMaxY=(screenHeight - 1) / (scaleY * a.scaleY) + cMinY;
  return new ScreenTransform(cMinX,cMaxX,cMinY,cMaxY,screenWidth,screenHeight);
}

Fixed version (ground truth):
@Override public ScreenTransform preConcatenate(final ScreenTransform a){
  final double cMinX=minX + a.minX / scaleX;
  final double cMaxX=(screenWidth - 1) / (scaleX * a.scaleX) + cMinX;
  final double cMinY=minY + a.minY / scaleY;
  final double cMaxY=(screenHeight - 1) / (scaleY * a.scaleY) + cMinY;
  return new ScreenTransform(cMinX,cMaxX,cMinY,cMaxY,screenWidth,screenHeight);
}
Program: 90963
Project: 90963
Buggy source:
/** 
 * Check whether the given   {@link ScreenTransform} covers an area havingwidth greater or equal to the specified  {@code maxSizeY}.
 * @param transform
 * @param maxSizeX
 * @return true, iff {@code transform} covers greater than or equal to{@code maxSizeY}.
 */
public static boolean hasMaxSizeY(final ScreenTransform transform,final double maxSizeY){
  return transform.getMaxY() - transform.getMinY() >= maxSizeY;
}

Fixed version (ground truth):
/** 
 * Check whether the given   {@link ScreenTransform} covers an area havingwidth greater or equal to the specified  {@code maxSizeY}.
 * @param transform
 * @param maxSizeY
 * @return true, iff {@code transform} covers greater than or equal to{@code maxSizeY}.
 */
public static boolean hasMaxSizeY(final ScreenTransform transform,final double maxSizeY){
  return transform.getMaxY() - transform.getMinY() >= maxSizeY;
}
Program: 90964
Project: 90964
Buggy source:
/** 
 * Check whether the given   {@link ScreenTransform} covers an area havingwidth less or equal to the specified  {@code minSizeY}.
 * @param transform
 * @param minSizeX
 * @return true, iff {@code transform} covers less than or equal to{@code minSizeY}.
 */
public static boolean hasMinSizeY(final ScreenTransform transform,final double minSizeY){
  return transform.getMaxY() - transform.getMinY() <= minSizeY;
}

Fixed version (ground truth):
/** 
 * Check whether the given   {@link ScreenTransform} covers an area havingwidth less or equal to the specified  {@code minSizeY}.
 * @param transform
 * @param minSizeY
 * @return true, iff {@code transform} covers less than or equal to{@code minSizeY}.
 */
public static boolean hasMinSizeY(final ScreenTransform transform,final double minSizeY){
  return transform.getMaxY() - transform.getMinY() <= minSizeY;
}
Program: 90965
Project: 90965
Buggy source:
/** 
 * Set this transform to linear interpolation   {@code (1 - ratio) * start + ratio * end}.
 */
public void interpolate(final ScreenTransform start,final ScreenTransform end,final double ratio){
  this.minX=(1 - ratio) * start.minX + ratio * end.minX;
  this.maxX=(1 - ratio) * start.maxX + ratio * end.maxX;
  this.minY=(1 - ratio) * start.minY + ratio * end.minY;
  this.maxY=(1 - ratio) * start.maxY + ratio * end.maxY;
  this.screenWidth=(int)((1 - ratio) * start.screenWidth + ratio * end.screenWidth);
  this.screenHeight=(int)((1 - ratio) * start.screenHeight + ratio * end.screenHeight);
  update();
}

Fixed version (ground truth):
/** 
 * Set this transform to linear interpolation   {@code (1 - ratio) * start + ratio * end}.
 */
public void interpolate(final ScreenTransform start,final ScreenTransform end,final double ratio){
  this.minX=(1 - ratio) * start.minX + ratio * end.minX;
  this.maxX=(1 - ratio) * start.maxX + ratio * end.maxX;
  this.minY=(1 - ratio) * start.minY + ratio * end.minY;
  this.maxY=(1 - ratio) * start.maxY + ratio * end.maxY;
  this.screenWidth=(int)Math.round(((1 - ratio) * start.screenWidth + ratio * end.screenWidth));
  this.screenHeight=(int)Math.round(((1 - ratio) * start.screenHeight + ratio * end.screenHeight));
  update();
}
Program: 90966
Project: 90966
Buggy source:
/** 
 * Returns the set of all the vertices in the rectangle with two corners  {@code (lx1, ly1)} and {@code (lx2, ly2)} in layoutcoordinates.
 * @param lx1 the x coordinate of the first corner.
 * @param ly1 the y coordinate of the first corner.
 * @param lx2 the x coordinate of the second corner.
 * @param ly2 the y coordinate of the second corner.
 * @return a new set.
 */
public RefSet<TrackSchemeVertex> getVerticesWithin(final double lx1,final double ly1,final double lx2,final double ly2){
  final int tStart=(int)Math.ceil(Math.min(ly1,ly2));
  final int tEnd=(int)Math.floor(Math.max(ly1,ly2)) + 1;
  final double x1=Math.min(lx1,lx2) - 1;
  final double x2=Math.max(lx1,lx2);
  final RefSet<TrackSchemeVertex> vertexSet=graph.createVertexSet();
  int start=timepoints.binarySearch(tStart);
  if (start < 0)   start=-start - 1;
  int end=timepoints.binarySearch(tEnd);
  if (end < 0)   end=-end - 1;
  for (int tpIndex=start; tpIndex < end; ++tpIndex) {
    final TrackSchemeVertexList vertexList=timepointToOrderedVertices.get(timepoints.get(tpIndex));
    final int left=vertexList.binarySearch(x1) + 1;
    final int right=vertexList.binarySearch(x2,left,vertexList.size());
    vertexSet.addAll(vertexList.subList(left,right + 1));
  }
  return vertexSet;
}

Fixed version (ground truth):
/** 
 * Returns the set of all the vertices in the rectangle with two corners  {@code (lx1, ly1)} and {@code (lx2, ly2)} in layoutcoordinates.
 * @param lx1 the x coordinate of the first corner.
 * @param ly1 the y coordinate of the first corner.
 * @param lx2 the x coordinate of the second corner.
 * @param ly2 the y coordinate of the second corner.
 * @return a new set.
 */
public RefSet<TrackSchemeVertex> getVerticesWithin(final double lx1,final double ly1,final double lx2,final double ly2){
  final int tStart=(int)Math.ceil(Math.min(ly1,ly2));
  final int tEnd=(int)Math.floor(Math.max(ly1,ly2)) + 1;
  final double x1=Math.min(lx1,lx2);
  final double x2=Math.max(lx1,lx2);
  final RefSet<TrackSchemeVertex> vertexSet=graph.createVertexSet();
  int start=timepoints.binarySearch(tStart);
  if (start < 0)   start=-start - 1;
  int end=timepoints.binarySearch(tEnd);
  if (end < 0)   end=-end - 1;
  for (int tpIndex=start; tpIndex < end; ++tpIndex) {
    final TrackSchemeVertexList vertexList=timepointToOrderedVertices.get(timepoints.get(tpIndex));
    final int left=vertexList.binarySearch(x1) + 1;
    final int right=vertexList.binarySearch(x2,left,vertexList.size());
    vertexSet.addAll(vertexList.subList(left,right + 1));
  }
  return vertexSet;
}
Program: 90967
Project: 90967
Buggy source:
/** 
 * Returns the set of all the vertices in the rectangle with two corners  {@code (lx1, ly1)} and {@code (lx2, ly2)} in layoutcoordinates.
 * @param lx1 the x coordinate of the first corner.
 * @param ly1 the y coordinate of the first corner.
 * @param lx2 the x coordinate of the second corner.
 * @param ly2 the y coordinate of the second corner.
 * @return a new set.
 */
public RefSet<TrackSchemeVertex> getVerticesWithin(final double lx1,final double ly1,final double lx2,final double ly2){
  final int tStart=(int)Math.ceil(Math.min(ly1,ly2));
  final int tEnd=(int)Math.floor(Math.max(ly1,ly2)) + 1;
  final double x1=Math.min(lx1,lx2) - 1;
  final double x2=Math.max(lx1,lx2);
  final RefSet<TrackSchemeVertex> vertexSet=graph.createVertexSet();
  int start=timepoints.binarySearch(tStart);
  if (start < 0)   start=-start - 1;
  int end=timepoints.binarySearch(tEnd);
  if (end < 0)   end=-end - 1;
  for (int tpIndex=start; tpIndex < end; ++tpIndex) {
    final TrackSchemeVertexList vertexList=timepointToOrderedVertices.get(timepoints.get(tpIndex));
    final int left=vertexList.binarySearch(x1) + 1;
    final int right=vertexList.binarySearch(x2,left,vertexList.size());
    vertexSet.addAll(vertexList.subList(left,right + 1));
  }
  return vertexSet;
}

Fixed version (ground truth):
/** 
 * Returns the set of all the vertices in the rectangle with two corners  {@code (lx1, ly1)} and {@code (lx2, ly2)} in layoutcoordinates.
 * @param lx1 the x coordinate of the first corner.
 * @param ly1 the y coordinate of the first corner.
 * @param lx2 the x coordinate of the second corner.
 * @param ly2 the y coordinate of the second corner.
 * @return a new set.
 */
public RefSet<TrackSchemeVertex> getVerticesWithin(final double lx1,final double ly1,final double lx2,final double ly2){
  final int tStart=(int)Math.ceil(Math.min(ly1,ly2));
  final int tEnd=(int)Math.floor(Math.max(ly1,ly2)) + 1;
  final double x1=Math.min(lx1,lx2);
  final double x2=Math.max(lx1,lx2);
  final RefSet<TrackSchemeVertex> vertexSet=graph.createVertexSet();
  int start=timepoints.binarySearch(tStart);
  if (start < 0)   start=-start - 1;
  int end=timepoints.binarySearch(tEnd);
  if (end < 0)   end=-end - 1;
  for (int tpIndex=start; tpIndex < end; ++tpIndex) {
    final TrackSchemeVertexList vertexList=timepointToOrderedVertices.get(timepoints.get(tpIndex));
    final int left=vertexList.binarySearch(x1) + 1;
    final int right=vertexList.binarySearch(x2,left,vertexList.size());
    vertexSet.addAll(vertexList.subList(left,right + 1));
  }
  return vertexSet;
}
Program: 90968
Project: 90968
Buggy source:
/** 
 * Retrieves and removes the head of this queue, or returns <code>null</code> if this queue is empty.
 * @return the head of this queue, or <code>null</code> if this queue isempty
 */
public O poll(final O obj){
  if (queue.isEmpty()) {
    return null;
  }
  return element(obj);
}

Fixed version (ground truth):
/** 
 * Retrieves and removes the head of this queue, or returns  {@code null} if this queue is empty.
 * @return the head of this queue, or {@code null} if this queue isempty
 */
public O poll(final O obj){
  if (queue.isEmpty()) {
    return null;
  }
  return element(obj);
}
Program: 90969
Project: 90969
Buggy source:
/** 
 * Retrieves, but does not remove the head of this queue.
 * @param obj the pool object ref to update with the content of the top item.
 * @return the given object, updated to be the item at the top of thisqueue, or <code>null</code> if this queue is empty.
 */
public O peek(final O obj){
  if (queue.isEmpty()) {
    return null;
  }
  final int index=queue.get(0);
  pool.getByInternalPoolIndex(index,obj);
  return obj;
}

Fixed version (ground truth):
/** 
 * Retrieves, but does not remove the head of this queue.
 * @param obj the pool object ref to update with the content of the top item.
 * @return the given object, updated to be the item at the top of thisqueue, or  {@code null} if this queue is empty.
 */
public O peek(final O obj){
  if (queue.isEmpty()) {
    return null;
  }
  final int index=queue.get(0);
  pool.getByInternalPoolIndex(index,obj);
  return obj;
}
Program: 90970
Project: 90970
Buggy source:
/** 
 * Returns the connected component with the specified id, or <code>null</code> if the specified id does not exist.
 * @param id the id of the connected component.
 * @return the connected component.
 */
public RefSet<V> get(final int id){
  return ccMap.get(id);
}

Fixed version (ground truth):
/** 
 * Returns the connected component with the specified id, or  {@code null} if the specified id does not exist.
 * @param id the id of the connected component.
 * @return the connected component.
 */
public RefSet<V> get(final int id){
  return ccMap.get(id);
}
Program: 90971
Project: 90971
Buggy source:
/** 
 * Returns a new array containing the ids of the connected components of the graph.
 * @return a new <code>int</code> array.
 */
public int[] ids(){
  return ccMap.keys();
}

Fixed version (ground truth):
/** 
 * Returns a new array containing the ids of the connected components of the graph.
 * @return a new {@code int} array.
 */
public int[] ids(){
  return ccMap.keys();
}
Program: 90972
Project: 90972
Buggy source:
/** 
 * Finds the path between the specified vertices. <p> The success and result of this search strongly depends on whether this search is directed or undirected.
 * @param from the vertex to start search from.
 * @param to the vertex to reach.
 * @return a new {@link RefList}, containing the path found <b>in reverse order</b> (<code>to → from</code>). Returns <code>null</code> if a path cannot be found between the specified vertices.
 */
public RefList<V> findPath(final V from,final V to){
  final BreadthFirstSearch<V,E> search=new BreadthFirstSearch<V,E>(graph,directed);
  final VertexFinderListener vfl=new VertexFinderListener(to);
  search.setTraversalListener(vfl);
  search.start(from);
  if (search.wasAborted()) {
    V tmp=vertexRef();
    final RefList<V> path=createVertexList(search.depthOf(to) + 1);
    tmp=assign(to,tmp);
    path.add(tmp);
    while (!tmp.equals(from)) {
      tmp=assign(search.parent(tmp),tmp);
      path.add(tmp);
    }
    releaseRef(tmp);
    return path;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Finds the path between the specified vertices. <p> The success and result of this search strongly depends on whether this search is directed or undirected.
 * @param from the vertex to start search from.
 * @param to the vertex to reach.
 * @return a new {@link RefList}, containing the path found <b>in reverse order</b> (  {@code to → from}). Returns   {@code null} ifa path cannot be found between the specified vertices.
 */
public RefList<V> findPath(final V from,final V to){
  final BreadthFirstSearch<V,E> search=new BreadthFirstSearch<V,E>(graph,directed);
  final VertexFinderListener vfl=new VertexFinderListener(to);
  search.setTraversalListener(vfl);
  search.start(from);
  if (search.wasAborted()) {
    V tmp=vertexRef();
    final RefList<V> path=createVertexList(search.depthOf(to) + 1);
    tmp=assign(to,tmp);
    path.add(tmp);
    while (!tmp.equals(from)) {
      tmp=assign(search.parent(tmp),tmp);
      path.add(tmp);
    }
    releaseRef(tmp);
    return path;
  }
 else {
    return null;
  }
}
Program: 90973
Project: 90973
Buggy source:
/** 
 * Returns <code>true</code> if the graph iterated has a cycle.
 * @return <code>true</code> if the graph iterated is not a directed acyclicgraph.
 */
public boolean hasFailed(){
  return failed;
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if the graph iterated has a cycle.
 * @return {@code true} if the graph iterated is not a directed acyclicgraph.
 */
public boolean hasFailed(){
  return failed;
}
Program: 90974
Project: 90974
Buggy source:
/** 
 * Creates an object reference that can be used for processing with this map. Depending on concrete implementation, the object return can be <code>null</code>.
 * @return a new object empty reference.
 */
public V createRef();

Fixed version (ground truth):
/** 
 * Creates an object reference that can be used for processing with this map. Depending on concrete implementation, the object return can be  {@code null}.
 * @return a new object empty reference.
 */
public V createRef();
Program: 90975
Project: 90975
Buggy source:
/** 
 * Generates an object reference that can be used for retrieval. Depending on concrete implementation, this object returned can be <code>null.</code>
 * @return a new, uninitialized, reference object.
 */
public O createRef();

Fixed version (ground truth):
/** 
 * Generates an object reference that can be used for retrieval. Depending on concrete implementation, this object returned can be  {@code null.}
 * @return a new, uninitialized, reference object.
 */
public O createRef();
Program: 90976
Project: 90976
Buggy source:
/** 
 * Executes <tt>procedure</tt> for each key/value entry in the map.
 * @param procedure a <code>TOIntIntProcedure</code> value.
 * @param ref an object reference that can be used for retrieval. Depending on concrete implementation, this object can be cleared, ignored or re-used.
 * @return <code>false</code> if the loop over the entries terminatedbecause the procedure returned false for some entry.
 */
public boolean forEachEntry(TObjectIntProcedure<? super K> procedure,K ref);

Fixed version (ground truth):
/** 
 * Executes <tt>procedure</tt> for each key/value entry in the map.
 * @param procedure a  {@code TOIntIntProcedure} value.
 * @param ref an object reference that can be used for retrieval. Depending on concrete implementation, this object can be cleared, ignored or re-used.
 * @return {@code false} if the loop over the entries terminatedbecause the procedure returned false for some entry.
 */
public boolean forEachEntry(TObjectIntProcedure<? super K> procedure,K ref);
Program: 90977
Project: 90977
Buggy source:
/** 
 * Executes <tt>procedure</tt> for each key in the map.
 * @param procedure a <code>TIntProcedure</code> value.
 * @param ref an object reference that can be used for retrieval. Depending on concrete implementation, this object can be cleared, ignored or re-used.
 * @return <code>false</code> if the loop over the keys terminated becausethe procedure returned false for some key.
 */
public boolean forEachKey(TObjectProcedure<? super K> procedure,K ref);

Fixed version (ground truth):
/** 
 * Executes <tt>procedure</tt> for each key in the map.
 * @param procedure a  {@code TIntProcedure} value.
 * @param ref an object reference that can be used for retrieval. Depending on concrete implementation, this object can be cleared, ignored or re-used.
 * @return {@code false} if the loop over the keys terminated becausethe procedure returned false for some key.
 */
public boolean forEachKey(TObjectProcedure<? super K> procedure,K ref);
Program: 90978
Project: 90978
Buggy source:
/** 
 * Retains only those entries in the map for which the procedure returns a true value.
 * @param procedure determines which entries to keep.
 * @param ref an object reference that can be used for retrieval. Depending on concrete implementation, this object can be cleared, ignored or re-used.
 * @return <code>true</code> if the map was modified.
 */
public boolean retainEntries(TObjectIntProcedure<? super K> procedure,K ref);

Fixed version (ground truth):
/** 
 * Retains only those entries in the map for which the procedure returns a true value.
 * @param procedure determines which entries to keep.
 * @param ref an object reference that can be used for retrieval. Depending on concrete implementation, this object can be cleared, ignored or re-used.
 * @return {@code true} if the map was modified.
 */
public boolean retainEntries(TObjectIntProcedure<? super K> procedure,K ref);
Program: 90979
Project: 90979
Buggy source:
/** 
 * Creates an object reference that can be used for processing with this map. Depending on concrete implementation, the object return can be <code>null</code>.
 * @return a new object empty reference.
 */
public K createRef();

Fixed version (ground truth):
/** 
 * Creates an object reference that can be used for processing with this map. Depending on concrete implementation, the object return can be  {@code null}.
 * @return a new object empty reference.
 */
public K createRef();
Program: 90980
Project: 90980
Buggy source:
@Test public void testPutAll(){
  final PoolObjectPoolObjectMap<TestVertex,TestVertex> extraMap=new PoolObjectPoolObjectMap<TestVertex,TestVertex>(graph.vertexPool,graph.vertexPool);
  extraMap.put(Ak,Bk);
  extraMap.put(Bk,Ak);
  final int initSize=map.size();
  map.putAll(extraMap);
  assertEquals("String_Node_Str",initSize + 1,map.size());
  assertEquals("String_Node_Str",Bk.getInternalPoolIndex(),map.get(Ak).getInternalPoolIndex());
  assertEquals("String_Node_Str",Ak.getInternalPoolIndex(),map.get(Bk).getInternalPoolIndex());
}

Fixed version (ground truth):
@Test public void testPutAll(){
  final PoolObjectPoolObjectMap<TestVertex,TestVertex> extraMap=new PoolObjectPoolObjectMap<TestVertex,TestVertex>(graph.vertexPool,graph.vertexPool);
  extraMap.put(Ak,Bk);
  extraMap.put(Bk,Ak);
  final int initSize=map.size();
  map.putAll(extraMap);
  assertEquals("String_Node_Str",initSize + 1,map.size());
  assertEquals("String_Node_Str",Bk,map.get(Ak));
  assertEquals("String_Node_Str",Ak,map.get(Bk));
}
Program: 90981
Project: 90981
Buggy source:
/** 
 * Set entities for painting into the specified double-buffered  {@link AbstractTrackSchemeOverlay}. (This swaps  {@link #screenEntities} with pending entities from the overlay.)
 */
public void setPaintEntities(final AbstractTrackSchemeOverlay overlay){
  final ScreenEntities tmp=overlay.setScreenEntities(screenEntities);
  if (tmp == null)   screenEntities=new ScreenEntities(graph,capacity);
 else   screenEntities=tmp;
  screenEntities.clear();
}

Fixed version (ground truth):
/** 
 * Set entities for painting into the specified double-buffered  {@link AbstractTrackSchemeOverlay}. (This swaps  {@link #screenEntities} with pending entities from the overlay.)
 */
public void setPaintEntities(final AbstractTrackSchemeOverlay overlay){
  if (lastComputedScreenEntities == screenEntities) {
    final ScreenEntities tmp=overlay.setScreenEntities(screenEntities);
    if (tmp == null) {
      screenEntities=new ScreenEntities(graph,capacity);
    }
 else     screenEntities=tmp;
    screenEntities.clear();
  }
}
Program: 90982
Project: 90982
Buggy source:
/** 
 * Set entities for painting into the specified double-buffered  {@link AbstractTrackSchemeOverlay}. (This swaps  {@link #screenEntities} with pending entities from the overlay.)
 */
public void setPaintEntities(final AbstractTrackSchemeOverlay overlay){
  final ScreenEntities tmp=overlay.setScreenEntities(screenEntities);
  if (tmp == null)   screenEntities=new ScreenEntities(graph,capacity);
 else   screenEntities=tmp;
  screenEntities.clear();
}

Fixed version (ground truth):
/** 
 * Set entities for painting into the specified double-buffered  {@link AbstractTrackSchemeOverlay}. (This swaps  {@link #screenEntities} with pending entities from the overlay.)
 */
public void setPaintEntities(final AbstractTrackSchemeOverlay overlay){
  if (lastComputedScreenEntities == screenEntities) {
    final ScreenEntities tmp=overlay.setScreenEntities(screenEntities);
    if (tmp == null) {
      screenEntities=new ScreenEntities(graph,capacity);
    }
 else     screenEntities=tmp;
    screenEntities.clear();
  }
}
Program: 90983
Project: 90983
Buggy source:
/** 
 * Returns the set of all the vertices in the rectangle with two corners <code>(lx1, ly1)</code> and <code>(lx2, ly2)</code> in layout coordinates.
 * @param lx1 the x coordinate of the first corner.
 * @param ly1 the y coordinate of the first corner.
 * @param lx2 the x coordinate of the second corner.
 * @param ly2 the y coordinate of the second corner.
 * @return a new set.
 */
public RefSet<TrackSchemeVertex> getVerticesWithin(final double lx1,final double ly1,final double lx2,final double ly2){
  final int tStart=Math.max(0,(int)Math.ceil(Math.min(ly1,ly2)));
  final int tEnd=(int)Math.floor(Math.max(ly1,ly2));
  final double x1=Math.min(lx1,lx2);
  final double x2=Math.max(lx1,lx2);
  TrackSchemeVertex v=graph.vertexRef();
  final RefSet<TrackSchemeVertex> vertexSet=graph.createVertexSet();
  final TIntIterator tpIter=timepoints.subList(tStart,tEnd + 1).iterator();
  while (tpIter.hasNext()) {
    final TrackSchemeVertexList vertexList=timepointToOrderedVertices.get(tpIter.next());
    int left=vertexList.binarySearch(x1) + 1;
    if (left < 0)     left=0;
    int right=vertexList.binarySearch(x2,left,vertexList.size());
    if (right >= vertexList.size())     right=vertexList.size() - 1;
    for (int i=left; i <= right; i++) {
      v=vertexList.get(i,v);
      vertexSet.add(v);
    }
  }
  graph.releaseRef(v);
  return vertexSet;
}

Fixed version (ground truth):
/** 
 * Returns the set of all the vertices in the rectangle with two corners <code>(lx1, ly1)</code> and <code>(lx2, ly2)</code> in layout coordinates.
 * @param lx1 the x coordinate of the first corner.
 * @param ly1 the y coordinate of the first corner.
 * @param lx2 the x coordinate of the second corner.
 * @param ly2 the y coordinate of the second corner.
 * @return a new set.
 */
public RefSet<TrackSchemeVertex> getVerticesWithin(final double lx1,final double ly1,final double lx2,final double ly2){
  final int tStart=Math.max(0,(int)Math.ceil(Math.min(ly1,ly2)));
  final int tEnd=(int)Math.floor(Math.max(ly1,ly2));
  final double x1=Math.min(lx1,lx2);
  final double x2=Math.max(lx1,lx2);
  TrackSchemeVertex v=graph.vertexRef();
  final RefSet<TrackSchemeVertex> vertexSet=graph.createVertexSet();
  int iStart=timepoints.binarySearch(tStart);
  if (iStart < 0)   iStart=-(1 + iStart);
  int iEnd=timepoints.binarySearch(tEnd);
  if (iEnd < 0)   iEnd=-(1 + iEnd);
  final TIntIterator tpIter=timepoints.subList(iStart,iEnd + 1).iterator();
  while (tpIter.hasNext()) {
    final TrackSchemeVertexList vertexList=timepointToOrderedVertices.get(tpIter.next());
    int left=vertexList.binarySearch(x1) + 1;
    if (left < 0)     left=0;
    int right=vertexList.binarySearch(x2,left,vertexList.size());
    if (right >= vertexList.size())     right=vertexList.size() - 1;
    for (int i=left; i <= right; i++) {
      v=vertexList.get(i,v);
      vertexSet.add(v);
    }
  }
  graph.releaseRef(v);
  return vertexSet;
}
Program: 90984
Project: 90984
Buggy source:
@Override public void edgeAdded(final E edge){
  final int id=idmap.getEdgeId(edge);
  idToTrackSchemeVertex.get(idmap.getVertexId(edge.getSource(mv)),tsv);
  idToTrackSchemeVertex.get(idmap.getVertexId(edge.getTarget(mv)),tsv2);
  if (tsv2.incomingEdges().isEmpty())   roots.remove(tsv2);
  addEdge(tsv,tsv2,tse);
  idToTrackSchemeEdge.put(id,tse);
}

Fixed version (ground truth):
@Override public void edgeAdded(final E edge){
  final int id=idmap.getEdgeId(edge);
  idToTrackSchemeVertex.get(idmap.getVertexId(edge.getSource(mv)),tsv);
  idToTrackSchemeVertex.get(idmap.getVertexId(edge.getTarget(mv)),tsv2);
  if (tsv2.incomingEdges().isEmpty())   roots.remove(tsv2);
  addEdge(tsv,tsv2,tse).init(id);
  idToTrackSchemeEdge.put(id,tse);
}
Program: 90985
Project: 90985
Buggy source:
@Override public void graphRebuilt(){
  idToTrackSchemeVertex.clear();
  idToTrackSchemeEdge.clear();
  for (  final V v : modelGraph.vertices()) {
    final int id=idmap.getVertexId(v);
    final int timepoint=v.getTimepoint();
    addVertex(tsv).init(id,timepoint);
    idToTrackSchemeVertex.put(id,tsv);
    if (v.incomingEdges().isEmpty())     roots.add(tsv);
  }
  for (  final E e : modelGraph.edges()) {
    final int id=idmap.getEdgeId(e);
    idToTrackSchemeVertex.get(idmap.getVertexId(e.getSource(mv)),tsv);
    idToTrackSchemeVertex.get(idmap.getVertexId(e.getTarget(mv)),tsv2);
    addEdge(tsv,tsv2,tse);
    idToTrackSchemeEdge.put(id,tse);
  }
}

Fixed version (ground truth):
@Override public void graphRebuilt(){
  idToTrackSchemeVertex.clear();
  idToTrackSchemeEdge.clear();
  for (  final V v : modelGraph.vertices()) {
    final int id=idmap.getVertexId(v);
    final int timepoint=v.getTimepoint();
    addVertex(tsv).init(id,timepoint);
    idToTrackSchemeVertex.put(id,tsv);
    if (v.incomingEdges().isEmpty())     roots.add(tsv);
  }
  for (  final E e : modelGraph.edges()) {
    final int id=idmap.getEdgeId(e);
    idToTrackSchemeVertex.get(idmap.getVertexId(e.getSource(mv)),tsv);
    idToTrackSchemeVertex.get(idmap.getVertexId(e.getTarget(mv)),tsv2);
    addEdge(tsv,tsv2,tse).init(id);
    idToTrackSchemeEdge.put(id,tse);
  }
}
Program: 90986
Project: 90986
Buggy source:
/** 
 * Returns the internal pool index of the   {@link TrackSchemeVertex}currently painted on this display at screen coordinates specified by  {@code x} and {@code y}. <p> This method exists to facilitate writing mouse handlers.
 * @param x the x screen coordinate
 * @param y the y screen coordinate
 * @return the internal pool index of the {@link TrackSchemeVertex} at{@code (x, y)}, or -1 if there is no vertex at this position.
 */
public int getVertexIdAt(final int x,final int y){
  final ScreenEntities ent=getScreenEntities();
  if (ent != null) {
    final RealPoint pos=new RealPoint(x,y);
    for (    final ScreenVertex v : ent.getVertices())     if (isInsidePaintedVertex(pos,v))     return v.getTrackSchemeVertexId();
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Returns the internal pool index of the   {@link TrackSchemeVertex}currently painted on this display at screen coordinates specified by  {@code x} and {@code y}. <p> This method exists to facilitate writing mouse handlers.
 * @param x the x screen coordinate
 * @param y the y screen coordinate
 * @return the internal pool index of the {@link TrackSchemeVertex} at{@code (x, y)}, or -1 if there is no vertex at this position.
 */
public int getVertexIdAt(final int x,final int y){
synchronized (entities) {
    final RealPoint pos=new RealPoint(x,y);
    for (    final ScreenVertex v : entities.getVertices())     if (isInsidePaintedVertex(pos,v))     return v.getTrackSchemeVertexId();
    return -1;
  }
}
Program: 90987
Project: 90987
Buggy source:
@Override public void drawOverlays(final Graphics g){
  final Graphics2D g2=(Graphics2D)g;
  final ScreenEntities ent=getScreenEntities();
  if (ent != null) {
    highlightedVertexId=highlight.getHighlightedVertexId();
    paintBackground(g2,ent);
    final RefList<ScreenEdge> edges=ent.getEdges();
    final RefList<ScreenVertex> vertices=ent.getVertices();
    final RefList<ScreenVertexRange> vertexRanges=ent.getRanges();
    final ScreenVertex vt=vertices.createRef();
    final ScreenVertex vs=vertices.createRef();
    beforeDrawEdge(g2);
    for (    final ScreenEdge edge : edges) {
      vertices.get(edge.getSourceScreenVertexIndex(),vs);
      vertices.get(edge.getTargetScreenVertexIndex(),vt);
      drawEdge(g2,edge,vs,vt);
    }
    beforeDrawVertex(g2);
    for (    final ScreenVertex vertex : vertices) {
      drawVertex(g2,vertex);
    }
    beforeDrawVertexRange(g2);
    for (    final ScreenVertexRange range : vertexRanges) {
      drawVertexRange(g2,range);
    }
    vertices.releaseRef(vs);
    vertices.releaseRef(vt);
  }
}

Fixed version (ground truth):
@Override public void drawOverlays(final Graphics g){
  final Graphics2D g2=(Graphics2D)g;
  swapScreenEntities();
  highlightedVertexId=highlight.getHighlightedVertexId();
  paintBackground(g2,entities);
  final RefList<ScreenEdge> edges=entities.getEdges();
  final RefList<ScreenVertex> vertices=entities.getVertices();
  final RefList<ScreenVertexRange> vertexRanges=entities.getRanges();
  final ScreenVertex vt=vertices.createRef();
  final ScreenVertex vs=vertices.createRef();
  beforeDrawEdge(g2);
  for (  final ScreenEdge edge : edges) {
    vertices.get(edge.getSourceScreenVertexIndex(),vs);
    vertices.get(edge.getTargetScreenVertexIndex(),vt);
    drawEdge(g2,edge,vs,vt);
  }
  beforeDrawVertex(g2);
  for (  final ScreenVertex vertex : vertices) {
    drawVertex(g2,vertex);
  }
  beforeDrawVertexRange(g2);
  for (  final ScreenVertexRange range : vertexRanges) {
    drawVertexRange(g2,range);
  }
  vertices.releaseRef(vs);
  vertices.releaseRef(vt);
}
Program: 90988
Project: 90988
Buggy source:
public AbstractTrackSchemeOverlay(final TrackSchemeHighlight highlight,final TrackSchemeOptions options){
  this.highlight=highlight;
  width=options.values.getWidth();
  height=options.values.getHeight();
  entities=null;
}

Fixed version (ground truth):
public AbstractTrackSchemeOverlay(final TrackSchemeGraph<?,?> graph,final TrackSchemeHighlight highlight,final TrackSchemeOptions options){
  this.highlight=highlight;
  width=options.values.getWidth();
  height=options.values.getHeight();
  entities=new ScreenEntities(graph);
}
Program: 90989
Project: 90989
Buggy source:
public int getEdgeIdAt(final int x,final int y,final double tolerance){
  final ScreenEntities ent=getScreenEntities();
  if (ent != null) {
    final RealPoint pos=new RealPoint(x,y);
    final RefList<ScreenVertex> vertices=ent.getVertices();
    final ScreenVertex vt=vertices.createRef();
    final ScreenVertex vs=vertices.createRef();
    for (    final ScreenEdge e : ent.getEdges()) {
      vertices.get(e.getSourceScreenVertexIndex(),vs);
      vertices.get(e.getTargetScreenVertexIndex(),vt);
      if (distanceToPaintedEdge(pos,e,vs,vt) <= tolerance) {
        return e.getTrackSchemeEdgeId();
      }
    }
  }
  return -1;
}

Fixed version (ground truth):
public int getEdgeIdAt(final int x,final int y,final double tolerance){
synchronized (entities) {
    final RealPoint pos=new RealPoint(x,y);
    final RefList<ScreenVertex> vertices=entities.getVertices();
    final ScreenVertex vt=vertices.createRef();
    final ScreenVertex vs=vertices.createRef();
    for (    final ScreenEdge e : entities.getEdges()) {
      vertices.get(e.getSourceScreenVertexIndex(),vs);
      vertices.get(e.getTargetScreenVertexIndex(),vt);
      if (distanceToPaintedEdge(pos,e,vs,vt) <= tolerance) {
        return e.getTrackSchemeEdgeId();
      }
    }
  }
  return -1;
}
Program: 90991
Project: 90991
Buggy source:
public DefaultTrackSchemeOverlay(final TrackSchemeHighlight highlight,final TrackSchemeOptions options){
  super(highlight,options);
}

Fixed version (ground truth):
public DefaultTrackSchemeOverlay(final TrackSchemeGraph<?,?> graph,final TrackSchemeHighlight highlight,final TrackSchemeOptions options){
  super(graph,highlight,options);
}
Program: 90992
Project: 90992
Buggy source:
@Override public void mouseWheelMoved(final MouseWheelEvent e){
  final int x=e.getX();
  final int y=e.getY();
  final V ref=graph.vertexRef();
  final V v=graphOverlay.getVertexAt(x,y,ref);
  graph.releaseRef(ref);
  highlight.highlightVertex(v);
}

Fixed version (ground truth):
@Override public void mouseWheelMoved(final MouseWheelEvent e){
  final int x=e.getX();
  final int y=e.getY();
  final V ref=graph.vertexRef();
  final V v=graphOverlay.getVertexAt(x,y,ref);
  highlight.highlightVertex(v);
  graph.releaseRef(ref);
}
Program: 90993
Project: 90993
Buggy source:
@Override public void mouseMoved(final MouseEvent e){
  final int x=e.getX();
  final int y=e.getY();
  final V ref=graph.vertexRef();
  final V v=graphOverlay.getVertexAt(x,y,ref);
  graph.releaseRef(ref);
  highlight.highlightVertex(v);
}

Fixed version (ground truth):
@Override public void mouseMoved(final MouseEvent e){
  final int x=e.getX();
  final int y=e.getY();
  final V ref=graph.vertexRef();
  final V v=graphOverlay.getVertexAt(x,y,ref);
  highlight.highlightVertex(v);
  graph.releaseRef(ref);
}
Program: 90994
Project: 90994
Buggy source:
@Override public void search(final RealLocalizable pos){
  bestSquDistance=Double.MAX_VALUE;
  bestVertexIndex=-1;
  search.search(pos);
  if (search.get() != null) {
    bestSquDistance=search.getSquareDistance();
    bestVertexIndex=search.get().getInternalPoolIndex();
  }
  final double[] p=new double[n];
  for (  final O v : added) {
    double sum=0;
    for (int d=0; d < n; ++d) {
      final double diff=v.getDoublePosition(d) - p[d];
      sum+=diff * diff;
    }
    if (sum < bestSquDistance) {
      bestSquDistance=sum;
      bestVertexIndex=v.getInternalPoolIndex();
    }
  }
  if (bestVertexIndex >= 0)   objPool.getByInternalPoolIndex(bestVertexIndex,bestVertex);
}

Fixed version (ground truth):
@Override public void search(final RealLocalizable pos){
  bestSquDistance=Double.MAX_VALUE;
  bestVertexIndex=-1;
  search.search(pos);
  if (search.get() != null) {
    bestSquDistance=search.getSquareDistance();
    bestVertexIndex=search.get().getInternalPoolIndex();
  }
  final double[] p=new double[n];
  pos.localize(p);
  for (  final O v : added) {
    double sum=0;
    for (int d=0; d < n; ++d) {
      final double diff=v.getDoublePosition(d) - p[d];
      sum+=diff * diff;
    }
    if (sum < bestSquDistance) {
      bestSquDistance=sum;
      bestVertexIndex=v.getInternalPoolIndex();
    }
  }
  if (bestVertexIndex >= 0)   objPool.getByInternalPoolIndex(bestVertexIndex,bestVertex);
}
Program: 90996
Project: 90996
Buggy source:
@Override public void vertexAdded(final V vertex){
  writeLock.lock();
  try {
    final int tp=vertex.getTimepoint();
    SpatialIndexImp<V> index=timepointToSpatialIndex.get(tp);
    if (index == null) {
      index=new SpatialIndexImp<V>(CollectionUtils.createVertexSet(graph),vertexPool);
      timepointToSpatialIndex.put(tp,index);
    }
    index.add(vertex);
  }
  finally {
    writeLock.lock();
  }
}

Fixed version (ground truth):
@Override public void vertexAdded(final V vertex){
  writeLock.lock();
  try {
    final int tp=vertex.getTimepoint();
    SpatialIndexImp<V> index=timepointToSpatialIndex.get(tp);
    if (index == null) {
      index=new SpatialIndexImp<V>(CollectionUtils.createVertexSet(graph),vertexPool);
      timepointToSpatialIndex.put(tp,index);
    }
    index.add(vertex);
  }
  finally {
    writeLock.unlock();
  }
}
Program: 90997
Project: 90997
Buggy source:
public NodeFactory(final Collection<O> objects,final RefPool<O> objectPool,final MemPool.Factory<T> poolFactory){
  this.poolFactory=poolFactory;
  this.numDimensions=objects.iterator().next().numDimensions();
  this.sizeInBytes=KDTreeNode.sizeInBytes(numDimensions);
  final int capacity=objects.size();
  kdtree=new KDTree<O,T>(capacity,this,numDimensions,objects,objectPool);
}

Fixed version (ground truth):
public NodeFactory(final Collection<O> objects,final RefPool<O> objectPool,final MemPool.Factory<T> poolFactory){
  this.poolFactory=poolFactory;
  if (objects.isEmpty()) {
    final O ref=objectPool.createRef();
    this.numDimensions=ref.numDimensions();
    objectPool.releaseRef(ref);
  }
 else   this.numDimensions=objects.iterator().next().numDimensions();
  this.sizeInBytes=KDTreeNode.sizeInBytes(numDimensions);
  final int capacity=objects.size();
  kdtree=new KDTree<O,T>(capacity,this,numDimensions,objects,objectPool);
}
Program: 90998
Project: 90998
Buggy source:
@Override public SpatialIndex<OverlayVertexWrapper<V,E>> getSpatialIndex(final int fromTimepoint,final int toTimepoint){
  return new SpatialIndexWrapper<V,E>(graphWrapper,wrappedIndex.getSpatialIndex(fromTimepoint,toTimepoint));
}

Fixed version (ground truth):
@Override public SpatialIndex<OverlayVertexWrapper<V,E>> getSpatialIndex(final int fromTimepoint,final int toTimepoint){
  final SpatialIndex<V> index=wrappedIndex.getSpatialIndex(fromTimepoint,toTimepoint);
  if (index == null)   return null;
 else   return new SpatialIndexWrapper<V,E>(graphWrapper,index);
}
Program: 90999
Project: 90999
Buggy source:
@Override public L remove(final Object key,final L ref){
  return remove(key);
}

Fixed version (ground truth):
@Override public L remove(final Object key){
  return map.remove(key);
}
Program: 91000
Project: 91000
Buggy source:
@Test public void testRemoveObjectL(){
  final int size=map.size();
  final TestEdge ref=graph.edgeRef();
  final TestEdge remove=map.remove(Ak,ref);
  assertNull("String_Node_Str",remove);
  assertEquals("String_Node_Str",size,map.size());
  final TestEdge remove2=map.remove(Bk,ref);
  assertEquals("String_Node_Str",eAB,remove2);
  assertEquals("String_Node_Str",size - 1,map.size());
}

Fixed version (ground truth):
@Test public void testRemoveObjectL(){
  final int size=map.size();
  final TestEdge ref=graph.edgeRef();
  final TestEdge remove=map.removeWithRef(Ak,ref);
  assertNull("String_Node_Str",remove);
  assertEquals("String_Node_Str",size,map.size());
  final TestEdge remove2=map.removeWithRef(Bk,ref);
  assertEquals("String_Node_Str",eAB,remove2);
  assertEquals("String_Node_Str",size - 1,map.size());
}
Program: 91001
Project: 91001
Buggy source:
@Override @Test public void testRemoveObjectL(){
  final int size=map.size();
  final TestVertex ref=graph.vertexRef();
  final TestVertex remove=map.remove(Ak,ref);
  assertNull("String_Node_Str",remove);
  assertEquals("String_Node_Str",size,map.size());
  final TestVertex remove2=map.remove(Bk,ref);
  assertEquals("String_Node_Str",Ck2,remove2);
  assertEquals("String_Node_Str",size - 1,map.size());
}

Fixed version (ground truth):
@Override @Test public void testRemoveObjectL(){
  final int size=map.size();
  final TestVertex ref=graph.vertexRef();
  final TestVertex remove=map.removeWithRef(Ak,ref);
  assertNull("String_Node_Str",remove);
  assertEquals("String_Node_Str",size,map.size());
  final TestVertex remove2=map.removeWithRef(Bk,ref);
  assertEquals("String_Node_Str",Ck2,remove2);
  assertEquals("String_Node_Str",size - 1,map.size());
}
Program: 91002
Project: 91002
Buggy source:
@Test public void testRemoveObjectL(){
  final int size=map.size();
  final TestVertex ref=graph.vertexRef();
  final TestVertex remove=map.remove(Ak,ref);
  assertNull("String_Node_Str",remove);
  assertEquals("String_Node_Str",size,map.size());
  final TestVertex remove2=map.remove(Bk,ref);
  assertEquals("String_Node_Str",Ck,remove2);
  assertEquals("String_Node_Str",size - 1,map.size());
}

Fixed version (ground truth):
@Test public void testRemoveObjectL(){
  final int size=map.size();
  final TestVertex ref=graph.vertexRef();
  final TestVertex remove=map.removeWithRef(Ak,ref);
  assertNull("String_Node_Str",remove);
  assertEquals("String_Node_Str",size,map.size());
  final TestVertex remove2=map.removeWithRef(Bk,ref);
  assertEquals("String_Node_Str",Ck,remove2);
  assertEquals("String_Node_Str",size - 1,map.size());
}
Program: 91003
Project: 91003
Buggy source:
private void install(){
  final HashSet<AbstractNamedDefaultKeyStrokeAction> actions=new HashSet<AbstractNamedDefaultKeyStrokeAction>();
  actions.add(new ChangeSpotRadiusAction(true,true));
  actions.add(new ChangeSpotRadiusAction(true,false));
  actions.add(new ChangeSpotRadiusAction(false,true));
  actions.add(new ChangeSpotRadiusAction(false,false));
  for (  final AbstractNamedDefaultKeyStrokeAction action : actions) {
    actionMap.put(action.name(),action);
    inputMap.put(action.getDefaultKeyStroke(),action.name());
  }
}

Fixed version (ground truth):
private void install(){
  final HashSet<AbstractNamedDefaultKeyStrokeAction> actions=new HashSet<AbstractNamedDefaultKeyStrokeAction>();
  actions.add(new ChangeSpotRadiusAction(true,true));
  actions.add(new ChangeSpotRadiusAction(true,false));
  actions.add(new ChangeSpotRadiusAction(false,true));
  actions.add(new ChangeSpotRadiusAction(false,false));
  actions.add(new DeleteSpotAction());
  for (  final AbstractNamedDefaultKeyStrokeAction action : actions) {
    actionMap.put(action.name(),action);
    inputMap.put(action.getDefaultKeyStroke(),action.name());
  }
}
Program: 91004
Project: 91004
Buggy source:
private boolean deleteSpot(final SpotCovariance spot){
  final int timepoint=spot.getTimepoint();
  trackscheme.getGraph().remove(getTrackSchemeVertex(spot));
  final boolean ok=model.deleteSpot(spot);
  wrapper.refresh(timepoint);
  return ok;
}

Fixed version (ground truth):
private boolean deleteSpot(final OverlayVertexWrapper<SpotCovariance,Link<SpotCovariance>> v){
  final int timepoint=v.getTimepoint();
  final PoolObjectSet<OverlayVertexWrapper<SpotCovariance,Link<SpotCovariance>>> set=(PoolObjectSet<OverlayVertexWrapper<SpotCovariance,Link<SpotCovariance>>>)wrapper.getSpots(timepoint);
  set.getIndexCollection().remove(v.getInternalPoolIndex());
  trackscheme.getGraph().remove(v.getTrackSchemeVertex());
  final boolean ok=model.deleteSpot(v.get());
  wrapper.updateSearchFor(timepoint);
  return ok;
}
Program: 91005
Project: 91005
Buggy source:
private void quicksort(final int low,final int high,final Comparator<O> comparator,final O tmpRef1,final O tmpRef2){
  final O pivot=get((low + high) / 2,tmpRef1);
  int i=low;
  int j=high;
  do {
    while (comparator.compare(get(i,tmpRef2),pivot) < 0)     i++;
    while (comparator.compare(pivot,get(j,tmpRef2)) < 0)     j--;
    if (i <= j) {
      swap(i,j);
      i++;
      j--;
    }
  }
 while (i <= j);
  if (low < j)   quicksort(low,j,comparator,tmpRef1,tmpRef2);
  if (i < high)   quicksort(i,high,comparator,tmpRef1,tmpRef2);
}

Fixed version (ground truth):
private void quicksort(final int low,final int high,final Comparator<? super O> comparator,final O tmpRef1,final O tmpRef2){
  final O pivot=get((low + high) / 2,tmpRef1);
  int i=low;
  int j=high;
  do {
    while (comparator.compare(get(i,tmpRef2),pivot) < 0)     i++;
    while (comparator.compare(pivot,get(j,tmpRef2)) < 0)     j--;
    if (i <= j) {
      swap(i,j);
      i++;
      j--;
    }
  }
 while (i <= j);
  if (low < j)   quicksort(low,j,comparator,tmpRef1,tmpRef2);
  if (i < high)   quicksort(i,high,comparator,tmpRef1,tmpRef2);
}
Program: 91006
Project: 91006
Buggy source:
@Override public void sort(final Comparator<O> comparator){
  if (indices.size() < 2)   return;
  quicksort(0,size() - 1,comparator,createRef(),createRef());
}

Fixed version (ground truth):
@Override public void sort(final Comparator<? super O> comparator){
  if (indices.size() < 2)   return;
  quicksort(0,size() - 1,comparator,createRef(),createRef());
}
Program: 91007
Project: 91007
Buggy source:
/** 
 * Sort the values in the list, in ascending order according to the specified   {@link Comparator}.
 * @param comparator the comparator to use for ordering.
 */
public void sort(Comparator<O> comparator);

Fixed version (ground truth):
/** 
 * Sort the values in the list, in ascending order according to the specified   {@link Comparator}.
 * @param comparator the comparator to use for ordering.
 */
@Override public void sort(Comparator<? super O> comparator);
Program: 91008
Project: 91008
Buggy source:
@Override public void sort(final Comparator<O> comparator){
  Collections.sort(collection,comparator);
}

Fixed version (ground truth):
@Override public void sort(final Comparator<? super O> comparator){
  Collections.sort(collection,comparator);
}
Program: 91009
Project: 91009
Buggy source:
@Override public void refresh(){
  frame.repaint();
}

Fixed version (ground truth):
@Override public void refresh(){
  if (sl != null) {
    final RefSet<TrackSchemeVertex> selectedVertices=selectionModel.getSelectedVertices();
    if (!selectedVertices.isEmpty())     sl.select(selectedVertices.iterator().next());
    sl.repaint();
  }
  frame.repaint();
}