nus-yam/ex-repair huggingface dataset:
Program: 90906
Project: 90906
Buggy source:
public RefRefMap<O,O> createRefRefMap(final int initialCapacity);

Fixed version (ground truth):
public static <O>RefRefMap<O,O> createRefRefMap(final RefCollection<O> collection,final int initialCapacity){
  if (collection instanceof MapCreator)   return ((MapCreator<O>)collection).createRefRefMap(initialCapacity);
 else   return wrap(new HashMap<O,O>(initialCapacity));
}
Program: 90907
Project: 90907
Buggy source:
public RefSet<O> createRefSet(final int initialCapacity);

Fixed version (ground truth):
public static <O>RefSet<O> createRefSet(final RefCollection<O> collection,final int initialCapacity){
  if (collection instanceof SetCreator)   return ((SetCreator<O>)collection).createRefSet(initialCapacity);
 else   return wrap(new HashSet<O>(initialCapacity));
}
Program: 90908
Project: 90908
Buggy source:
public RefIntMap<O> createRefIntMap(final int noEntryValue,final int initialCapacity);

Fixed version (ground truth):
public static <O>RefIntMap<O> createRefIntMap(final RefCollection<O> collection,final int noEntryValue,final int initialCapacity){
  if (collection instanceof MapCreator)   return ((MapCreator<O>)collection).createRefIntMap(noEntryValue,initialCapacity);
 else   return new RefIntMapWrapper<O>(noEntryValue,initialCapacity);
}
Program: 90909
Project: 90909
Buggy source:
public <T>RefObjectMap<O,T> createRefObjectMap(final int initialCapacity);

Fixed version (ground truth):
public static <O,T>RefObjectMap<O,T> createRefObjectMap(final RefCollection<O> collection,final int initialCapacity){
  if (collection instanceof MapCreator)   return ((MapCreator<O>)collection).createRefObjectMap(initialCapacity);
 else   return wrap(new HashMap<O,T>(initialCapacity));
}
Program: 90910
Project: 90910
Buggy source:
public RefList<O> createRefList(final int initialCapacity);

Fixed version (ground truth):
public static <O>RefList<O> createRefList(final RefCollection<O> collection,final int initialCapacity){
  if (collection instanceof ListCreator)   return ((ListCreator<O>)collection).createRefList(initialCapacity);
 else   return wrap(new ArrayList<O>(initialCapacity));
}
Program: 90911
Project: 90911
Buggy source:
public RefDeque<O> createRefDeque(final int initialCapacity);

Fixed version (ground truth):
public static <O>RefDeque<O> createRefDeque(final RefCollection<O> collection,final int initialCapacity){
  if (collection instanceof DequeCreator)   return ((DequeCreator<O>)collection).createRefDeque(initialCapacity);
 else   return wrap(new ArrayDeque<O>(initialCapacity));
}
Program: 90912
Project: 90912
Buggy source:
public RefDoubleMap<O> createRefDoubleMap(final double noEntryValue,final int initialCapacity);

Fixed version (ground truth):
public static <O>RefDoubleMap<O> createRefDoubleMap(final RefCollection<O> collection,final double noEntryValue,final int initialCapacity){
  if (collection instanceof MapCreator)   return ((MapCreator<O>)collection).createRefDoubleMap(noEntryValue,initialCapacity);
 else   return new RefDoubleMapWrapper<O>(noEntryValue,initialCapacity);
}
Program: 90913
Project: 90913
Buggy source:
public RefStack<O> createRefStack(final int initialCapacity);

Fixed version (ground truth):
public static <O>RefStack<O> createRefStack(final RefCollection<O> collection,final int initialCapacity){
  if (collection instanceof StackCreator)   return ((StackCreator<O>)collection).createRefStack(initialCapacity);
 else   return wrapAsStack(new ArrayDeque<O>(initialCapacity));
}
Program: 90914
Project: 90914
Buggy source:
@Override public void focusVertex(final int id){
  if (id < 0)   focus.focusVertex(null);
 else {
    final V v=graph.vertexRef();
    focus.focusVertex(idmap.getVertex(id,v));
    graph.releaseRef(v);
  }
}

Fixed version (ground truth):
@Override public void focusVertex(final int id){
  if (id < 0)   focus.focusVertex(null);
 else {
    final V ref=graph.vertexRef();
    focus.focusVertex(idmap.getVertex(id,ref));
    graph.releaseRef(ref);
  }
}
Program: 90915
Project: 90915
Buggy source:
@Override public int getFocusedVertexId(){
  final V v=graph.vertexRef();
  final V h=focus.getFocusedVertex(v);
  final int id=(h == null) ? -1 : idmap.getVertexId(v);
  graph.releaseRef(v);
  return id;
}

Fixed version (ground truth):
@Override public int getFocusedVertexId(){
  final V ref=graph.vertexRef();
  final V focused=focus.getFocusedVertex(ref);
  final int id=(focused == null) ? -1 : idmap.getVertexId(focused);
  graph.releaseRef(ref);
  return id;
}
Program: 90916
Project: 90916
Buggy source:
@Override public Iterator<E> iterator(){
  final Iterator<E> itin=incoming.iterator();
  final Iterator<E> itout=incoming.iterator();
  return new Iterator<E>(){
    E next=fetch();
    E fetch(){
      if (itin.hasNext())       return itin.next();
 else       if (itout.hasNext())       return itout.next();
 else       return null;
    }
    @Override public boolean hasNext(){
      return next != null;
    }
    @Override public E next(){
      final E edge=next;
      next=fetch();
      return edge;
    }
  }
;
}

Fixed version (ground truth):
@Override public Iterator<E> iterator(){
  final Iterator<E> itin=incoming.iterator();
  final Iterator<E> itout=outgoing.iterator();
  return new Iterator<E>(){
    E next=fetch();
    E fetch(){
      if (itin.hasNext())       return itin.next();
 else       if (itout.hasNext())       return itout.next();
 else       return null;
    }
    @Override public boolean hasNext(){
      return next != null;
    }
    @Override public E next(){
      final E edge=next;
      next=fetch();
      return edge;
    }
  }
;
}
Program: 90918
Project: 90918
Buggy source:
@Test public void testLoopStdObjects(){
  final GraphTestBundle<ObjectVertex<Integer>,ObjectEdge<Integer>> bundle=GraphsForTests.loopStdObjects();
  final ObjectVertex<Integer> first=bundle.vertices.get(0);
  final DepthFirstSearch<ObjectVertex<Integer>,ObjectEdge<Integer>> dfs=new DepthFirstSearch<ObjectVertex<Integer>,ObjectEdge<Integer>>(bundle.graph,false);
  final List<EdgeClass> edgeClass=Arrays.asList(new EdgeClass[]{TREE,TREE,TREE,TREE,TREE,TREE,BACK});
  final List<ObjectVertex<Integer>> processedVertices=new ArrayList<ObjectVertex<Integer>>(7);
  processedVertices.add(bundle.vertices.get(6));
  processedVertices.add(bundle.vertices.get(5));
  processedVertices.add(bundle.vertices.get(4));
  processedVertices.add(bundle.vertices.get(3));
  processedVertices.add(bundle.vertices.get(2));
  processedVertices.add(bundle.vertices.get(1));
  processedVertices.add(bundle.vertices.get(0));
  final TraversalTester<ObjectVertex<Integer>,ObjectEdge<Integer>,DepthFirstSearch<ObjectVertex<Integer>,ObjectEdge<Integer>>> traversalTester=new TraversalTester<ObjectVertex<Integer>,ObjectEdge<Integer>,DepthFirstSearch<ObjectVertex<Integer>,ObjectEdge<Integer>>>(bundle.vertices.iterator(),processedVertices.iterator(),bundle.edges.iterator(),edgeClass.iterator());
  dfs.setTraversalListener(traversalTester);
  dfs.start(first);
  traversalTester.searchDone();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void testLoopStdObjects(){
  final GraphTestBundle<ObjectVertex<Integer>,ObjectEdge<Integer>> bundle=GraphsForTests.loopStdObjects();
  final ObjectVertex<Integer> first=bundle.vertices.get(0);
  final DepthFirstSearch<ObjectVertex<Integer>,ObjectEdge<Integer>> dfs=new DepthFirstSearch<ObjectVertex<Integer>,ObjectEdge<Integer>>(bundle.graph,false);
  final List<EdgeClass> edgeClass=Arrays.asList(new EdgeClass[]{TREE,TREE,TREE,TREE,TREE,TREE,BACK});
  final List<ObjectVertex<Integer>> discoveredVertices=Arrays.asList(new ObjectVertex[]{bundle.vertices.get(0),bundle.vertices.get(6),bundle.vertices.get(5),bundle.vertices.get(4),bundle.vertices.get(3),bundle.vertices.get(2),bundle.vertices.get(1)});
  final List<ObjectVertex<Integer>> processedVertices=Arrays.asList(new ObjectVertex[]{bundle.vertices.get(1),bundle.vertices.get(2),bundle.vertices.get(3),bundle.vertices.get(4),bundle.vertices.get(5),bundle.vertices.get(6),bundle.vertices.get(0)});
  final List<ObjectEdge<Integer>> expectedEdges=Arrays.asList(new ObjectEdge[]{bundle.edges.get(6),bundle.edges.get(5),bundle.edges.get(4),bundle.edges.get(3),bundle.edges.get(2),bundle.edges.get(1),bundle.edges.get(0)});
  final TraversalTester<ObjectVertex<Integer>,ObjectEdge<Integer>,DepthFirstSearch<ObjectVertex<Integer>,ObjectEdge<Integer>>> traversalTester=new TraversalTester<ObjectVertex<Integer>,ObjectEdge<Integer>,DepthFirstSearch<ObjectVertex<Integer>,ObjectEdge<Integer>>>(discoveredVertices.iterator(),processedVertices.iterator(),expectedEdges.iterator(),edgeClass.iterator());
  dfs.setTraversalListener(traversalTester);
  dfs.start(first);
  traversalTester.searchDone();
}
Program: 90919
Project: 90919
Buggy source:
@Override protected Map<V,T> createFeatureMap(final RefCollection<V> pool){
  return CollectionUtils.createRefObjectMap(pool);
}

Fixed version (ground truth):
@Override protected Map<O,T> createFeatureMap(final RefCollection<O> pool){
  return CollectionUtils.createRefObjectMap(pool);
}
Program: 90920
Project: 90920
Buggy source:
@Override public FeatureValue<T> createFeatureValue(final V object,final Features<V> features){
  return new ObjFeatureValue<>(features.getFeatureMap(this),object,new NotifyValueChange<>(features,this,object));
}

Fixed version (ground truth):
@Override public FeatureValue<T> createFeatureValue(final O object,final Features<O> features){
  return new ObjFeatureValue<>(features.getFeatureMap(this),object,new NotifyValueChange<>(features,this,object));
}
Program: 90921
Project: 90921
Buggy source:
@Override protected FeatureCleanup<V> createFeatureCleanup(final Map<V,T> featureMap){
  return new FeatureCleanup<V>(){
    @Override public void delete(    final V vertex){
      featureMap.remove(vertex);
    }
  }
;
}

Fixed version (ground truth):
@Override protected FeatureCleanup<O> createFeatureCleanup(final Map<O,T> featureMap){
  return new FeatureCleanup<O>(){
    @Override public void delete(    final O object){
      featureMap.remove(object);
    }
  }
;
}
Program: 90922
Project: 90922
Buggy source:
@Override public ObjUndoFeatureMap<V,T> createUndoFeatureMap(final Map<V,T> featureMap){
  return new ObjUndoFeatureMap<>(featureMap);
}

Fixed version (ground truth):
@Override public ObjUndoFeatureMap<O,T> createUndoFeatureMap(final Map<O,T> featureMap){
  return new ObjUndoFeatureMap<>(featureMap);
}
Program: 90923
Project: 90923
Buggy source:
/** 
 * Create a new feature.
 * @param name the unique name of the feature.
 * @throws DuplicateKeyException if a  {@link VertexFeature} with the same {@code name} alreadyexists.
 */
public ObjFeature(final String name) throws DuplicateKeyException {
  super(name);
}

Fixed version (ground truth):
/** 
 * Create a new feature.
 * @param name the unique name of the feature.
 * @throws DuplicateKeyException if a  {@link Feature} with the same {@code name} alreadyexists.
 */
public ObjFeature(final String name) throws DuplicateKeyException {
  super(name);
}
Program: 90924
Project: 90924
Buggy source:
@Override public void delete(final V vertex){
  featureMap.remove(vertex);
}

Fixed version (ground truth):
@Override public void delete(final O object){
  featureMap.remove(object);
}
Program: 90925
Project: 90925
Buggy source:
/** 
 * For internal use only. <p> This is only public because it needs to be accessed from  {@link RawFeatureIO}. <p> Returns the feature map for the given   {@code feature}. If the feature map doesn't exist yet, it is created (  {@link Feature#createFeatureMap(RefCollection)}) and  {@link CreateFeatureMapListener}s are notified.
 * @return feature map for the given {@code feature}.
 */
@SuppressWarnings("String_Node_Str") public <M>M getFeatureMap(final Feature<M,O,?> feature){
  M fmap=(M)featureMaps.get(feature);
  if (fmap == null) {
    fmap=feature.createFeatureMap(collection);
    featureMaps.put(feature,fmap);
    featureCleanups.add(feature.createFeatureCleanup(fmap));
    for (    final CreateFeatureMapListener<O> l : createFeatureMapListeners)     l.createFeatureMap(feature,fmap);
  }
  return fmap;
}

Fixed version (ground truth):
/** 
 * For internal use only. <p> This is only public because it needs to be accessed from  {@link RawFeatureIO}. <p> Returns the feature map for the given   {@code feature}. If the feature map doesn't exist yet, it is created (  {@link Feature#createFeatureMap(RefCollection)}) and  {@link CreateFeatureMapListener}s are notified.
 * @return feature map for the given {@code feature}.
 */
@SuppressWarnings("String_Node_Str") public <M>M getFeatureMap(final Feature<M,O,?> feature){
  M fmap=(M)featureMaps.get(feature);
  if (fmap == null) {
    fmap=feature.createFeatureMap(pool);
    featureMaps.put(feature,fmap);
    featureCleanups.add(feature.createFeatureCleanup(fmap));
    for (    final CreateFeatureMapListener<O> l : createFeatureMapListeners)     l.createFeatureMap(feature,fmap);
  }
  return fmap;
}
Program: 90926
Project: 90926
Buggy source:
public Features(final RefCollection<O> collection){
  this.collection=collection;
  featureMaps=new UniqueHashcodeArrayMap<>();
  featureCleanups=new ArrayList<>();
  createFeatureMapListeners=new ArrayList<>();
  featureChangeListeners=new ArrayList<>();
}

Fixed version (ground truth):
public Features(final RefCollection<O> pool){
  this.pool=pool;
  featureMaps=new UniqueHashcodeArrayMap<>();
  featureCleanups=new ArrayList<>();
  createFeatureMapListeners=new ArrayList<>();
  featureChangeListeners=new ArrayList<>();
}
Program: 90927
Project: 90927
Buggy source:
private static void readFeatureValue(final Model model,final int[] storage,final IntVertexFeature<Spot> feature){
  int index=0;
  for (  final Spot spot : model.getGraph().vertices()) {
    storage[index++]=spot.feature(feature).getInt();
  }
}

Fixed version (ground truth):
private static void readFeatureValue(final Model model,final int[] storage,final IntFeature<Spot> feature){
  int index=0;
  for (  final Spot spot : model.getGraph().vertices()) {
    storage[index++]=spot.feature(feature).getInt();
  }
}
Program: 90928
Project: 90928
Buggy source:
public static void main(final String[] args){
  final int N_RUNS=100;
  System.out.println("String_Node_Str");
  final long s=System.currentTimeMillis();
  final Model model=new CreateLargeModelExample().run(6,18,8);
  final int size=model.getGraph().vertices().size();
  final long e=System.currentTimeMillis();
  System.out.println(String.format("String_Node_Str",size,((double)e - s) / 1000.));
  final int[] storage=new int[size];
  final IntVertexFeature<Spot> POSITIVE_NUMBER=new IntVertexFeature<>("String_Node_Str",-1);
  System.out.println();
  final long s1=System.currentTimeMillis();
  BenchmarkHelper.benchmarkAndPrint(N_RUNS,false,() -> putFeatureValue(model,POSITIVE_NUMBER));
  final long e1=System.currentTimeMillis();
  System.out.println(String.format("String_Node_Str",size,((double)e1 - s1) / N_RUNS));
  System.out.println();
  final long s2=System.currentTimeMillis();
  BenchmarkHelper.benchmarkAndPrint(N_RUNS,false,() -> readGraphValue(model,storage));
  final long e2=System.currentTimeMillis();
  System.out.println(String.format("String_Node_Str",size,((double)e2 - s2) / N_RUNS));
  System.out.println();
  final long s3=System.currentTimeMillis();
  BenchmarkHelper.benchmarkAndPrint(N_RUNS,false,() -> readFeatureValue(model,storage,POSITIVE_NUMBER));
  final long e3=System.currentTimeMillis();
  System.out.println(String.format("String_Node_Str",size,((double)e3 - s3) / N_RUNS));
}

Fixed version (ground truth):
public static void main(final String[] args){
  final int N_RUNS=100;
  System.out.println("String_Node_Str");
  final long s=System.currentTimeMillis();
  final Model model=new CreateLargeModelExample().run(6,18,8);
  final int size=model.getGraph().vertices().size();
  final long e=System.currentTimeMillis();
  System.out.println(String.format("String_Node_Str",size,((double)e - s) / 1000.));
  final int[] storage=new int[size];
  final IntFeature<Spot> POSITIVE_NUMBER=new IntFeature<>("String_Node_Str",-1);
  System.out.println();
  final long s1=System.currentTimeMillis();
  BenchmarkHelper.benchmarkAndPrint(N_RUNS,false,() -> putFeatureValue(model,POSITIVE_NUMBER));
  final long e1=System.currentTimeMillis();
  System.out.println(String.format("String_Node_Str",size,((double)e1 - s1) / N_RUNS));
  System.out.println();
  final long s2=System.currentTimeMillis();
  BenchmarkHelper.benchmarkAndPrint(N_RUNS,false,() -> readGraphValue(model,storage));
  final long e2=System.currentTimeMillis();
  System.out.println(String.format("String_Node_Str",size,((double)e2 - s2) / N_RUNS));
  System.out.println();
  final long s3=System.currentTimeMillis();
  BenchmarkHelper.benchmarkAndPrint(N_RUNS,false,() -> readFeatureValue(model,storage,POSITIVE_NUMBER));
  final long e3=System.currentTimeMillis();
  System.out.println(String.format("String_Node_Str",size,((double)e3 - s3) / N_RUNS));
}
Program: 90929
Project: 90929
Buggy source:
private static void putFeatureValue(final Model model,final IntVertexFeature<Spot> feature){
  for (  final Spot spot : model.getGraph().vertices()) {
    spot.feature(feature).set(spot.getTimepoint());
  }
}

Fixed version (ground truth):
private static void putFeatureValue(final Model model,final IntFeature<Spot> feature){
  for (  final Spot spot : model.getGraph().vertices()) {
    spot.feature(feature).set(spot.getTimepoint());
  }
}
Program: 90930
Project: 90930
Buggy source:
@Override public int getHighlightedVertexId(){
  final V v=graph.vertexRef();
  final V h=highlight.getHighlightedVertex(v);
  final int id=(h == null) ? -1 : idmap.getVertexId(v);
  graph.releaseRef(v);
  return id;
}

Fixed version (ground truth):
@Override public int getHighlightedVertexId(){
  final V v=graph.vertexRef();
  final V h=highlight.getHighlightedVertex(v);
  final int id=(h == null) ? -1 : idmap.getVertexId(h);
  graph.releaseRef(v);
  return id;
}
Program: 90931
Project: 90931
Buggy source:
@Override public int getHighlightedEdgeId(){
  final E e=graph.edgeRef();
  final E h=highlight.getHighlightedEdge(e);
  final int id=(h == null) ? -1 : idmap.getEdgeId(e);
  graph.releaseRef(e);
  return id;
}

Fixed version (ground truth):
@Override public int getHighlightedEdgeId(){
  final E e=graph.edgeRef();
  final E h=highlight.getHighlightedEdge(e);
  final int id=(h == null) ? -1 : idmap.getEdgeId(h);
  graph.releaseRef(e);
  return id;
}
Program: 90932
Project: 90932
Buggy source:
/** 
 * Partition a sublist of KDTreeNodes such that the k-th smallest value is at position   {@code k}, elements before the k-th are smaller or equal and elements after the k-th are larger or equal. Elements are compared by their coordinate in the specified dimension.s Note, that is is assumed that the   {@link KDTreeNode}s are stored with consecutive indices in the pool.
 * @param i index of first element of the sublist
 * @param j index of last element of the sublist
 * @param k index for k-th smallest value. i <= k <= j.
 * @param compare_d dimension by which to compare.
 * @param pivot temporary  {@link KDTreeNode} reference.
 * @param ti temporary  {@link KDTreeNode} reference.
 * @param tj temporary  {@link KDTreeNode} reference.
 */
private void kthElement(int i,int j,final int k,final int compare_d,final KDTreeNode<O,T> pivot,final KDTreeNode<O,T> ti,final KDTreeNode<O,T> tj){
  while (true) {
    final int pivotpos=partitionSubList(i,j,compare_d,pivot,ti,tj);
    if (pivotpos > k) {
      j=pivotpos - 1;
    }
 else     if (pivotpos < k) {
      i=pivotpos + 1;
    }
 else     break;
  }
}

Fixed version (ground truth):
/** 
 * Partition a sublist of KDTreeNodes such that the k-th smallest value is at position   {@code k}, elements before the k-th are smaller or equal and elements after the k-th are larger or equal. Elements are compared by their coordinate in the specified dimension.s Note, that is is assumed that the   {@link KDTreeNode}s are stored with consecutive indices in the pool.
 * @param i index of first element of the sublist
 * @param j index of last element of the sublist
 * @param k index for k-th smallest value. i &lt;= k &lt;= j.
 * @param compare_d dimension by which to compare.
 * @param pivot temporary  {@link KDTreeNode} reference.
 * @param ti temporary  {@link KDTreeNode} reference.
 * @param tj temporary  {@link KDTreeNode} reference.
 */
private void kthElement(int i,int j,final int k,final int compare_d,final KDTreeNode<O,T> pivot,final KDTreeNode<O,T> ti,final KDTreeNode<O,T> tj){
  while (true) {
    final int pivotpos=partitionSubList(i,j,compare_d,pivot,ti,tj);
    if (pivotpos > k) {
      j=pivotpos - 1;
    }
 else     if (pivotpos < k) {
      i=pivotpos + 1;
    }
 else     break;
  }
}
Program: 90933
Project: 90933
Buggy source:
/** 
 * Return signed distance of timepoint t to t0, truncated at cutoff and scaled by 1/cutoff. t=t0 has d=0. t<=t0-cutoff has d=-1. t=>t0+cutoff has d=1.
 */
private static double timeDistance(final double t,final double t0,final double cutoff){
  final double d=t - t0;
  if (d > 0)   return Math.min(d,cutoff) / cutoff;
 else   return Math.max(d,-cutoff) / cutoff;
}

Fixed version (ground truth):
/** 
 * Return signed distance of timepoint t to t0, truncated at cutoff and scaled by 1/cutoff. t=t0 has d=0. t&lt;=t0-cutoff has d=-1. t=&gt;t0+cutoff has d=1.
 */
private static double timeDistance(final double t,final double t0,final double cutoff){
  final double d=t - t0;
  if (d > 0)   return Math.min(d,cutoff) / cutoff;
 else   return Math.max(d,-cutoff) / cutoff;
}
Program: 90934
Project: 90934
Buggy source:
/** 
 * Follow backwards along incoming edges until <ul> <li>(A) a vertex is reached that is already marked with ghostmark or mark, or <li>(B) vertex is reached that has timepoint <= minTimepoint. </ul> Mark all recursively visited vertices as ghosts. In case (B), add the final vertex to set of roots.
 */
private void buildContextTraceParents(final TrackSchemeVertex tv,final int ghostmark,final int minTimepoint,final RefList<TrackSchemeVertex> roots){
  if (tv.incomingEdges().isEmpty())   roots.add(tv);
 else {
    final TrackSchemeVertex ref=graph.vertexRef();
    for (    final TrackSchemeEdge te : tv.incomingEdges()) {
      final TrackSchemeVertex parent=te.getSource(ref);
      if (parent.getLayoutTimestamp() < ghostmark) {
        parent.setLayoutTimestamp(ghostmark);
        if (parent.getTimepoint() <= minTimepoint)         roots.add(parent);
 else         buildContextTraceParents(parent,ghostmark,minTimepoint,roots);
      }
    }
    graph.releaseRef(ref);
  }
}

Fixed version (ground truth):
/** 
 * Follow backwards along incoming edges until <ul> <li>(A) a vertex is reached that is already marked with ghostmark or mark, or <li>(B) vertex is reached that has timepoint &lt;= minTimepoint. </ul> Mark all recursively visited vertices as ghosts. In case (B), add the final vertex to set of roots.
 */
private void buildContextTraceParents(final TrackSchemeVertex tv,final int ghostmark,final int minTimepoint,final RefList<TrackSchemeVertex> roots){
  if (tv.incomingEdges().isEmpty())   roots.add(tv);
 else {
    final TrackSchemeVertex ref=graph.vertexRef();
    for (    final TrackSchemeEdge te : tv.incomingEdges()) {
      final TrackSchemeVertex parent=te.getSource(ref);
      if (parent.getLayoutTimestamp() < ghostmark) {
        parent.setLayoutTimestamp(ghostmark);
        if (parent.getTimepoint() <= minTimepoint)         roots.add(parent);
 else         buildContextTraceParents(parent,ghostmark,minTimepoint,roots);
      }
    }
    graph.releaseRef(ref);
  }
}
Program: 90936
Project: 90936
Buggy source:
public Model run(final int nStartingCells,final int nDivisions,final int nFramesPerDivision){
  final Spot mother=model.getGraph().vertexRef();
  for (int ic=0; ic < nStartingCells; ic++) {
    final double angle=2d * ic * Math.PI / N_STARTING_CELLS;
    final double vx=VELOCITY * Math.cos(angle);
    final double vy=VELOCITY * Math.sin(angle);
    final double x=0.;
    final double y=0.;
    final double z=N_DIVISIONS * VELOCITY;
    final double[] pos=new double[]{x,y,z};
    final double[][] cov=new double[][]{{RADIUS,0,0},{0,RADIUS,0},{0,0,RADIUS}};
    model.addSpot(0,pos,cov,mother);
    addBranch(mother,vx,vy,1,nDivisions,nFramesPerDivision);
  }
  model.getGraph().releaseRef(mother);
  return model;
}

Fixed version (ground truth):
public Model run(final int nStartingCells,final int nDivisions,final int nFramesPerDivision){
  final Spot tmp=model.getGraph().vertexRef();
  for (int ic=0; ic < nStartingCells; ic++) {
    final double angle=2d * ic * Math.PI / N_STARTING_CELLS;
    final double vx=VELOCITY * Math.cos(angle);
    final double vy=VELOCITY * Math.sin(angle);
    final double x=0.;
    final double y=0.;
    final double z=N_DIVISIONS * VELOCITY;
    final double[] pos=new double[]{x,y,z};
    final double[][] cov=new double[][]{{RADIUS,0,0},{0,RADIUS,0},{0,0,RADIUS}};
    final Spot mother=model.getGraph().addVertex(tmp).init(0,pos,cov);
    addBranch(mother,vx,vy,1,nDivisions,nFramesPerDivision);
  }
  model.getGraph().releaseRef(tmp);
  return model;
}
Program: 90937
Project: 90937
Buggy source:
public static void main(final String[] args){
  final Model model=new Model();
  final Spot ref=model.getGraph().vertexRef();
  final Random random=new Random();
  final double[] pos=new double[3];
  final double[][] cov=new double[3][3];
  for (int i=0; i < 1000000; ++i) {
    for (int d=0; d < 3; ++d)     pos[d]=random.nextDouble();
    final Spot spot=model.addSpot(0,pos,cov,ref);
    spot.feature(LABEL).set("String_Node_Str" + i);
    spot.feature(TRACKLENGTH).set(3);
  }
  model.getGraph().releaseRef(ref);
  while (true) {
    try {
      final File file=new File("String_Node_Str");
      long t0=System.currentTimeMillis();
      model.saveRaw(file);
      long t1=System.currentTimeMillis();
      System.out.println("String_Node_Str" + (t1 - t0) + "String_Node_Str");
      final Model loaded=new Model();
      final Spot s=loaded.addSpot(0,pos,cov,loaded.getGraph().vertexRef());
      s.feature(LABEL);
      s.feature(TRACKLENGTH);
      t0=System.currentTimeMillis();
      loaded.loadRaw(file);
      t1=System.currentTimeMillis();
      System.out.println("String_Node_Str" + (t1 - t0) + "String_Node_Str");
      final Spot next=model.getGraph().vertices().iterator().next();
      System.out.println(next.feature(LABEL).get());
      System.out.println(next.feature(TRACKLENGTH).get());
    }
 catch (    final IOException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public static void main(final String[] args){
  final Model model=new Model();
  final Spot ref=model.getGraph().vertexRef();
  final Random random=new Random();
  final double[] pos=new double[3];
  final double[][] cov=new double[3][3];
  for (int i=0; i < 1000000; ++i) {
    for (int d=0; d < 3; ++d)     pos[d]=random.nextDouble();
    final Spot spot=model.getGraph().addVertex(ref).init(0,pos,cov);
    spot.feature(LABEL).set("String_Node_Str" + i);
    spot.feature(TRACKLENGTH).set(3);
  }
  model.getGraph().releaseRef(ref);
  while (true) {
    try {
      final File file=new File("String_Node_Str");
      long t0=System.currentTimeMillis();
      model.saveRaw(file);
      long t1=System.currentTimeMillis();
      System.out.println("String_Node_Str" + (t1 - t0) + "String_Node_Str");
      final Model loaded=new Model();
      final Spot tmp=loaded.getGraph().vertexRef();
      final Spot s=loaded.getGraph().addVertex(tmp).init(0,pos,cov);
      s.feature(LABEL);
      s.feature(TRACKLENGTH);
      t0=System.currentTimeMillis();
      loaded.loadRaw(file);
      t1=System.currentTimeMillis();
      System.out.println("String_Node_Str" + (t1 - t0) + "String_Node_Str");
      final Spot next=model.getGraph().vertices().iterator().next();
      System.out.println(next.feature(LABEL).get());
      System.out.println(next.feature(TRACKLENGTH).get());
      loaded.getGraph().releaseRef(ref);
    }
 catch (    final IOException e) {
      e.printStackTrace();
    }
  }
}
Program: 90938
Project: 90938
Buggy source:
public E getEdge(final AbstractVertex<?,?,?> source,final AbstractVertex<?,?,?> target,final E edge){
  int nextSourceEdgeIndex=source.getFirstOutEdgeIndex();
  if (nextSourceEdgeIndex < 0)   return null;
  getObject(nextSourceEdgeIndex,edge);
  do {
    if (edge.getTargetVertexInternalPoolIndex() == target.getInternalPoolIndex())     return edge;
    getObject(nextSourceEdgeIndex,edge);
    nextSourceEdgeIndex=edge.getNextSourceEdgeIndex();
  }
 while (nextSourceEdgeIndex >= 0);
  return null;
}

Fixed version (ground truth):
public E getEdge(final AbstractVertex<?,?,?> source,final AbstractVertex<?,?,?> target,final E edge){
  int nextSourceEdgeIndex=source.getFirstOutEdgeIndex();
  if (nextSourceEdgeIndex < 0)   return null;
  do {
    getObject(nextSourceEdgeIndex,edge);
    if (edge.getTargetVertexInternalPoolIndex() == target.getInternalPoolIndex())     return edge;
    nextSourceEdgeIndex=edge.getNextSourceEdgeIndex();
  }
 while (nextSourceEdgeIndex >= 0);
  return null;
}
Program: 90939
Project: 90939
Buggy source:
/** 
 * Create BigDataViewer actions and install them in the specified  {@link InputActionBindings}.
 * @param inputActionBindings {@link InputMap} and {@link ActionMap} are installed here.
 * @param bdv Actions are targeted at this  {@link BigDataViewerMaMuT}.
 * @param keyProperties user-defined key-bindings.
 */
public static void installActionBindings(final InputActionBindings inputActionBindings,final Model model,final KeyStrokeAdder.Factory keyProperties){
  final UndoActions actions=new UndoActions(inputActionBindings,keyProperties);
  actions.runnableAction(model::undo,UNDO,UNDO_KEYS);
  actions.runnableAction(model::redo,REDO,REDO_KEYS);
}

Fixed version (ground truth):
/** 
 * Create Undo/Redo actions and install them in the specified  {@link InputActionBindings}.
 * @param inputActionBindings {@link InputMap} and {@link ActionMap} are installed here.
 * @param model Actions are targeted at this  {@link Model}s   {@code undo()} and{@code redo()} methods.
 * @param keyProperties user-defined key-bindings.
 */
public static void installActionBindings(final InputActionBindings inputActionBindings,final Model model,final KeyStrokeAdder.Factory keyProperties){
  final UndoActions actions=new UndoActions(inputActionBindings,keyProperties);
  actions.runnableAction(model::undo,UNDO,UNDO_KEYS);
  actions.runnableAction(model::redo,REDO,REDO_KEYS);
}
Program: 90940
Project: 90940
Buggy source:
/** 
 * Sends   {@link GraphListener#vertexAdded(net.trackmate.graph.zzgraphinterfaces.Vertex)} forthe specified vertex. Must be called, after {@link #addVertex(AbstractVertex)} and {@code Vertex.init(...)} has beencalled.
 * @param vertex vertex for which to send {@link GraphListener#vertexAdded(net.trackmate.graph.zzgraphinterfaces.Vertex)}.
 * @return the specified {@code vertex} argument.
 */
public V notifyVertexAdded(final V vertex);

Fixed version (ground truth):
/** 
 * Sends   {@link GraphListener#vertexAdded(Vertex)} for the specified vertex.Must be called, after {code addVertex(...)} and  {@code Vertex.init(...)}have been called.
 * @param vertex vertex for which to send {@link GraphListener#vertexAdded(Vertex)}.
 * @return the specified {@code vertex} argument.
 */
public V notifyVertexAdded(final V vertex);
Program: 90941
Project: 90941
Buggy source:
public void init(final VertexFeature<?,V,?> feature,final V vertex){
  super.init();
  final int vi=vertexUndoIdBimap.getId(vertex);
  final int fi=featureStore.createFeatureUndoId();
  final int fuid=feature.getUniqueFeatureId();
  featureStore.store(fi,feature,vertex);
  final int dataIndex=dataStack.getNextDataIndex();
  dataStack.out.writeInt(vi);
  dataStack.out.writeInt(fi);
  dataStack.out.writeInt(fuid);
  ref.setDataIndex(dataIndex);
}

Fixed version (ground truth):
public void init(final VertexFeature<?,V,?> feature,final V vertex){
  super.init();
  final int vi=vertexUndoIdBimap.getId(vertex);
  final int fi=featureStore.createFeatureUndoId();
  final int fuid=feature.getUniqueFeatureId();
  featureStore.store(fi,feature,vertex);
  final long dataIndex=dataStack.getWriteDataIndex();
  dataStack.out.writeInt(vi);
  dataStack.out.writeInt(fi);
  dataStack.out.writeInt(fuid);
  ref.setDataIndex(dataIndex);
}
Program: 90942
Project: 90942
Buggy source:
public synchronized void doAddVertex(final long dataIndex){
  dataStack.setDataIndex(dataIndex);
  final int vi=dataStack.in.readInt();
  final int fi=dataStack.in.readInt();
  dataStack.in.readFully(data);
  final V ref=graph.vertexRef();
  final V vertex=graph.addVertex(ref);
  vertexUndoIdBimap.put(vi,vertex);
  serializer.setBytes(vertex,data);
  featureStore.retrieveAll(fi,vertex);
  graph.notifyVertexAdded(vertex);
  graph.releaseRef(ref);
}

Fixed version (ground truth):
public long doAddVertex(final long dataIndex){
  dataStack.setReadDataIndex(dataIndex);
  final int vi=dataStack.in.readInt();
  final int fi=dataStack.in.readInt();
  dataStack.in.readFully(data);
  final V ref=graph.vertexRef();
  final V vertex=graph.addVertex(ref);
  vertexUndoIdBimap.put(vi,vertex);
  serializer.setBytes(vertex,data);
  featureStore.retrieveAll(fi,vertex);
  graph.notifyVertexAdded(vertex);
  graph.releaseRef(ref);
  return dataStack.getReadDataIndex();
}
Program: 90943
Project: 90943
Buggy source:
public AddRemoveVertexRecord(){
  data=new byte[serializer.getVertexNumBytes()];
  ;
}

Fixed version (ground truth):
public AddRemoveVertexRecord(){
  data=new byte[serializer.getVertexNumBytes()];
}
Program: 90944
Project: 90944
Buggy source:
public void doAddEdge(final long dataIndex){
  dataStack.setDataIndex(dataIndex);
  final int ei=dataStack.in.readInt();
  final int fi=dataStack.in.readInt();
  final int si=dataStack.in.readInt();
  final int sOutIndex=dataStack.in.readInt();
  final int ti=dataStack.in.readInt();
  final int tInIndex=dataStack.in.readInt();
  dataStack.in.readFully(data);
  final V vref1=graph.vertexRef();
  final V vref2=graph.vertexRef();
  final E eref=graph.edgeRef();
  final V source=vertexUndoIdBimap.getObject(si,vref1);
  final V target=vertexUndoIdBimap.getObject(ti,vref2);
  final E edge=graph.insertEdge(source,sOutIndex,target,tInIndex,eref);
  edgeUndoIdBimap.put(ei,edge);
  serializer.setBytes(edge,data);
  featureStore.retrieveAll(fi,edge);
  graph.releaseRef(eref);
  graph.releaseRef(vref2);
  graph.releaseRef(vref1);
}

Fixed version (ground truth):
public long doAddEdge(final long dataIndex){
  dataStack.setReadDataIndex(dataIndex);
  final int ei=dataStack.in.readInt();
  final int fi=dataStack.in.readInt();
  final int si=dataStack.in.readInt();
  final int sOutIndex=dataStack.in.readInt();
  final int ti=dataStack.in.readInt();
  final int tInIndex=dataStack.in.readInt();
  dataStack.in.readFully(data);
  final V vref1=graph.vertexRef();
  final V vref2=graph.vertexRef();
  final E eref=graph.edgeRef();
  final V source=vertexUndoIdBimap.getObject(si,vref1);
  final V target=vertexUndoIdBimap.getObject(ti,vref2);
  final E edge=graph.insertEdge(source,sOutIndex,target,tInIndex,eref);
  edgeUndoIdBimap.put(ei,edge);
  serializer.setBytes(edge,data);
  featureStore.retrieveAll(fi,edge);
  graph.releaseRef(eref);
  graph.releaseRef(vref2);
  graph.releaseRef(vref1);
  return dataStack.getReadDataIndex();
}
Program: 90945
Project: 90945
Buggy source:
@Override public void redo(){
  undo();
}

Fixed version (ground truth):
@Override public void redo(){
  final long d0=ref.getDataIndex();
  final long d1=swap(d0);
  dataStack.setWriteDataIndex(d1);
}
Program: 90946
Project: 90946
Buggy source:
public void initAdd(final E edge,final UndoableEditRef<V,E> ref){
  final int ei=edgeUndoIdBimap.getId(edge);
  final int fi=featureStore.createFeatureUndoId();
  final int dataIndex=dataStack.getNextDataIndex();
  dataStack.out.writeInt(ei);
  dataStack.out.writeInt(fi);
  dataStack.out.skip(16 + data.length);
  ref.setDataIndex(dataIndex);
}

Fixed version (ground truth):
public void initAdd(final E edge,final UndoableEditRef<V,E> ref){
  final int ei=edgeUndoIdBimap.getId(edge);
  final int fi=featureStore.createFeatureUndoId();
  final long dataIndex=dataStack.getWriteDataIndex();
  dataStack.out.writeInt(ei);
  dataStack.out.writeInt(fi);
  dataStack.out.skip(16 + data.length);
  ref.setDataIndex(dataIndex);
}
Program: 90947
Project: 90947
Buggy source:
public void initRemove(final E edge,final UndoableEditRef<V,E> ref){
  final V vref=graph.vertexRef();
  final int ei=edgeUndoIdBimap.getId(edge);
  final int fi=featureStore.createFeatureUndoId();
  final int si=vertexUndoIdBimap.getId(edge.getSource(vref));
  final int sOutIndex=edge.getSourceOutIndex();
  final int ti=vertexUndoIdBimap.getId(edge.getTarget(vref));
  final int tInIndex=edge.getTargetInIndex();
  graph.releaseRef(vref);
  serializer.getBytes(edge,data);
  featureStore.storeAll(fi,edge);
  final int dataIndex=dataStack.getNextDataIndex();
  dataStack.out.writeInt(ei);
  dataStack.out.writeInt(fi);
  dataStack.out.writeInt(si);
  dataStack.out.writeInt(sOutIndex);
  dataStack.out.writeInt(ti);
  dataStack.out.writeInt(tInIndex);
  dataStack.out.write(data);
  ref.setDataIndex(dataIndex);
}

Fixed version (ground truth):
public void initRemove(final E edge,final UndoableEditRef<V,E> ref){
  final V vref=graph.vertexRef();
  final int ei=edgeUndoIdBimap.getId(edge);
  final int fi=featureStore.createFeatureUndoId();
  final int si=vertexUndoIdBimap.getId(edge.getSource(vref));
  final int sOutIndex=edge.getSourceOutIndex();
  final int ti=vertexUndoIdBimap.getId(edge.getTarget(vref));
  final int tInIndex=edge.getTargetInIndex();
  graph.releaseRef(vref);
  serializer.getBytes(edge,data);
  featureStore.storeAll(fi,edge);
  final long dataIndex=dataStack.getWriteDataIndex();
  dataStack.out.writeInt(ei);
  dataStack.out.writeInt(fi);
  dataStack.out.writeInt(si);
  dataStack.out.writeInt(sOutIndex);
  dataStack.out.writeInt(ti);
  dataStack.out.writeInt(tInIndex);
  dataStack.out.write(data);
  ref.setDataIndex(dataIndex);
}
Program: 90948
Project: 90948
Buggy source:
@Override public void undo(){
  final long dataIndex=ref.getDataIndex();
  dataStack.setDataIndex(dataIndex);
  final int vi=dataStack.in.readInt();
  final int fi=dataStack.in.readInt();
  final int fuid=dataStack.in.readInt();
  final V ref=graph.vertexRef();
  final V vertex=vertexUndoIdBimap.getObject(vi,ref);
  @SuppressWarnings("String_Node_Str") final VertexFeature<?,V,?> feature=(VertexFeature<?,V,?>)FeatureRegistry.getVertexFeature(fuid);
  featureStore.swap(fi,feature,vertex);
  graph.releaseRef(ref);
}

Fixed version (ground truth):
@Override public void undo(){
  final long d0=ref.getDataIndex();
  swap(d0);
  dataStack.setWriteDataIndex(d0);
}
Program: 90949
Project: 90949
Buggy source:
public synchronized void doRemoveVertex(final long dataIndex){
  dataStack.setDataIndex(dataIndex);
  final int vi=dataStack.in.readInt();
  final int fi=dataStack.in.readInt();
  final V vref=graph.vertexRef();
  final V vertex=vertexUndoIdBimap.getObject(vi,vref);
  serializer.getBytes(vertex,data);
  featureStore.storeAll(fi,vertex);
  dataStack.setDataIndex(dataIndex);
  dataStack.out.skip(8);
  dataStack.out.write(data);
  graph.remove(vertex);
  graph.releaseRef(vref);
}

Fixed version (ground truth):
public long doRemoveVertex(final long dataIndex){
  dataStack.setReadDataIndex(dataIndex);
  final int vi=dataStack.in.readInt();
  final int fi=dataStack.in.readInt();
  final V vref=graph.vertexRef();
  final V vertex=vertexUndoIdBimap.getObject(vi,vref);
  serializer.getBytes(vertex,data);
  featureStore.storeAll(fi,vertex);
  dataStack.setWriteDataIndex(dataIndex);
  dataStack.out.skip(8);
  dataStack.out.write(data);
  graph.remove(vertex);
  graph.releaseRef(vref);
  return dataStack.getWriteDataIndex();
}
Program: 90950
Project: 90950
Buggy source:
public void doRemoveEdge(final long dataIndex){
  dataStack.setDataIndex(dataIndex);
  final int ei=dataStack.in.readInt();
  final int fi=dataStack.in.readInt();
  final E ref=graph.edgeRef();
  final E edge=edgeUndoIdBimap.getObject(ei,ref);
  final V vref=graph.vertexRef();
  final int si=vertexUndoIdBimap.getId(edge.getSource(vref));
  final int sOutIndex=edge.getSourceOutIndex();
  final int ti=vertexUndoIdBimap.getId(edge.getTarget(vref));
  final int tInIndex=edge.getTargetInIndex();
  graph.releaseRef(vref);
  serializer.getBytes(edge,data);
  featureStore.storeAll(fi,edge);
  dataStack.setDataIndex(dataIndex);
  dataStack.out.skip(8);
  dataStack.out.writeInt(si);
  dataStack.out.writeInt(sOutIndex);
  dataStack.out.writeInt(ti);
  dataStack.out.writeInt(tInIndex);
  dataStack.out.write(data);
  graph.remove(edge);
  graph.releaseRef(ref);
}

Fixed version (ground truth):
public long doRemoveEdge(final long dataIndex){
  dataStack.setReadDataIndex(dataIndex);
  final int ei=dataStack.in.readInt();
  final int fi=dataStack.in.readInt();
  final E ref=graph.edgeRef();
  final E edge=edgeUndoIdBimap.getObject(ei,ref);
  final V vref=graph.vertexRef();
  final int si=vertexUndoIdBimap.getId(edge.getSource(vref));
  final int sOutIndex=edge.getSourceOutIndex();
  final int ti=vertexUndoIdBimap.getId(edge.getTarget(vref));
  final int tInIndex=edge.getTargetInIndex();
  graph.releaseRef(vref);
  serializer.getBytes(edge,data);
  featureStore.storeAll(fi,edge);
  dataStack.setWriteDataIndex(dataIndex);
  dataStack.out.skip(8);
  dataStack.out.writeInt(si);
  dataStack.out.writeInt(sOutIndex);
  dataStack.out.writeInt(ti);
  dataStack.out.writeInt(tInIndex);
  dataStack.out.write(data);
  graph.remove(edge);
  graph.releaseRef(ref);
  return dataStack.getWriteDataIndex();
}
Program: 90951
Project: 90951
Buggy source:
/** 
 * Returns the number of remaining bytes that can be read (or skipped over) from this input stream. <p> The value returned is <code>count&nbsp;- pos</code>, which is the number of bytes remaining to be read from the input buffer.
 * @return the number of remaining bytes that can be read (or skippedover) from this input stream without blocking.
 */
@Override public synchronized int available(){
  return rcount - pos;
}

Fixed version (ground truth):
/** 
 * Returns the number of remaining bytes that can be read (or skipped over) from this input stream. <p> The value returned is <code>count&nbsp;- pos</code>, which is the number of bytes remaining to be read from the input buffer.
 * @return the number of remaining bytes that can be read (or skippedover) from this input stream without blocking.
 */
@Override public synchronized int available(){
  return buf.length - pos;
}
Program: 90953
Project: 90953
Buggy source:
private UndoableEditList(final int initialCapacity,final Factory<V,E> f,final ModelGraph_HACK_FIX_ME<V,E> graph,final GraphFeatures<V,E> graphFeatures,final UndoSerializer<V,E> serializer,final UndoIdBimap<V> vertexUndoIdBimap,final UndoIdBimap<E> edgeUndoIdBimap){
  super(initialCapacity,f);
  f.pool=this;
  f.graph=graph;
  f.graphFeatures=graphFeatures;
  f.serializer=serializer;
  f.vertexUndoIdBimap=vertexUndoIdBimap;
  f.edgeUndoIdBimap=edgeUndoIdBimap;
  f.nonRefEdits=nonRefEdits;
}

Fixed version (ground truth):
private UndoableEditList(final int initialCapacity,final Factory<V,E> f,final ModelGraph_HACK_FIX_ME<V,E> graph,final GraphFeatures<V,E> graphFeatures,final UndoSerializer<V,E> serializer,final UndoIdBimap<V> vertexUndoIdBimap,final UndoIdBimap<E> edgeUndoIdBimap){
  super(initialCapacity,f);
  f.pool=this;
  this.graph=graph;
  this.serializer=serializer;
  this.vertexUndoIdBimap=vertexUndoIdBimap;
  this.edgeUndoIdBimap=edgeUndoIdBimap;
  this.dataStack=new UndoDataStack(1024 * 1024 * 32);
  this.featureStore=new UndoFeatureStore<>(graphFeatures);
  this.nonRefEdits=new ArrayList<>();
  f.graph=graph;
  f.graphFeatures=graphFeatures;
  f.serializer=serializer;
  f.vertexUndoIdBimap=vertexUndoIdBimap;
  f.edgeUndoIdBimap=edgeUndoIdBimap;
  f.dataStack=dataStack;
  f.featureStore=featureStore;
  f.nonRefEdits=nonRefEdits;
}
Program: 90954
Project: 90954
Buggy source:
protected UndoableEditRef(final Pool<UndoableEditRef<V,E>,ByteMappedElement> pool,final ModelGraph_HACK_FIX_ME<V,E> graph,final GraphFeatures<V,E> graphFeatures,final UndoSerializer<V,E> serializer,final UndoIdBimap<V> vertexUndoIdBimap,final UndoIdBimap<E> edgeUndoIdBimap,final ArrayList<UndoableEdit> nonRefEdits){
  super(pool);
  this.graph=graph;
  this.serializer=serializer;
  this.vertexUndoIdBimap=vertexUndoIdBimap;
  this.edgeUndoIdBimap=edgeUndoIdBimap;
  this.nonRefEdits=nonRefEdits;
  dataStack=new UndoDataStack(1024 * 1024 * 32);
  featureStore=new UndoFeatureStore<>(graphFeatures);
  addRemoveVertex=new AddRemoveVertexRecord();
  addRemoveEdge=new AddRemoveEdgeRecord();
  addVertex=new AddVertex();
  removeVertex=new RemoveVertex();
  addEdge=new AddEdge();
  removeEdge=new RemoveEdge();
}

Fixed version (ground truth):
protected UndoableEditRef(final Pool<UndoableEditRef<V,E>,ByteMappedElement> pool,final ModelGraph_HACK_FIX_ME<V,E> graph,final GraphFeatures<V,E> graphFeatures,final UndoSerializer<V,E> serializer,final UndoIdBimap<V> vertexUndoIdBimap,final UndoIdBimap<E> edgeUndoIdBimap,final UndoDataStack dataStack,final UndoFeatureStore<V,E> featureStore,final ArrayList<UndoableEdit> nonRefEdits){
  super(pool);
  this.graph=graph;
  this.serializer=serializer;
  this.vertexUndoIdBimap=vertexUndoIdBimap;
  this.edgeUndoIdBimap=edgeUndoIdBimap;
  this.dataStack=dataStack;
  this.featureStore=featureStore;
  this.nonRefEdits=nonRefEdits;
  addRemoveVertex=new AddRemoveVertexRecord();
  addRemoveEdge=new AddRemoveEdgeRecord();
  addVertex=new AddVertex();
  removeVertex=new RemoveVertex();
  addEdge=new AddEdge();
  removeEdge=new RemoveEdge();
}
Program: 90955
Project: 90955
Buggy source:
@Override public UndoableEditRef<V,E> createEmptyRef(){
  return new UndoableEditRef<V,E>(pool,graph,graphFeatures,serializer,vertexUndoIdBimap,edgeUndoIdBimap,nonRefEdits);
}

Fixed version (ground truth):
@Override public UndoableEditRef<V,E> createEmptyRef(){
  return new UndoableEditRef<V,E>(pool,graph,graphFeatures,serializer,vertexUndoIdBimap,edgeUndoIdBimap,dataStack,featureStore,nonRefEdits);
}
Program: 90956
Project: 90956
Buggy source:
public UndoableEditTypeImp(){
  typeIndex=idgen;
  undoableEditTypes.put(typeIndex,this);
}

Fixed version (ground truth):
public UndoableEditTypeImp(){
  typeIndex=idgen++;
  undoableEditTypes.put(typeIndex,this);
}
Program: 90957
Project: 90957
Buggy source:
/** 
 * Remove an object from the index.
 * @param obj object to remove.
 * @return {@code true} if this index contained the specified object.
 */
public boolean remove(final O obj){
  final KDTreeNode<O,DoubleMappedElement> n=nodeMap.get(obj,node);
  if (n != null) {
    if (n.isValid()) {
      n.setValid(false);
      --size;
      return true;
    }
  }
 else   if (added.remove(obj)) {
    --size;
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Remove an object from the index.
 * @param obj object to remove.
 * @return {@code true} if this index contained the specified object.
 */
public boolean remove(final O obj){
  final KDTreeNode<O,DoubleMappedElement> n=nodeMap.get(obj,node);
  if (n != null) {
    if (n.isValid()) {
      n.setValid(false);
      final KDTreeNode<O,DoubleMappedElement> ref=nodeMap.createValueRef();
      nodeMap.removeWithRef(obj,ref);
      nodeMap.releaseValueRef(ref);
      --size;
      return true;
    }
  }
 else   if (added.remove(obj)) {
    --size;
    return true;
  }
  return false;
}