nus-yam/ex-repair huggingface dataset:
Program: 17208
Project: 17208
Buggy source:
public HeuristicSearchProblemBuilder useHeuristicFunction(HeuristicFunction<S,C> hf){
  return new HeuristicSearchProblemBuilder(hf);
}

Fixed version (ground truth):
public HeuristicSearchProblemBuilder useHeuristicFunction(HeuristicFunction<S,Double> hf){
  return new HeuristicSearchProblemBuilder(hf);
}
Program: 17209
Project: 17209
Buggy source:
@Override public CostFunction<A,S,C> getCostFunction(){
  return cf;
}

Fixed version (ground truth):
@Override public CostFunction<A,S,Double> getCostFunction(){
  return cf;
}
Program: 17210
Project: 17210
Buggy source:
public InformedSearchProblemBuilder(CostFunction<A,S,C> cf){
  this.cf=cf;
}

Fixed version (ground truth):
public InformedSearchProblemBuilder(CostFunction<A,S,Double> cf){
  this.cf=cf;
}
Program: 17211
Project: 17211
Buggy source:
public HeuristicSearchProblemBuilder(HeuristicFunction<S,C> hf){
  this.hf=hf;
}

Fixed version (ground truth):
public HeuristicSearchProblemBuilder(HeuristicFunction<S,Double> hf){
  this.hf=hf;
}
Program: 17212
Project: 17212
Buggy source:
public HeuristicSearchProblem<A,S,C> build(){
  return new HeuristicSearchProblem<A,S,C>(){
    @Override public HeuristicFunction<S,C> getHeuristicFunction(){
      return hf;
    }
    @Override public CostFunction<A,S,C> getCostFunction(){
      return cf;
    }
    @Override public TransitionFunction<A,S> getTransitionFunction(){
      return tf;
    }
    @Override public S getInitialState(){
      return initialState;
    }
    @Override public S getGoalState(){
      return optionalGoalState;
    }
  }
;
}

Fixed version (ground truth):
public HeuristicSearchProblem<A,S,Double> build(){
  return new HeuristicSearchProblem<A,S,Double>(){
    @Override public HeuristicFunction<S,Double> getHeuristicFunction(){
      return hf;
    }
    @Override public CostFunction<A,S,Double> getCostFunction(){
      return cf;
    }
    @Override public TransitionFunction<A,S> getTransitionFunction(){
      return tf;
    }
    @Override public S getInitialState(){
      return initialState;
    }
    @Override public S getGoalState(){
      return optionalGoalState;
    }
  }
;
}
Program: 17213
Project: 17213
Buggy source:
@Override public HeuristicFunction<S,C> getHeuristicFunction(){
  return hf;
}

Fixed version (ground truth):
@Override public HeuristicFunction<S,Double> getHeuristicFunction(){
  return hf;
}
Program: 17214
Project: 17214
Buggy source:
/** 
 * Heuristics definition for the Romania problem. Goal is considered Bucharest.
 * @return map with the heuristics definition for the Romania problem.
 */
public static Map<City,Double> heuristics(){
  Map<City,Double> map=new HashMap<City,Double>();
  map.put(City.Oradea,380d);
  map.put(City.Zerind,374d);
  map.put(City.Arad,366d);
  map.put(City.Timisoara,329d);
  map.put(City.Lugoj,244d);
  map.put(City.Mehadia,241d);
  map.put(City.Drobeta,242d);
  map.put(City.Craiova,160d);
  map.put(City.Rimnicu_Vilcea,193d);
  map.put(City.Pitesti,100d);
  map.put(City.Sibiu,253d);
  map.put(City.Fagaras,176d);
  map.put(City.Giurgiu,77d);
  map.put(City.Urziceni,80d);
  map.put(City.Hirsova,151d);
  map.put(City.Eforie,161d);
  map.put(City.Vaslui,199d);
  map.put(City.Iasi,226d);
  map.put(City.Neamt,234d);
  map.put(City.Bucharest,0d);
  return map;
}

Fixed version (ground truth):
/** 
 * Heuristics definition for the Romania problem. Goal is considered Bucharest.
 * @return map with the heuristics definition for the Romania problem.
 */
public static Map<City,Double> heuristics(){
  return heuristicMap;
}
Program: 17215
Project: 17215
Buggy source:
@Override public V sourceVertexOf(E edge){
  for (  Table.Cell<V,V,E> cell : graphTable.cellSet()) {
    if (cell.getValue().equals(edge)) {
      return cell.getRowKey();
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public V sourceVertexOf(GraphEdge<V,E> edge){
  return edge.getVertex1();
}
Program: 17216
Project: 17216
Buggy source:
@Override public Set<E> outgoingEdgesFrom(V vertex){
  return Sets.newHashSet(graphTable.row(vertex).values());
}

Fixed version (ground truth):
@Override public Set<GraphEdge<V,E>> outgoingEdgesFrom(V vertex){
  return Sets.newHashSet(graphTable.row(vertex).values());
}
Program: 17217
Project: 17217
Buggy source:
public MutableHashBasedDirectedGraph<V,E> withEdge(E edge){
  graphTable.put(fromVertex,toVertex,edge);
  return MutableHashBasedDirectedGraph.this;
}

Fixed version (ground truth):
public MutableHashBasedDirectedGraph<V,E> withEdge(E edge){
  graphTable.put(fromVertex,toVertex,new GraphEdge<V,E>(fromVertex,toVertex,edge));
  return MutableHashBasedDirectedGraph.this;
}
Program: 17218
Project: 17218
Buggy source:
@Override public Set<E> edges(){
  return new HashSet<E>(graphTable.values());
}

Fixed version (ground truth):
@Override public Set<GraphEdge<V,E>> edges(){
  return new HashSet<GraphEdge<V,E>>(graphTable.values());
}
Program: 17219
Project: 17219
Buggy source:
@Override public Set<E> incomingEdgesFrom(V vertex){
  return Sets.newHashSet(graphTable.column(vertex).values());
}

Fixed version (ground truth):
@Override public Set<GraphEdge<V,E>> incomingEdgesFrom(V vertex){
  return Sets.newHashSet(graphTable.column(vertex).values());
}
Program: 17220
Project: 17220
Buggy source:
@Override public V vertexConnectedTo(V vertex,E edge){
  for (  Map.Entry<V,E> entry : graphTable.row(vertex).entrySet()) {
    if (entry.getValue().equals(edge)) {
      return entry.getKey();
    }
  }
  for (  Map.Entry<V,E> entry : graphTable.column(vertex).entrySet()) {
    if (entry.getValue().equals(edge)) {
      return entry.getKey();
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public V vertexConnectedTo(V vertex,GraphEdge<V,E> edge){
  if (edge.getVertex1().equals(vertex)) {
    return edge.getVertex2();
  }
 else   if (edge.getVertex2().equals(vertex)) {
    return edge.getVertex1();
  }
  return null;
}
Program: 17221
Project: 17221
Buggy source:
@Override public V targetVertexOf(E edge){
  for (  Table.Cell<V,V,E> cell : graphTable.cellSet()) {
    if (cell.getValue().equals(edge)) {
      return cell.getColumnKey();
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public V targetVertexOf(GraphEdge<V,E> edge){
  return edge.getVertex2();
}
Program: 17222
Project: 17222
Buggy source:
@Override public Set<E> edgesWithVertex(V vertex){
  return Sets.union(new HashSet<E>(graphTable.row(vertex).values()),new HashSet<E>(graphTable.column(vertex).values()));
}

Fixed version (ground truth):
@Override public Set<GraphEdge<V,E>> edgesWithVertex(V vertex){
  return Sets.union(new HashSet<GraphEdge<V,E>>(graphTable.row(vertex).values()),new HashSet<GraphEdge<V,E>>(graphTable.column(vertex).values()));
}
Program: 17223
Project: 17223
Buggy source:
/** 
 * Define a cost function. This immediately defines an InformedSearchProblem
 * @param cf
 */
public <C extends Comparable<C>>InformedSearchProblemBuilder useCostFunction(CostFunction<A,S,C> cf){
  return new InformedSearchProblemBuilder<C>(cf);
}

Fixed version (ground truth):
/** 
 * Define a cost function. This immediately defines an InformedSearchProblem
 * @param cf
 */
public <C extends Comparable<C>>InformedSearchProblemBuilder<C> useCostFunction(CostFunction<A,S,C> cf){
  return new InformedSearchProblemBuilder<C>(cf);
}
Program: 17224
Project: 17224
Buggy source:
/** 
 * Use a transition function that computes all the actions/states that are reachable from a given state. The function returns a set of ActionState with the action and the new resultant state. If you prefer to define actions separately, use useActionFunction instead.
 * @param transitionFunction
 */
public <A>GenericSearchProblemBuilder<A> useTransitionFunction(TransitionFunction<A,S> transitionFunction){
  return new GenericSearchProblemBuilder<A>(transitionFunction);
}

Fixed version (ground truth):
/** 
 * Use a transition function that computes all the actions/states that are reachable from a given state. The function returns a set of ActionState with the action and the new resultant state. If you prefer to define actions separately, use useActionFunction instead.
 * @param transitionFunction
 */
public GenericSearchProblemBuilder<A> useTransitionFunction(TransitionFunction<A,S> transitionFunction){
  return new GenericSearchProblemBuilder<A>(transitionFunction);
}
Program: 17225
Project: 17225
Buggy source:
/** 
 * Create a problem model that uses explicit actions. This forces you to implement functions to operate with actions, such as ActionFunction to obtain applicable actions for a given state, or ActionStateTransitionFunction to apply actions to states in order to obtain new states.
 */
public ExplicitActionProblemBuilder defineProblemWithExplicitActions(){
  return new ExplicitActionProblemBuilder();
}

Fixed version (ground truth):
/** 
 * Create a problem model that uses explicit actions. This forces you to implement functions to operate with actions, such as ActionFunction to obtain applicable actions for a given state, or ActionStateTransitionFunction to apply actions to states in order to obtain new states.
 */
public <A>ExplicitActionProblemBuilder<A> defineProblemWithExplicitActions(Class<A> type){
  return new ExplicitActionProblemBuilder<A>();
}
Program: 17226
Project: 17226
Buggy source:
public InformedSearchProblem<WeightedEdge,V,Double> in(final HipsterDirectedGraph<V,WeightedEdge> graph){
  return new InformedSearchProblem<WeightedEdge,V,Double>(){
    @Override public CostFunction<WeightedEdge,V,Double> getCostFunction(){
      return new CostFunction<WeightedEdge,V,Double>(){
        @Override public Double evaluate(        ActionState<WeightedEdge,V> actionState){
          return actionState.getAction().getValue();
        }
      }
;
    }
    @Override public TransitionFunction<WeightedEdge,V> getTransitionFunction(){
      return new TransitionFunction<WeightedEdge,V>(){
        @Override public Iterable<ActionState<WeightedEdge,V>> transitionsFrom(        V state){
          Set<ActionState<WeightedEdge,V>> as=new HashSet<ActionState<WeightedEdge,V>>();
          for (          WeightedEdge edge : graph.outgoingEdgesFrom(state)) {
            as.add(new ActionState<WeightedEdge,V>(edge,graph.targetVertexOf(edge)));
          }
          return as;
        }
      }
;
    }
    @Override public V getInitialState(){
      return fromVertex;
    }
    @Override public V getGoalState(){
      return toVertex;
    }
  }
;
}

Fixed version (ground truth):
public InformedSearchProblem<WeightedEdge,V,Double> in(final HipsterDirectedGraph<V,WeightedEdge> graph){
  return ProblemBuilder.create().initialState(fromVertex).goalState(toVertex).defineProblemWithExplicitActions(WeightedEdge.class).useTransitionFunction(new TransitionFunction<WeightedEdge,V>(){
    @Override public Iterable<ActionState<WeightedEdge,V>> transitionsFrom(    V state){
      Set<ActionState<WeightedEdge,V>> as=new HashSet<ActionState<WeightedEdge,V>>();
      for (      WeightedEdge edge : graph.outgoingEdgesFrom(state)) {
        as.add(new ActionState<WeightedEdge,V>(edge,graph.targetVertexOf(edge)));
      }
      return as;
    }
  }
).useCostFunction(new CostFunction<WeightedEdge,V,Double>(){
    @Override public Double evaluate(    ActionState<WeightedEdge,V> actionState){
      return actionState.getAction().getValue();
    }
  }
).build();
}
Program: 17227
Project: 17227
Buggy source:
@Override public List<N> path(){
  LinkedList<N> path=new LinkedList<N>();
  N currentNode=(N)this;
  while (this != null) {
    path.add(currentNode);
    currentNode=currentNode.previousNode;
  }
  return path;
}

Fixed version (ground truth):
@Override public List<N> path(){
  LinkedList<N> path=new LinkedList<N>();
  N currentNode=(N)this;
  while (currentNode != null) {
    path.add(currentNode);
    currentNode=currentNode.previousNode;
  }
  return path;
}
Program: 17228
Project: 17228
Buggy source:
public DefaultSearchProblem(S initialState,S goalState,TransitionFunction<S> transitionFunction,CostFunction<S,Double> costFunction){
  this.initialState=initialState;
  this.goalState=goalState;
  this.transitionFunction=transitionFunction;
  this.costFunction=costFunction;
  this.nodeFactory=new HeuristicNodeImplFactory<S,Double>(this.costFunction,this.heuristicFunction,BinaryOperation.doubleAdditionOp());
}

Fixed version (ground truth):
public DefaultSearchProblem(S initialState,S goalState,TransitionFunction<S> transitionFunction,CostFunction<S,Double> costFunction,HeuristicFunction<S,Double> hf){
  this.initialState=initialState;
  this.goalState=goalState;
  this.transitionFunction=transitionFunction;
  this.costFunction=costFunction;
  this.heuristicFunction=hf;
  this.nodeFactory=new HeuristicNodeImplFactory<S,Double>(this.costFunction,this.heuristicFunction,BinaryOperation.doubleAdditionOp());
}
Program: 17229
Project: 17229
Buggy source:
public Set<Point> diff(StringMaze to){
  char[][] maze1=this.toCharArray();
  char[][] maze2=this.toCharArray();
  Set<Point> differentLocations=new HashSet<Point>();
  for (int row=0; row < this.rows; row++) {
    for (int column=0; column < this.columns; column++) {
      if (maze1[row][column] != maze2[row][column]) {
        differentLocations.add(new Point(column,row));
      }
    }
  }
  return differentLocations;
}

Fixed version (ground truth):
public Set<Point> diff(StringMaze to){
  char[][] maze1=this.toCharArray();
  char[][] maze2=to.toCharArray();
  Set<Point> differentLocations=new HashSet<Point>();
  for (int row=0; row < this.rows; row++) {
    for (int column=0; column < this.columns; column++) {
      if (maze1[row][column] != maze2[row][column]) {
        differentLocations.add(new Point(column,row));
      }
    }
  }
  return differentLocations;
}
Program: 17230
Project: 17230
Buggy source:
public int updateGoodshotsale(final String[] goodsid,final String hotsale,final String creatorid){
  log.debug("String_Node_Str");
  try {
    final String queryString="String_Node_Str";
    this.getHibernateTemplate().execute(new HibernateCallback(){
      public Object doInHibernate(      Session session) throws HibernateException, SQLException {
        Query query=session.createQuery(queryString);
        int i=0;
        for (        String s : goodsid) {
          query.setParameter("String_Node_Str",s);
          query.setParameter("String_Node_Str",hotsale);
          query.setParameter("String_Node_Str",creatorid);
          i=query.executeUpdate();
          i++;
        }
        if (goodsid.length == i) {
          return i;
        }
 else {
          return 0;
        }
      }
    }
);
  }
 catch (  RuntimeException re) {
    log.error("String_Node_Str",re);
    throw re;
  }
  return 0;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public int updateGoodshotsale(final String[] goodsid,final String hotsale,final String creatorid){
  log.debug("String_Node_Str");
  try {
    final String queryString="String_Node_Str";
    Integer integer=(Integer)this.getHibernateTemplate().execute(new HibernateCallback(){
      public Object doInHibernate(      Session session) throws HibernateException, SQLException {
        Query query=session.createQuery(queryString);
        int i=0;
        for (        String s : goodsid) {
          query.setParameter("String_Node_Str",s);
          query.setParameter("String_Node_Str",hotsale);
          query.setParameter("String_Node_Str",creatorid);
          i=query.executeUpdate();
          i++;
        }
        if (goodsid.length == i) {
          return i;
        }
 else {
          return 0;
        }
      }
    }
);
  }
 catch (  RuntimeException re) {
    log.error("String_Node_Str",re);
    throw re;
  }
  return 0;
}
Program: 17231
Project: 17231
Buggy source:
public TaskCommunicatorManager(AppContext context,TaskHeartbeatHandler thh,ContainerHeartbeatHandler chh,List<NamedEntityDescriptor> taskCommunicatorDescriptors) throws TezException {
  super(TaskCommunicatorManager.class.getName());
  this.context=context;
  this.taskHeartbeatHandler=thh;
  this.containerHeartbeatHandler=chh;
  Preconditions.checkArgument(taskCommunicatorDescriptors != null && !taskCommunicatorDescriptors.isEmpty(),"String_Node_Str");
  this.taskCommunicators=new TaskCommunicatorWrapper[taskCommunicatorDescriptors.size()];
  this.taskCommunicatorContexts=new TaskCommunicatorContext[taskCommunicatorDescriptors.size()];
  this.taskCommunicatorServiceWrappers=new ServicePluginLifecycleAbstractService[taskCommunicatorDescriptors.size()];
  for (int i=0; i < taskCommunicatorDescriptors.size(); i++) {
    UserPayload userPayload=taskCommunicatorDescriptors.get(i).getUserPayload();
    taskCommunicatorContexts[i]=new TaskCommunicatorContextImpl(context,this,userPayload,i);
    taskCommunicators[i]=new TaskCommunicatorWrapper(createTaskCommunicator(taskCommunicatorDescriptors.get(i),i));
    taskCommunicatorServiceWrappers[i]=new ServicePluginLifecycleAbstractService(taskCommunicators[i].getTaskCommunicator());
  }
}

Fixed version (ground truth):
public TaskCommunicatorManager(AppContext context,TaskHeartbeatHandler thh,ContainerHeartbeatHandler chh,List<NamedEntityDescriptor> taskCommunicatorDescriptors) throws TezException {
  super(TaskCommunicatorManager.class.getName());
  this.context=context;
  this.taskHeartbeatHandler=thh;
  this.containerHeartbeatHandler=chh;
  if (taskCommunicatorDescriptors == null || taskCommunicatorDescriptors.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.taskCommunicators=new TaskCommunicatorWrapper[taskCommunicatorDescriptors.size()];
  this.taskCommunicatorContexts=new TaskCommunicatorContext[taskCommunicatorDescriptors.size()];
  this.taskCommunicatorServiceWrappers=new ServicePluginLifecycleAbstractService[taskCommunicatorDescriptors.size()];
  for (int i=0; i < taskCommunicatorDescriptors.size(); i++) {
    UserPayload userPayload=taskCommunicatorDescriptors.get(i).getUserPayload();
    taskCommunicatorContexts[i]=new TaskCommunicatorContextImpl(context,this,userPayload,i);
    taskCommunicators[i]=new TaskCommunicatorWrapper(createTaskCommunicator(taskCommunicatorDescriptors.get(i),i));
    taskCommunicatorServiceWrappers[i]=new ServicePluginLifecycleAbstractService(taskCommunicators[i].getTaskCommunicator());
  }
}
Program: 17232
Project: 17232
Buggy source:
/** 
 * This method removes the map from the cache if index information for this map is loaded(size>0), index information entry in cache will not be removed if it is in the loading phrase(size=0), this prevents corruption of totalMemoryUsed. It should be called when a map output on this tracker is discarded.
 * @param mapId The taskID of this map.
 */
public void removeMap(String mapId){
  IndexInformation info=cache.get(mapId);
  if (info == null || ((info != null) && isUnderConstruction(info))) {
    return;
  }
  info=cache.remove(mapId);
  if (info != null) {
    totalMemoryUsed.addAndGet(-info.getSize());
    if (!queue.remove(mapId)) {
      LOG.warn("String_Node_Str" + mapId + "String_Node_Str");
    }
  }
 else {
    LOG.info("String_Node_Str" + mapId + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * This method removes the map from the cache if index information for this map is loaded(size>0), index information entry in cache will not be removed if it is in the loading phrase(size=0), this prevents corruption of totalMemoryUsed. It should be called when a map output on this tracker is discarded.
 * @param mapId The taskID of this map.
 */
public void removeMap(String mapId){
  IndexInformation info=cache.get(mapId);
  if (info == null || isUnderConstruction(info)) {
    return;
  }
  info=cache.remove(mapId);
  if (info != null) {
    totalMemoryUsed.addAndGet(-info.getSize());
    if (!queue.remove(mapId)) {
      LOG.warn("String_Node_Str" + mapId + "String_Node_Str");
    }
  }
 else {
    LOG.info("String_Node_Str" + mapId + "String_Node_Str");
  }
}
Program: 17233
Project: 17233
Buggy source:
@Override public float getProgress(){
  if (isStopStarted.get()) {
    return 1;
  }
  if (totalResources.getMemory() == 0) {
    totalResources=Resources.clone(getAvailableResources());
    LOG.info("String_Node_Str" + totalResources.getMemory() + "String_Node_Str"+ totalResources.getVirtualCores()+ "String_Node_Str"+ taskAllocations.size());
  }
  numHeartbeats++;
  preemptIfNeeded();
  return getContext().getProgress();
}

Fixed version (ground truth):
@Override public float getProgress(){
  if (isStopStarted.get()) {
    return 1;
  }
  if (totalResources.getMemory() == 0) {
    totalResources=Resources.clone(getAvailableResources());
    LOG.info("String_Node_Str" + totalResources.getMemory() + "String_Node_Str"+ totalResources.getVirtualCores()+ "String_Node_Str"+ taskAllocations.size());
  }
synchronized (this) {
    numHeartbeats++;
    preemptIfNeeded();
  }
  return getContext().getProgress();
}
Program: 17234
Project: 17234
Buggy source:
/** 
 * read the next key - which may be the same as the current key.
 */
private void readNextKey() throws IOException {
  more=in.next();
  if (more) {
    DataInputBuffer nextKeyBytes=in.getKey();
    if (!in.isSameKey()) {
      keyIn.reset(nextKeyBytes.getData(),nextKeyBytes.getPosition(),nextKeyBytes.getLength() - nextKeyBytes.getPosition());
      nextKey=keyDeserializer.deserialize(nextKey);
      hasMoreValues=key != null && (comparator.compare(key,nextKey) == 0);
    }
 else {
      hasMoreValues=in.isSameKey();
    }
  }
 else {
    hasMoreValues=false;
  }
}

Fixed version (ground truth):
/** 
 * read the next key - which may be the same as the current key.
 */
private void readNextKey() throws IOException {
  more=in.next();
  if (more) {
    DataInputBuffer nextKeyBytes=in.getKey();
    if (!in.isSameKey()) {
      keyIn.reset(nextKeyBytes.getData(),nextKeyBytes.getPosition(),nextKeyBytes.getLength() - nextKeyBytes.getPosition());
      nextKey=keyDeserializer.deserialize(nextKey);
      hasMoreValues=(key == null) || (comparator.compare(key,nextKey) == 0);
      if (key == null || false == hasMoreValues) {
        inputKeyCounter.increment(1);
        ++keyCtr;
      }
    }
 else {
      hasMoreValues=in.isSameKey();
    }
  }
 else {
    hasMoreValues=false;
  }
}
Program: 17235
Project: 17235
Buggy source:
/** 
 * Move to the next K-Vs pair
 * @return true if another pair exists, otherwise false.
 * @throws IOException 
 */
public boolean moveToNext() throws IOException {
  if (isFirstRecord) {
    readNextKey();
    key=nextKey;
    nextKey=null;
    hasMoreValues=more;
    isFirstRecord=false;
  }
 else {
    nextKey();
  }
  return more;
}

Fixed version (ground truth):
/** 
 * Move to the next K-Vs pair
 * @return true if another pair exists, otherwise false.
 * @throws IOException 
 */
public boolean moveToNext() throws IOException {
  if (isFirstRecord) {
    readNextKey();
    key=nextKey;
    nextKey=null;
    isFirstRecord=false;
  }
 else {
    nextKey();
  }
  return more;
}
Program: 17236
Project: 17236
Buggy source:
/** 
 * Start processing next unique key. 
 */
private void nextKey() throws IOException {
  while (hasMoreValues) {
    readNextKey();
  }
  if (more) {
    inputKeyCounter.increment(1);
    ++keyCtr;
  }
  KEY tmpKey=key;
  key=nextKey;
  nextKey=tmpKey;
  hasMoreValues=more;
}

Fixed version (ground truth):
/** 
 * Start processing next unique key. 
 */
private void nextKey() throws IOException {
  while (hasMoreValues) {
    readNextKey();
  }
  KEY tmpKey=key;
  key=nextKey;
  nextKey=tmpKey;
  hasMoreValues=more;
}
Program: 17237
Project: 17237
Buggy source:
/** 
 * Tests whether data in valuesIterator matches with sorted input data set.
 * @param valuesIterator
 * @throws IOException
 */
private void verifyIteratorData(ValuesIterator valuesIterator) throws IOException {
  boolean result=true;
  ListMultimap<Writable,Writable> sortedMap=new ImmutableListMultimap.Builder<Writable,Writable>().orderKeysBy(this.correctComparator).putAll(originalData).build();
  Set<Map.Entry<Writable,Writable>> oriKeySet=Sets.newSet();
  oriKeySet.addAll(sortedMap.entries());
  for (  Map.Entry<Writable,Writable> entry : oriKeySet) {
    assertTrue(valuesIterator.moveToNext());
    Writable oriKey=entry.getKey();
    if (!oriKey.equals((Writable)valuesIterator.getKey())) {
      result=false;
      break;
    }
    Iterator<Writable> vItr=valuesIterator.getValues().iterator();
    for (    Writable val : sortedMap.get(oriKey)) {
      assertTrue(vItr.hasNext());
      if (!val.equals((Writable)vItr.next())) {
        result=false;
        break;
      }
    }
  }
  if (expectedTestResult) {
    assertTrue(result);
  }
 else {
    assertFalse(result);
  }
}

Fixed version (ground truth):
/** 
 * Tests whether data in valuesIterator matches with sorted input data set. Returns a list of value counts for each key.
 * @param valuesIterator
 * @return List
 * @throws IOException
 */
private List<Integer> verifyIteratorData(ValuesIterator valuesIterator) throws IOException {
  boolean result=true;
  ArrayList<Integer> sequence=new ArrayList<Integer>();
  ListMultimap<Writable,Writable> sortedMap=new ImmutableListMultimap.Builder<Writable,Writable>().orderKeysBy(this.correctComparator).putAll(originalData).build();
  Set<Map.Entry<Writable,Writable>> oriKeySet=Sets.newSet();
  oriKeySet.addAll(sortedMap.entries());
  for (  Map.Entry<Writable,Writable> entry : oriKeySet) {
    assertTrue(valuesIterator.moveToNext());
    Writable oriKey=entry.getKey();
    if (!oriKey.equals((Writable)valuesIterator.getKey())) {
      result=false;
      break;
    }
    int valueCount=0;
    Iterator<Writable> vItr=valuesIterator.getValues().iterator();
    for (    Writable val : sortedMap.get(oriKey)) {
      assertTrue(vItr.hasNext());
      if (!val.equals((Writable)vItr.next())) {
        result=false;
        break;
      }
      valueCount++;
    }
    sequence.add(valueCount);
    assertTrue("String_Node_Str",valueCount > 0);
  }
  if (expectedTestResult) {
    assertTrue(result);
  }
 else {
    assertFalse(result);
  }
  return sequence;
}
Program: 17238
Project: 17238
Buggy source:
@Override public void serviceStart(){
  try {
    Configuration conf=getConfig();
    InetSocketAddress addr=new InetSocketAddress(0);
    DAGClientAMProtocolBlockingPBServerImpl service=new DAGClientAMProtocolBlockingPBServerImpl(realInstance);
    BlockingService blockingService=DAGClientAMProtocol.newReflectiveBlockingService(service);
    int numHandlers=conf.getInt(TezConfiguration.TEZ_AM_CLIENT_THREAD_COUNT,TezConfiguration.TEZ_AM_CLIENT_THREAD_COUNT_DEFAULT);
    String portRange=conf.get(TezConfiguration.TEZ_AM_CLIENT_AM_PORT_RANGE);
    server=createServer(DAGClientAMProtocolBlockingPB.class,addr,conf,numHandlers,blockingService,portRange);
    if (conf.getBoolean(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION,false)) {
      refreshServiceAcls(conf,new TezAMPolicyProvider());
    }
    server.start();
    bindAddress=NetUtils.getConnectAddress(server);
    LOG.info("String_Node_Str" + bindAddress);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    throw new TezUncheckedException(e);
  }
}

Fixed version (ground truth):
@Override public void serviceStart(){
  try {
    Configuration conf=getConfig();
    InetSocketAddress addr=new InetSocketAddress(0);
    DAGClientAMProtocolBlockingPBServerImpl service=new DAGClientAMProtocolBlockingPBServerImpl(realInstance);
    BlockingService blockingService=DAGClientAMProtocol.newReflectiveBlockingService(service);
    int numHandlers=conf.getInt(TezConfiguration.TEZ_AM_CLIENT_THREAD_COUNT,TezConfiguration.TEZ_AM_CLIENT_THREAD_COUNT_DEFAULT);
    server=createServer(DAGClientAMProtocolBlockingPB.class,addr,conf,numHandlers,blockingService,TezConfiguration.TEZ_AM_CLIENT_AM_PORT_RANGE);
    if (conf.getBoolean(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION,false)) {
      refreshServiceAcls(conf,new TezAMPolicyProvider());
    }
    server.start();
    bindAddress=NetUtils.getConnectAddress(server);
    LOG.info("String_Node_Str" + bindAddress);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    throw new TezUncheckedException(e);
  }
}
Program: 17239
Project: 17239
Buggy source:
/** 
 * Compute expected size of input bytes to merges, will be used in calculating mergeProgress. This simulates the above merge() method and tries to obtain the number of bytes that are going to be merged in all merges(assuming that there is no combiner called while merging).
 * @param factor mapreduce.task.io.sort.factor
 * @param inMem  number of segments in memory to be merged
 */
long computeBytesInMerges(int factor,int inMem){
  int numSegments=segments.size();
  List<Long> segmentSizes=new ArrayList<Long>(numSegments);
  long totalBytes=0;
  int n=numSegments - inMem;
  int f=getPassFactor(factor,1,n) + inMem;
  n=numSegments;
  for (int i=0; i < numSegments; i++) {
    segmentSizes.add(segments.get(i).getLength());
  }
  boolean considerFinalMerge=considerFinalMergeForProgress;
  while (n > f || considerFinalMerge) {
    if (n <= f) {
      considerFinalMerge=false;
    }
    long mergedSize=0;
    f=Math.min(f,segmentSizes.size());
    for (int j=0; j < f; j++) {
      mergedSize+=segmentSizes.remove(0);
    }
    totalBytes+=mergedSize;
    int pos=Collections.binarySearch(segmentSizes,mergedSize);
    if (pos < 0) {
      pos=-pos - 1;
    }
    segmentSizes.add(pos,mergedSize);
  }
  return totalBytes;
}

Fixed version (ground truth):
/** 
 * Compute expected size of input bytes to merges, will be used in calculating mergeProgress. This simulates the above merge() method and tries to obtain the number of bytes that are going to be merged in all merges(assuming that there is no combiner called while merging).
 * @param factor mapreduce.task.io.sort.factor
 * @param inMem  number of segments in memory to be merged
 */
long computeBytesInMerges(int factor,int inMem){
  int numSegments=segments.size();
  List<Long> segmentSizes=new ArrayList<Long>(numSegments);
  long totalBytes=0;
  int n=numSegments - inMem;
  int f=getPassFactor(factor,1,n) + inMem;
  n=numSegments;
  for (int i=0; i < numSegments; i++) {
    segmentSizes.add(segments.get(i).getLength());
  }
  boolean considerFinalMerge=considerFinalMergeForProgress;
  while (n > f || considerFinalMerge) {
    if (n <= f) {
      considerFinalMerge=false;
    }
    long mergedSize=0;
    f=Math.min(f,segmentSizes.size());
    for (int j=0; j < f; j++) {
      mergedSize+=segmentSizes.remove(0);
    }
    totalBytes+=mergedSize;
    int pos=Collections.binarySearch(segmentSizes,mergedSize);
    if (pos < 0) {
      pos=-pos - 1;
    }
    segmentSizes.add(pos,mergedSize);
    n-=(f - 1);
    f=factor;
  }
  return totalBytes;
}
Program: 17240
Project: 17240
Buggy source:
public static ByteString compressByteArrayToByteString(byte[] inBytes) throws IOException {
  ByteString.Output os=ByteString.newOutput();
  DeflaterOutputStream compressOs=new DeflaterOutputStream(os,new Deflater(Deflater.BEST_COMPRESSION));
  compressOs.write(inBytes);
  compressOs.finish();
  ByteString byteString=os.toByteString();
  return byteString;
}

Fixed version (ground truth):
@Private public static ByteString compressByteArrayToByteString(byte[] inBytes) throws IOException {
  ByteString.Output os=ByteString.newOutput();
  DeflaterOutputStream compressOs=new DeflaterOutputStream(os,new Deflater(Deflater.BEST_COMPRESSION));
  compressOs.write(inBytes);
  compressOs.finish();
  ByteString byteString=os.toByteString();
  return byteString;
}
Program: 17241
Project: 17241
Buggy source:
public static byte[] decompressByteStringToByteArray(ByteString byteString) throws IOException {
  InflaterInputStream in=new InflaterInputStream(byteString.newInput());
  byte[] bytes=IOUtils.toByteArray(in);
  return bytes;
}

Fixed version (ground truth):
@Private public static byte[] decompressByteStringToByteArray(ByteString byteString) throws IOException {
  InflaterInputStream in=new InflaterInputStream(byteString.newInput());
  byte[] bytes=IOUtils.toByteArray(in);
  return bytes;
}
Program: 17242
Project: 17242
Buggy source:
public TezCountersDelegate(TezCounters original,String taskVertexName,String edgeVertexName,String type){
  this.original=original;
  this.groupModifier=cleanVertexName(taskVertexName) + "String_Node_Str" + type+ "String_Node_Str"+ cleanVertexName(edgeVertexName);
}

Fixed version (ground truth):
public TezCountersDelegate(TezCounters original,String taskVertexName,String edgeVertexName,String type){
  this.original=original;
  this.groupModifier=TezUtils.cleanVertexName(taskVertexName) + "String_Node_Str" + type+ "String_Node_Str"+ TezUtils.cleanVertexName(edgeVertexName);
}
Program: 17243
Project: 17243
Buggy source:
public FileBasedKVWriter(TezOutputContext outputContext,Configuration conf) throws IOException {
  this.conf=conf;
  this.outputRecordsCounter=outputContext.getCounters().findCounter(TaskCounter.OUTPUT_RECORDS);
  this.outputBytesCounter=outputContext.getCounters().findCounter(TaskCounter.OUTPUT_BYTES);
  this.outputBytesCounterWithOverhead=outputContext.getCounters().findCounter(TaskCounter.OUTPUT_BYTES_WITH_OVERHEAD);
  this.outputMaterializedBytesCounter=outputContext.getCounters().findCounter(TaskCounter.OUTPUT_BYTES_PHYSICAL);
  this.rfs=((LocalFileSystem)FileSystem.getLocal(this.conf)).getRaw();
  keyClass=ConfigUtils.getIntermediateOutputKeyClass(this.conf);
  valClass=ConfigUtils.getIntermediateOutputValueClass(this.conf);
  if (ConfigUtils.shouldCompressIntermediateOutput(this.conf)) {
    Class<? extends CompressionCodec> codecClass=ConfigUtils.getIntermediateOutputCompressorClass(this.conf,DefaultCodec.class);
    codec=ReflectionUtils.newInstance(codecClass,this.conf);
  }
 else {
    codec=null;
  }
  this.ouputFileManager=TezRuntimeUtils.instantiateTaskOutputManager(conf,outputContext);
  LOG.info("String_Node_Str" + "String_Node_Str" + (codec == null ? "String_Node_Str" : codec.getClass().getName()));
  initWriter();
}

Fixed version (ground truth):
public FileBasedKVWriter(TezOutputContext outputContext,Configuration conf) throws IOException {
  this.conf=conf;
  this.outputRecordsCounter=outputContext.getCounters().findCounter(TaskCounter.OUTPUT_RECORDS);
  this.outputBytesCounter=outputContext.getCounters().findCounter(TaskCounter.OUTPUT_BYTES);
  this.outputBytesCounterWithOverhead=outputContext.getCounters().findCounter(TaskCounter.OUTPUT_BYTES_WITH_OVERHEAD);
  this.outputMaterializedBytesCounter=outputContext.getCounters().findCounter(TaskCounter.OUTPUT_BYTES_PHYSICAL);
  this.rfs=((LocalFileSystem)FileSystem.getLocal(this.conf)).getRaw();
  keyClass=ConfigUtils.getIntermediateOutputKeyClass(this.conf);
  valClass=ConfigUtils.getIntermediateOutputValueClass(this.conf);
  if (ConfigUtils.shouldCompressIntermediateOutput(this.conf)) {
    Class<? extends CompressionCodec> codecClass=ConfigUtils.getIntermediateOutputCompressorClass(this.conf,DefaultCodec.class);
    codec=ReflectionUtils.newInstance(codecClass,this.conf);
  }
 else {
    codec=null;
  }
  this.ouputFileManager=TezRuntimeUtils.instantiateTaskOutputManager(conf,outputContext);
  LOG.info("String_Node_Str" + "String_Node_Str" + (codec == null ? "String_Node_Str" : codec.getClass().getName()));
  this.outputPath=ouputFileManager.getOutputFileForWrite();
  LOG.info("String_Node_Str" + outputPath);
  this.writer=new IFile.Writer(conf,rfs,outputPath,keyClass,valClass,codec,null,outputBytesCounter);
}
Program: 17246
Project: 17246
Buggy source:
public boolean next() throws IOException {
  if (size() == 0)   return false;
  if (minSegment != null) {
    adjustPriorityQueue(minSegment);
    if (size() == 0) {
      minSegment=null;
      return false;
    }
  }
  minSegment=top();
  if (!minSegment.inMemory()) {
    value.reset(diskIFileValue.getData(),diskIFileValue.getLength());
  }
  long startPos=minSegment.getPosition();
  key=minSegment.getKey();
  minSegment.getValue(value);
  long endPos=minSegment.getPosition();
  totalBytesProcessed+=endPos - startPos;
  mergeProgress.set(totalBytesProcessed * progPerByte);
  return true;
}

Fixed version (ground truth):
@Override public boolean next() throws IOException {
  return false;
}
Program: 17247
Project: 17247
Buggy source:
public Progress getProgress(){
  return mergeProgress;
}

Fixed version (ground truth):
@Override public Progress getProgress(){
  return progress;
}
Program: 17249
Project: 17249
Buggy source:
public void close() throws IOException {
  Segment segment;
  while ((segment=pop()) != null) {
    segment.close();
  }
}

Fixed version (ground truth):
@Override public void close() throws IOException {
}
Program: 17250
Project: 17250
Buggy source:
public MergeQueue(Configuration conf,FileSystem fs,List<Segment> segments,RawComparator comparator,Progressable reporter,boolean sortSegments,CompressionCodec codec){
  this(conf,fs,segments,comparator,reporter,sortSegments);
  this.codec=codec;
}

Fixed version (ground truth):
public MergeQueue(Configuration conf,FileSystem fs,List<Segment> segments,RawComparator comparator,Progressable reporter,boolean sortSegments,CompressionCodec codec,boolean considerFinalMergeForProgress){
  this(conf,fs,segments,comparator,reporter,sortSegments,considerFinalMergeForProgress);
  this.codec=codec;
}
Program: 17251
Project: 17251
Buggy source:
public DataInputBuffer getKey() throws IOException {
  return key;
}

Fixed version (ground truth):
@Override public DataInputBuffer getKey() throws IOException {
  throw new RuntimeException("String_Node_Str");
}
Program: 17252
Project: 17252
Buggy source:
public DataInputBuffer getValue() throws IOException {
  return value;
}

Fixed version (ground truth):
@Override public DataInputBuffer getValue() throws IOException {
  throw new RuntimeException("String_Node_Str");
}
Program: 17253
Project: 17253
Buggy source:
/** 
 * Compute expected size of input bytes to merges, will be used in calculating mergeProgress. This simulates the above merge() method and tries to obtain the number of bytes that are going to be merged in all merges(assuming that there is no combiner called while merging).
 * @param factor mapreduce.task.io.sort.factor
 * @param inMem  number of segments in memory to be merged
 */
long computeBytesInMerges(int factor,int inMem){
  int numSegments=segments.size();
  List<Long> segmentSizes=new ArrayList<Long>(numSegments);
  long totalBytes=0;
  int n=numSegments - inMem;
  int f=getPassFactor(factor,1,n) + inMem;
  n=numSegments;
  for (int i=0; i < numSegments; i++) {
    segmentSizes.add(segments.get(i).getLength());
  }
  boolean considerFinalMerge=includeFinalMerge;
  while (n > f || considerFinalMerge) {
    if (n <= f) {
      considerFinalMerge=false;
    }
    long mergedSize=0;
    f=Math.min(f,segmentSizes.size());
    for (int j=0; j < f; j++) {
      mergedSize+=segmentSizes.remove(0);
    }
    totalBytes+=mergedSize;
    int pos=Collections.binarySearch(segmentSizes,mergedSize);
    if (pos < 0) {
      pos=-pos - 1;
    }
    segmentSizes.add(pos,mergedSize);
    n-=(f - 1);
    f=factor;
  }
  return totalBytes;
}

Fixed version (ground truth):
/** 
 * Compute expected size of input bytes to merges, will be used in calculating mergeProgress. This simulates the above merge() method and tries to obtain the number of bytes that are going to be merged in all merges(assuming that there is no combiner called while merging).
 * @param factor mapreduce.task.io.sort.factor
 * @param inMem  number of segments in memory to be merged
 */
long computeBytesInMerges(int factor,int inMem){
  int numSegments=segments.size();
  List<Long> segmentSizes=new ArrayList<Long>(numSegments);
  long totalBytes=0;
  int n=numSegments - inMem;
  int f=getPassFactor(factor,1,n) + inMem;
  n=numSegments;
  for (int i=0; i < numSegments; i++) {
    segmentSizes.add(segments.get(i).getLength());
  }
  boolean considerFinalMerge=considerFinalMergeForProgress;
  while (n > f || considerFinalMerge) {
    if (n <= f) {
      considerFinalMerge=false;
    }
    long mergedSize=0;
    f=Math.min(f,segmentSizes.size());
    for (int j=0; j < f; j++) {
      mergedSize+=segmentSizes.remove(0);
    }
    totalBytes+=mergedSize;
    int pos=Collections.binarySearch(segmentSizes,mergedSize);
    if (pos < 0) {
      pos=-pos - 1;
    }
    segmentSizes.add(pos,mergedSize);
  }
  return totalBytes;
}
Program: 17255
Project: 17255
Buggy source:
@Override public boolean next() throws IOException {
  return vIter.moveToNext();
}

Fixed version (ground truth):
@Override public boolean next() throws IOException {
  return valuesIter.moveToNext();
}
Program: 17256
Project: 17256
Buggy source:
@SuppressWarnings("String_Node_Str") public Iterable<Object> getCurrentValues() throws IOException {
  return vIter.getValues();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Iterable<Object> getCurrentValues() throws IOException {
  return valuesIter.getValues();
}
Program: 17257
Project: 17257
Buggy source:
public Object getCurrentKey() throws IOException {
  return vIter.getKey();
}

Fixed version (ground truth):
public Object getCurrentKey() throws IOException {
  return valuesIter.getKey();
}
Program: 17258
Project: 17258
Buggy source:
/** 
 * Get a KVReader for the Input.</p> This method will block until the input is ready - i.e. the copy and merge stages are complete. Users can use the isInputReady method to check if the input is ready, which gives an indication of whether this method will block or not. NOTE: All values for the current K-V pair must be read prior to invoking moveToNext. Once moveToNext() is called, the valueIterator from the previous K-V pair will throw an Exception
 * @return a KVReader over the sorted input.
 */
@Override public synchronized KeyValuesReader getReader() throws IOException {
  if (this.numInputs == 0) {
    return new KeyValuesReader(){
      @Override public boolean next() throws IOException {
        return false;
      }
      @Override public Object getCurrentKey() throws IOException {
        throw new RuntimeException("String_Node_Str");
      }
      @Override public Iterable<Object> getCurrentValues() throws IOException {
        throw new RuntimeException("String_Node_Str");
      }
    }
;
  }
  if (rawIter == null) {
    try {
      waitForInputReady();
    }
 catch (    InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new IOException("String_Node_Str",e);
    }
  }
  return new KeyValuesReader(){
    @Override public boolean next() throws IOException {
      return vIter.moveToNext();
    }
    public Object getCurrentKey() throws IOException {
      return vIter.getKey();
    }
    @SuppressWarnings("String_Node_Str") public Iterable<Object> getCurrentValues() throws IOException {
      return vIter.getValues();
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Get a KVReader for the Input.</p> This method will block until the input is ready - i.e. the copy and merge stages are complete. Users can use the isInputReady method to check if the input is ready, which gives an indication of whether this method will block or not. NOTE: All values for the current K-V pair must be read prior to invoking moveToNext. Once moveToNext() is called, the valueIterator from the previous K-V pair will throw an Exception
 * @return a KVReader over the sorted input.
 */
@Override public KeyValuesReader getReader() throws IOException {
  TezRawKeyValueIterator rawIterLocal;
synchronized (this) {
    rawIterLocal=rawIter;
    if (this.numInputs == 0) {
      return new KeyValuesReader(){
        @Override public boolean next() throws IOException {
          return false;
        }
        @Override public Object getCurrentKey() throws IOException {
          throw new RuntimeException("String_Node_Str");
        }
        @Override public Iterable<Object> getCurrentValues() throws IOException {
          throw new RuntimeException("String_Node_Str");
        }
      }
;
    }
  }
  if (rawIterLocal == null) {
    try {
      waitForInputReady();
    }
 catch (    InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new IOException("String_Node_Str",e);
    }
  }
  @SuppressWarnings("String_Node_Str") ValuesIterator valuesIter=null;
synchronized (this) {
    valuesIter=vIter;
  }
  return new ShuffledMergedKeyValuesReader(valuesIter);
}
Program: 17259
Project: 17259
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected void createValuesIterator() throws IOException {
  vIter=new ValuesIterator(rawIter,(RawComparator)ConfigUtils.getIntermediateInputKeyComparator(conf),ConfigUtils.getIntermediateInputKeyClass(conf),ConfigUtils.getIntermediateInputValueClass(conf),conf,inputKeyCounter,inputValueCounter);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected synchronized void createValuesIterator() throws IOException {
  vIter=new ValuesIterator(rawIter,(RawComparator)ConfigUtils.getIntermediateInputKeyComparator(conf),ConfigUtils.getIntermediateInputKeyClass(conf),ConfigUtils.getIntermediateInputValueClass(conf),conf,inputKeyCounter,inputValueCounter);
}
Program: 17260
Project: 17260
Buggy source:
/** 
 * Waits for the input to become ready for consumption
 * @throws IOException
 * @throws InterruptedException
 */
public synchronized void waitForInputReady() throws IOException, InterruptedException {
  Preconditions.checkState(isStarted.get(),"String_Node_Str");
  if (this.numInputs == 0) {
    return;
  }
  rawIter=shuffle.waitForInput();
  createValuesIterator();
}

Fixed version (ground truth):
/** 
 * Waits for the input to become ready for consumption
 * @throws IOException
 * @throws InterruptedException
 */
public void waitForInputReady() throws IOException, InterruptedException {
  Shuffle localShuffleCopy=null;
synchronized (this) {
    Preconditions.checkState(isStarted.get(),"String_Node_Str");
    if (this.numInputs == 0) {
      return;
    }
    localShuffleCopy=shuffle;
  }
  TezRawKeyValueIterator localRawIter=localShuffleCopy.waitForInput();
synchronized (this) {
    rawIter=localRawIter;
    createValuesIterator();
  }
}
Program: 17261
Project: 17261
Buggy source:
@Override public synchronized void handleEvents(List<Event> inputEvents){
  if (numInputs == 0) {
    throw new RuntimeException("String_Node_Str");
  }
  if (!isStarted.get()) {
    if (firstEventReceivedTime == -1) {
      firstEventReceivedTime=System.currentTimeMillis();
    }
    pendingEvents.addAll(inputEvents);
    return;
  }
  shuffle.handleEvents(inputEvents);
}

Fixed version (ground truth):
@Override public void handleEvents(List<Event> inputEvents){
synchronized (this) {
    if (numInputs == 0) {
      throw new RuntimeException("String_Node_Str");
    }
    if (!isStarted.get()) {
      if (firstEventReceivedTime == -1) {
        firstEventReceivedTime=System.currentTimeMillis();
      }
      pendingEvents.addAll(inputEvents);
      return;
    }
  }
  shuffle.handleEvents(inputEvents);
}
Program: 17262
Project: 17262
Buggy source:
@Private public TezRawKeyValueIterator getIterator() throws IOException, InterruptedException {
  if (this.numInputs == 0) {
    return new TezRawKeyValueIterator(){
      @Override public DataInputBuffer getKey() throws IOException {
        throw new RuntimeException("String_Node_Str");
      }
      @Override public DataInputBuffer getValue() throws IOException {
        throw new RuntimeException("String_Node_Str");
      }
      @Override public boolean next() throws IOException {
        return false;
      }
      @Override public void close() throws IOException {
      }
      @Override public Progress getProgress(){
        progress.complete();
        return progress;
      }
    }
;
  }
  waitForInputReady();
  return rawIter;
}

Fixed version (ground truth):
@Private public TezRawKeyValueIterator getIterator() throws IOException, InterruptedException {
synchronized (this) {
    if (this.numInputs == 0) {
      return new TezRawKeyValueIterator(){
        @Override public DataInputBuffer getKey() throws IOException {
          throw new RuntimeException("String_Node_Str");
        }
        @Override public DataInputBuffer getValue() throws IOException {
          throw new RuntimeException("String_Node_Str");
        }
        @Override public boolean next() throws IOException {
          return false;
        }
        @Override public void close() throws IOException {
        }
        @Override public Progress getProgress(){
          progress.complete();
          return progress;
        }
      }
;
    }
  }
  waitForInputReady();
synchronized (this) {
    return rawIter;
  }
}