nus-yam/ex-repair huggingface dataset:
Program: 55054
Project: 55054
Buggy source:
/** 
 * Applies a Filter transformation on a   {@link DataSet}.<br/> The transformation calls a   {@link FilterFunction} for each element of the DataSet and retains only those element for which the function returns true. Elements for  which the function returns false are filtered. 
 * @param filter The FilterFunction that is called for each element of the DataSet.
 * @return A FilterOperator that represents the filtered DataSet.
 * @see FilterFunction
 * @see FilterOperator
 * @see DataSet
 */
public FilterOperator<T> filter(FilterFunction<T> filter){
  return new FilterOperator<T>(this,filter);
}

Fixed version (ground truth):
/** 
 * Applies a Filter transformation on a   {@link DataSet}.<br/> The transformation calls a   {@link FilterFunction} for each element of the DataSet and retains only those element for which the function returns true. Elements for  which the function returns false are filtered. 
 * @param filter The FilterFunction that is called for each element of the DataSet.
 * @return A FilterOperator that represents the filtered DataSet.
 * @see FilterFunction
 * @see FilterOperator
 * @see DataSet
 */
public FilterOperator<T> filter(FilterFunction<T> filter){
  if (filter == null) {
    throw new NullPointerException("String_Node_Str");
  }
  return new FilterOperator<T>(this,filter);
}
Program: 55055
Project: 55055
Buggy source:
/** 
 * Finalizes a CoGroup transformation by applying a   {@link CoGroupFunction} to groups of elements with identical keys.<br/>Each CoGroupFunction call returns an arbitrary number of keys. 
 * @param function The CoGroupFunction that is called for all groups of elements with identical keys.
 * @return An CoGroupOperator that represents the co-grouped result DataSet.
 * @see CoGroupFunction
 * @see DataSet
 */
public <R>CoGroupOperator<I1,I2,R> with(CoGroupFunction<I1,I2,R> function){
  TypeInformation<R> returnType=TypeExtractor.getCoGroupReturnTypes(function,input1.getType(),input2.getType());
  return new CoGroupOperator<I1,I2,R>(input1,input2,keys1,keys2,function,returnType);
}

Fixed version (ground truth):
/** 
 * Finalizes a CoGroup transformation by applying a   {@link CoGroupFunction} to groups of elements with identical keys.<br/>Each CoGroupFunction call returns an arbitrary number of keys. 
 * @param function The CoGroupFunction that is called for all groups of elements with identical keys.
 * @return An CoGroupOperator that represents the co-grouped result DataSet.
 * @see CoGroupFunction
 * @see DataSet
 */
public <R>CoGroupOperator<I1,I2,R> with(CoGroupFunction<I1,I2,R> function){
  if (function == null) {
    throw new NullPointerException("String_Node_Str");
  }
  TypeInformation<R> returnType=TypeExtractor.getCoGroupReturnTypes(function,input1.getType(),input2.getType());
  return new CoGroupOperator<I1,I2,R>(input1,input2,keys1,keys2,function,returnType);
}
Program: 55056
Project: 55056
Buggy source:
/** 
 * Finalizes a Cross transformation by applying a   {@link CrossFunction} to each pair of crossed elements.<br/>Each CrossFunction call returns exactly one element. 
 * @param function The CrossFunction that is called for each pair of crossed elements.
 * @return An CrossOperator that represents the crossed result DataSet
 * @see CrossFunction
 * @see DataSet
 */
public <R>CrossOperator<I1,I2,R> with(CrossFunction<I1,I2,R> function){
  TypeInformation<R> returnType=TypeExtractor.getCrossReturnTypes(function,input1.getType(),input2.getType());
  return new CrossOperator<I1,I2,R>(input1,input2,function,returnType);
}

Fixed version (ground truth):
/** 
 * Finalizes a Cross transformation by applying a   {@link CrossFunction} to each pair of crossed elements.<br/>Each CrossFunction call returns exactly one element. 
 * @param function The CrossFunction that is called for each pair of crossed elements.
 * @return An CrossOperator that represents the crossed result DataSet
 * @see CrossFunction
 * @see DataSet
 */
public <R>CrossOperator<I1,I2,R> with(CrossFunction<I1,I2,R> function){
  if (function == null) {
    throw new NullPointerException("String_Node_Str");
  }
  TypeInformation<R> returnType=TypeExtractor.getCrossReturnTypes(function,input1.getType(),input2.getType());
  return new CrossOperator<I1,I2,R>(input1,input2,function,returnType);
}
Program: 55057
Project: 55057
Buggy source:
public FilterOperator(DataSet<T> input,FilterFunction<T> function){
  super(input,input.getType());
  if (function == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.function=function;
  extractSemanticAnnotationsFromUdf(function.getClass());
}

Fixed version (ground truth):
public FilterOperator(DataSet<T> input,FilterFunction<T> function){
  super(input,input.getType());
  this.function=function;
  extractSemanticAnnotationsFromUdf(function.getClass());
}
Program: 55058
Project: 55058
Buggy source:
public FlatMapOperator(DataSet<IN> input,FlatMapFunction<IN,OUT> function){
  super(input,TypeExtractor.getFlatMapReturnTypes(function,input.getType()));
  if (function == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.function=function;
  extractSemanticAnnotationsFromUdf(function.getClass());
}

Fixed version (ground truth):
public FlatMapOperator(DataSet<IN> input,FlatMapFunction<IN,OUT> function){
  super(input,TypeExtractor.getFlatMapReturnTypes(function,input.getType()));
  this.function=function;
  extractSemanticAnnotationsFromUdf(function.getClass());
}
Program: 55059
Project: 55059
Buggy source:
/** 
 * Finalizes a Join transformation by applying a   {@link JoinFunction} to each pair of joined elements.<br/>Each JoinFunction call returns exactly one element. 
 * @param function The JoinFunction that is called for each pair of joined elements.
 * @return An EquiJoin that represents the joined result DataSet
 * @see JoinFunction
 * @see EquiJoin
 * @see DataSet
 */
public <R>EquiJoin<I1,I2,R> with(JoinFunction<I1,I2,R> function){
  TypeInformation<R> returnType=TypeExtractor.getJoinReturnTypes(function,getInput1Type(),getInput2Type());
  return new EquiJoin<I1,I2,R>(getInput1(),getInput2(),getKeys1(),getKeys2(),function,returnType,getJoinHint());
}

Fixed version (ground truth):
/** 
 * Finalizes a Join transformation by applying a   {@link JoinFunction} to each pair of joined elements.<br/>Each JoinFunction call returns exactly one element. 
 * @param function The JoinFunction that is called for each pair of joined elements.
 * @return An EquiJoin that represents the joined result DataSet
 * @see JoinFunction
 * @see EquiJoin
 * @see DataSet
 */
public <R>EquiJoin<I1,I2,R> with(JoinFunction<I1,I2,R> function){
  if (function == null) {
    throw new NullPointerException("String_Node_Str");
  }
  TypeInformation<R> returnType=TypeExtractor.getJoinReturnTypes(function,getInput1Type(),getInput2Type());
  return new EquiJoin<I1,I2,R>(getInput1(),getInput2(),getKeys1(),getKeys2(),function,returnType,getJoinHint());
}
Program: 55060
Project: 55060
Buggy source:
public MapOperator(DataSet<IN> input,MapFunction<IN,OUT> function){
  super(input,TypeExtractor.getMapReturnTypes(function,input.getType()));
  if (function == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.function=function;
  extractSemanticAnnotationsFromUdf(function.getClass());
}

Fixed version (ground truth):
public MapOperator(DataSet<IN> input,MapFunction<IN,OUT> function){
  super(input,TypeExtractor.getMapReturnTypes(function,input.getType()));
  this.function=function;
  extractSemanticAnnotationsFromUdf(function.getClass());
}
Program: 55061
Project: 55061
Buggy source:
/** 
 * Constructor for a grouped reduce.
 * @param input The grouped input to be processed group-wise by the groupReduce function.
 * @param function The user-defined GroupReduce function.
 */
public ReduceGroupOperator(Grouping<IN> input,GroupReduceFunction<IN,OUT> function){
  super(input != null ? input.getDataSet() : null,TypeExtractor.getGroupReduceReturnTypes(function,input.getDataSet().getType()));
  if (function == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.function=function;
  this.grouper=input;
  checkCombinability();
  extractSemanticAnnotationsFromUdf(function.getClass());
}

Fixed version (ground truth):
/** 
 * Constructor for a grouped reduce.
 * @param input The grouped input to be processed group-wise by the groupReduce function.
 * @param function The user-defined GroupReduce function.
 */
public ReduceGroupOperator(Grouping<IN> input,GroupReduceFunction<IN,OUT> function){
  super(input != null ? input.getDataSet() : null,TypeExtractor.getGroupReduceReturnTypes(function,input.getDataSet().getType()));
  this.function=function;
  this.grouper=input;
  checkCombinability();
  extractSemanticAnnotationsFromUdf(function.getClass());
}
Program: 55062
Project: 55062
Buggy source:
public ReduceOperator(Grouping<IN> input,ReduceFunction<IN> function){
  super(input.getDataSet(),input.getDataSet().getType());
  if (function == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.function=function;
  this.grouper=input;
  extractSemanticAnnotationsFromUdf(function.getClass());
}

Fixed version (ground truth):
public ReduceOperator(Grouping<IN> input,ReduceFunction<IN> function){
  super(input.getDataSet(),input.getDataSet().getType());
  this.function=function;
  this.grouper=input;
  extractSemanticAnnotationsFromUdf(function.getClass());
}
Program: 55063
Project: 55063
Buggy source:
/** 
 * Applies a GroupReduce transformation on a grouped and sorted   {@link DataSet}.<br/> The transformation calls a   {@link GroupReduceFunction} for each group of the DataSet.A GroupReduceFunction can iterate over all elements of a group and emit any number of output elements including none.
 * @param reducer The GroupReduceFunction that is applied on each group of the DataSet.
 * @return A GroupReduceOperator that represents the reduced DataSet.
 * @see GroupReduceFunction
 * @see GroupReduceOperator
 * @see DataSet
 */
public <R>ReduceGroupOperator<T,R> reduceGroup(GroupReduceFunction<T,R> reducer){
  return new ReduceGroupOperator<T,R>(this,reducer);
}

Fixed version (ground truth):
/** 
 * Applies a GroupReduce transformation on a grouped and sorted   {@link DataSet}.<br/> The transformation calls a   {@link GroupReduceFunction} for each group of the DataSet.A GroupReduceFunction can iterate over all elements of a group and emit any number of output elements including none.
 * @param reducer The GroupReduceFunction that is applied on each group of the DataSet.
 * @return A GroupReduceOperator that represents the reduced DataSet.
 * @see GroupReduceFunction
 * @see GroupReduceOperator
 * @see DataSet
 */
public <R>ReduceGroupOperator<T,R> reduceGroup(GroupReduceFunction<T,R> reducer){
  if (reducer == null) {
    throw new NullPointerException("String_Node_Str");
  }
  return new ReduceGroupOperator<T,R>(this,reducer);
}
Program: 55064
Project: 55064
Buggy source:
/** 
 * Applies a Reduce transformation on a grouped   {@link DataSet}.<br/> For each group, the transformation consecutively calls a   {@link ReduceFunction} until only a single element for each group remains.  A ReduceFunction combines two elements into one new element of the same type.
 * @param reducer The ReduceFunction that is applied on each group of the DataSet.
 * @return A ReduceOperator that represents the reduced DataSet.
 * @see ReduceFunction
 * @see ReduceOperator
 * @see DataSet
 */
public ReduceOperator<T> reduce(ReduceFunction<T> reducer){
  return new ReduceOperator<T>(this,reducer);
}

Fixed version (ground truth):
/** 
 * Applies a Reduce transformation on a grouped   {@link DataSet}.<br/> For each group, the transformation consecutively calls a   {@link ReduceFunction} until only a single element for each group remains.  A ReduceFunction combines two elements into one new element of the same type.
 * @param reducer The ReduceFunction that is applied on each group of the DataSet.
 * @return A ReduceOperator that represents the reduced DataSet.
 * @see ReduceFunction
 * @see ReduceOperator
 * @see DataSet
 */
public ReduceOperator<T> reduce(ReduceFunction<T> reducer){
  if (reducer == null) {
    throw new NullPointerException("String_Node_Str");
  }
  return new ReduceOperator<T>(this,reducer);
}
Program: 55065
Project: 55065
Buggy source:
/** 
 * Applies a GroupReduce transformation on a grouped   {@link DataSet}.<br/> The transformation calls a   {@link GroupReduceFunction} for each group of the DataSet.A GroupReduceFunction can iterate over all elements of a group and emit any number of output elements including none.
 * @param reducer The GroupReduceFunction that is applied on each group of the DataSet.
 * @return A GroupReduceOperator that represents the reduced DataSet.
 * @see GroupReduceFunction
 * @see GroupReduceOperator
 * @see DataSet
 */
public <R>ReduceGroupOperator<T,R> reduceGroup(GroupReduceFunction<T,R> reducer){
  return new ReduceGroupOperator<T,R>(this,reducer);
}

Fixed version (ground truth):
/** 
 * Applies a GroupReduce transformation on a grouped   {@link DataSet}.<br/> The transformation calls a   {@link GroupReduceFunction} for each group of the DataSet.A GroupReduceFunction can iterate over all elements of a group and emit any number of output elements including none.
 * @param reducer The GroupReduceFunction that is applied on each group of the DataSet.
 * @return A GroupReduceOperator that represents the reduced DataSet.
 * @see GroupReduceFunction
 * @see GroupReduceOperator
 * @see DataSet
 */
public <R>ReduceGroupOperator<T,R> reduceGroup(GroupReduceFunction<T,R> reducer){
  if (reducer == null) {
    throw new NullPointerException("String_Node_Str");
  }
  return new ReduceGroupOperator<T,R>(this,reducer);
}
Program: 55066
Project: 55066
Buggy source:
/** 
 * Compares two records in serialized from. The return value indicates the order of the two in the same way as defined by   {@link java.util.Comparator#compare(Object,Object)}. <p> This method may de-serialize the records or compare them directly based on their binary representation. 
 * @param firstSource The input view containing the first record.
 * @param secondSource The input view containing the second record.
 * @return An integer defining the oder among the objects in the same way as {@link Comparator#compare(Object,Object)}.
 * @throws IOException Thrown, if any of the input views raised an exception when reading the records.
 * @see java.util.Comparator#compare(Object,Object)
 */
public abstract int compare(DataInputView firstSource,DataInputView secondSource) throws IOException ;

Fixed version (ground truth):
/** 
 * Compares two records in serialized from. The return value indicates the order of the two in the same way as defined by   {@link java.util.Comparator#compare(Object,Object)}. <p> This method may de-serialize the records or compare them directly based on their binary representation. 
 * @param firstSource The input view containing the first record.
 * @param secondSource The input view containing the second record.
 * @return An integer defining the oder among the objects in the same way as {@link java.util.Comparator#compare(Object,Object)}.
 * @throws IOException Thrown, if any of the input views raised an exception when reading the records.
 * @see java.util.Comparator#compare(Object,Object)
 */
public abstract int compare(DataInputView firstSource,DataInputView secondSource) throws IOException ;
Program: 55067
Project: 55067
Buggy source:
@Override public TypeComparator<T> duplicate(){
  return new TupleLeadingFieldComparator<T,K>(comparator);
}

Fixed version (ground truth):
@Override public TypeComparator<T> duplicate(){
  return new TupleLeadingFieldComparator<T,K>(comparator.duplicate());
}
Program: 55068
Project: 55068
Buggy source:
/** 
 * Gets the solution set of the delta iteration. The solution set represents the state that is kept across iterations.
 * @return The solution set of the delta iteration.
 */
public DataSet<ST> getSolutionSet(){
  return solutionSetPlaceholder;
}

Fixed version (ground truth):
/** 
 * Gets the solution set of the delta iteration. The solution set represents the state that is kept across iterations.
 * @return The solution set of the delta iteration.
 */
public SolutionSetPlaceHolder<ST> getSolutionSet(){
  return solutionSetPlaceholder;
}
Program: 55069
Project: 55069
Buggy source:
DeltaIteration(ExecutionEnvironment context,TypeInformation<ST> type,DataSet<ST> solutionSet,DataSet<WT> workset,Keys<ST> keys,int maxIterations){
  initialSolutionSet=solutionSet;
  initialWorkset=workset;
  solutionSetPlaceholder=new SolutionSetPlaceHolder(context,solutionSet.getType());
  worksetPlaceholder=new WorksetPlaceHolder(context,workset.getType());
  this.keys=keys;
  this.maxIterations=maxIterations;
}

Fixed version (ground truth):
DeltaIteration(ExecutionEnvironment context,TypeInformation<ST> type,DataSet<ST> solutionSet,DataSet<WT> workset,Keys<ST> keys,int maxIterations){
  initialSolutionSet=solutionSet;
  initialWorkset=workset;
  solutionSetPlaceholder=new SolutionSetPlaceHolder<ST>(context,solutionSet.getType());
  worksetPlaceholder=new WorksetPlaceHolder<WT>(context,workset.getType());
  this.keys=keys;
  this.maxIterations=maxIterations;
}
Program: 55070
Project: 55070
Buggy source:
/** 
 * Gets the working set of the delta iteration. The working set is constructed by the previous iteration.
 * @return The working set of the delta iteration.
 */
public DataSet<WT> getWorkset(){
  return worksetPlaceholder;
}

Fixed version (ground truth):
/** 
 * Gets the working set of the delta iteration. The working set is constructed by the previous iteration.
 * @return The working set of the delta iteration.
 */
public WorksetPlaceHolder<WT> getWorkset(){
  return worksetPlaceholder;
}
Program: 55071
Project: 55071
Buggy source:
private <D,W>eu.stratosphere.api.common.operators.DeltaIteration translateDeltaIteration(DeltaIterationResultSet<D,W> iterationEnd){
  PlanDeltaIterationOperator<D,W> iterationOperator=new PlanDeltaIterationOperator<D,W>(iterationEnd.getKeyPositions(),"String_Node_Str",iterationEnd.getType(),iterationEnd.getWorksetType());
  iterationOperator.setMaximumNumberOfIterations(iterationEnd.getMaxIterations());
  DeltaIteration<?,?> iterationHead=iterationEnd.getIterationHead();
  DeltaIteration<D,W>.SolutionSetPlaceHolder solutionSetPlaceHolder=(DeltaIteration<D,W>.SolutionSetPlaceHolder)iterationHead.getSolutionSet();
  DeltaIteration<D,W>.WorksetPlaceHolder worksetPlaceHolder=(DeltaIteration<D,W>.WorksetPlaceHolder)iterationHead.getWorkset();
  translated.put(solutionSetPlaceHolder,iterationOperator.getSolutionSet());
  translated.put(worksetPlaceHolder,iterationOperator.getWorkset());
  Operator translatedSolutionSet=translate(iterationEnd.getNextSolutionSet());
  Operator translatedWorkset=translate(iterationEnd.getNextWorkset());
  iterationOperator.setNextWorkset(translatedWorkset);
  iterationOperator.setSolutionSetDelta(translatedSolutionSet);
  iterationOperator.setInitialSolutionSet(translate(iterationHead.getInitialSolutionSet()));
  iterationOperator.setInitialWorkset(translate(iterationHead.getInitialWorkset()));
  return iterationOperator;
}

Fixed version (ground truth):
private <D,W>eu.stratosphere.api.common.operators.DeltaIteration translateDeltaIteration(DeltaIterationResultSet<D,W> iterationEnd){
  PlanDeltaIterationOperator<D,W> iterationOperator=new PlanDeltaIterationOperator<D,W>(iterationEnd.getKeyPositions(),"String_Node_Str",iterationEnd.getType(),iterationEnd.getWorksetType());
  iterationOperator.setMaximumNumberOfIterations(iterationEnd.getMaxIterations());
  DeltaIteration<D,W> iterationHead=iterationEnd.getIterationHead();
  DeltaIteration.SolutionSetPlaceHolder<D> solutionSetPlaceHolder=iterationHead.getSolutionSet();
  DeltaIteration.WorksetPlaceHolder<W> worksetPlaceHolder=iterationHead.getWorkset();
  translated.put(solutionSetPlaceHolder,iterationOperator.getSolutionSet());
  translated.put(worksetPlaceHolder,iterationOperator.getWorkset());
  Operator translatedSolutionSet=translate(iterationEnd.getNextSolutionSet());
  Operator translatedWorkset=translate(iterationEnd.getNextWorkset());
  iterationOperator.setNextWorkset(translatedWorkset);
  iterationOperator.setSolutionSetDelta(translatedSolutionSet);
  iterationOperator.setInitialSolutionSet(translate(iterationHead.getInitialSolutionSet()));
  iterationOperator.setInitialWorkset(translate(iterationHead.getInitialWorkset()));
  return iterationOperator;
}
Program: 55073
Project: 55073
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + (getDegreeOfParallelism() == -1 ? "String_Node_Str" : getDegreeOfParallelism()) + "String_Node_Str"+ getIdString();
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + (getDegreeOfParallelism() == -1 ? "String_Node_Str" : getDegreeOfParallelism()) + "String_Node_Str"+ getNumTaskManager()+ "String_Node_Str"+ getIdString();
}
Program: 55074
Project: 55074
Buggy source:
/** 
 * Writes the given double-precision floating-point value (64bit, 8 bytes) to the given position in the system's native byte order. This method offers the best speed for double writing and should be used unless a specific byte order is required. In most cases, it suffices to know that the byte order in which the value is written is the same as the one in which it is read  (such as transient storage in memory, or serialization for I/O and network), making this method the preferable choice.
 * @param index The position at which the memory will be written.
 * @param value The double value to be written.
 * @return This view itself.
 * @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger then the segmentsize minus 8.
 */
public final void putDouble(int index,double value){
  putLong(index,Double.doubleToRawLongBits(value));
}

Fixed version (ground truth):
/** 
 * Writes the given double-precision floating-point value (64bit, 8 bytes) to the given position in the system's native byte order. This method offers the best speed for double writing and should be used unless a specific byte order is required. In most cases, it suffices to know that the byte order in which the value is written is the same as the one in which it is read  (such as transient storage in memory, or serialization for I/O and network), making this method the preferable choice.
 * @param index The position at which the memory will be written.
 * @param value The double value to be written.
 * @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger then the segmentsize minus 8.
 */
public final void putDouble(int index,double value){
  putLong(index,Double.doubleToRawLongBits(value));
}
Program: 55075
Project: 55075
Buggy source:
/** 
 * Reads one byte at the given position and returns its boolean representation.
 * @param index The position from which the memory will be read.
 * @return The char value at the given position.
 * @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger then the segmentsize minus 1.
 */
public final boolean getBoolean(int index){
  return this.memory[index] != 0;
}

Fixed version (ground truth):
/** 
 * Reads one byte at the given position and returns its boolean representation.
 * @param index The position from which the memory will be read.
 * @return The boolean value at the given position.
 * @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger then the segmentsize minus 1.
 */
public final boolean getBoolean(int index){
  return this.memory[index] != 0;
}
Program: 55076
Project: 55076
Buggy source:
/** 
 * Writes one byte containing the byte value into this buffer at the given position.
 * @param index The position at which the memory will be written.
 * @param value The char value to be written.
 * @return This view itself.
 * @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger then the segmentsize minus 1.
 */
public final void putBoolean(int index,boolean value){
  this.memory[index]=(byte)(value ? 1 : 0);
}

Fixed version (ground truth):
/** 
 * Writes one byte containing the byte value into this buffer at the given position.
 * @param index The position at which the memory will be written.
 * @param value The char value to be written.
 * @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger then the segmentsize minus 1.
 */
public final void putBoolean(int index,boolean value){
  this.memory[index]=(byte)(value ? 1 : 0);
}
Program: 55077
Project: 55077
Buggy source:
/** 
 * Writes two memory containing the given char value, in the current byte order, into this buffer at the given position.
 * @param index The position at which the memory will be written.
 * @param value The char value to be written.
 * @return This view itself.
 * @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger then the segmentsize minus 2.
 */
public final void putChar(int index,char value){
  this.memory[index]=(byte)(value >> 8);
  this.memory[index + 1]=(byte)value;
}

Fixed version (ground truth):
/** 
 * Writes two memory containing the given char value, in the current byte order, into this buffer at the given position.
 * @param index The position at which the memory will be written.
 * @param value The char value to be written.
 * @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger then the segmentsize minus 2.
 */
public final void putChar(int index,char value){
  this.memory[index]=(byte)(value >> 8);
  this.memory[index + 1]=(byte)value;
}
Program: 55078
Project: 55078
Buggy source:
/** 
 * Used by system internally to merge the collected parts of an accumulator at the end of the job.
 * @param other reference to accumulator to merge in
 * @return Reference to this (for efficiency), after data from other weremerged in
 */
void merge(Accumulator<V,R> other);

Fixed version (ground truth):
/** 
 * Used by system internally to merge the collected parts of an accumulator at the end of the job.
 * @param other Reference to accumulator to merge in.
 */
void merge(Accumulator<V,R> other);
Program: 55079
Project: 55079
Buggy source:
/** 
 * Adds the given value to the current aggregate.
 * @param value The value to add to the aggregate.
 */
public void aggregate(double element){
  sum+=element;
}

Fixed version (ground truth):
/** 
 * Adds the given value to the current aggregate.
 * @param value The value to add to the aggregate.
 */
public void aggregate(double value){
  sum+=value;
}
Program: 55080
Project: 55080
Buggy source:
/** 
 * Clears all previous broadcast inputs and binds the given inputs as broadcast variables of this operator.
 * @param inputs The <name, root> pairs to be set as broadcast inputs.
 */
public void setBroadcastVariables(Map<String,Operator> roots){
  this.broadcastInputs.clear();
  this.broadcastInputs.putAll(roots);
}

Fixed version (ground truth):
/** 
 * Clears all previous broadcast inputs and binds the given inputs as broadcast variables of this operator.
 * @param inputs The <name, root> pairs to be set as broadcast inputs.
 */
public void setBroadcastVariables(Map<String,Operator> inputs){
  this.broadcastInputs.clear();
  this.broadcastInputs.putAll(inputs);
}
Program: 55081
Project: 55081
Buggy source:
/** 
 * Adds to the input the union of the given operators.
 * @param input The operator(s) to be unioned with the input.
 * @deprecated This method will be removed in future versions. Use the {@link Union} operator instead.
 */
@Deprecated public void addInput(Operator... inputs){
  Preconditions.checkNotNull(inputs,"String_Node_Str");
  this.input=Operator.createUnionCascade(this.input,inputs);
}

Fixed version (ground truth):
/** 
 * Adds to the input the union of the given operators.
 * @param inputs The operator(s) to be unioned with the input.
 * @deprecated This method will be removed in future versions. Use the {@link Union} operator instead.
 */
@Deprecated public void addInput(Operator... inputs){
  Preconditions.checkNotNull(inputs,"String_Node_Str");
  this.input=Operator.createUnionCascade(this.input,inputs);
}
Program: 55082
Project: 55082
Buggy source:
/** 
 * Adds a suffix to the final name in the path.
 * @param the suffix to be added
 * @return the new path including the suffix
 */
public Path suffix(String suffix){
  return new Path(getParent(),getName() + suffix);
}

Fixed version (ground truth):
/** 
 * Adds a suffix to the final name in the path.
 * @param suffix The suffix to be added
 * @return the new path including the suffix
 */
public Path suffix(String suffix){
  return new Path(getParent(),getName() + suffix);
}
Program: 55083
Project: 55083
Buggy source:
/** 
 * Creates a generic input split with the given split number.
 * @param number the number of the split
 */
public GenericInputSplit(int partitionNumber,int totalNumberOfPartitions){
  this.partitionNumber=partitionNumber;
  this.totalNumberOfPartitions=totalNumberOfPartitions;
}

Fixed version (ground truth):
/** 
 * Creates a generic input split with the given split number.
 * @param partitionNumber The number of the split's partition.
 * @param totalNumberOfPartitions The total number of the splits (partitions).
 */
public GenericInputSplit(int partitionNumber,int totalNumberOfPartitions){
  this.partitionNumber=partitionNumber;
  this.totalNumberOfPartitions=totalNumberOfPartitions;
}
Program: 55084
Project: 55084
Buggy source:
/** 
 * serialize write this object to out length uses zero-compressed encoding
 * @see Writable#writeTo(DataOutput)
 */
public void write(final DataOutput out) throws IOException {
  out.writeInt(this.length);
  out.write(this.bytes,0,this.length);
}

Fixed version (ground truth):
@Override public void write(final DataOutput out) throws IOException {
  out.writeInt(this.length);
  out.write(this.bytes,0,this.length);
}
Program: 55085
Project: 55085
Buggy source:
/** 
 * Bulk put method. Copies   {@code numBytes} bytes from the given {@code ByteBuffer}, into this memory segment. The bytes will be read from the target buffer starting at the buffer's current position, and will be written to this memory segment starting at   {@code offset}. If this method attempts to read more bytes than the target byte buffer has remaining (with respect to   {@link ByteBuffer#remaining()}), this method will cause a   {@link BufferUnderflowException}.
 * @param offset The position where the bytes are started to be written to in this memory segment.
 * @param target The ByteBuffer to copy the bytes from.
 * @param numBytes The number of bytes to copy.
 * @throws IndexOutOfBoundsException If the offset is invalid, or the source buffer does notcontain the given number of bytes, or this segment does not have enough space for the bytes (counting from offset).
 */
public final void put(int offset,ByteBuffer source,int numBytes){
  source.get(this.memory,offset,numBytes);
}

Fixed version (ground truth):
/** 
 * Bulk put method. Copies   {@code numBytes} bytes from the given {@code ByteBuffer}, into this memory segment. The bytes will be read from the target buffer starting at the buffer's current position, and will be written to this memory segment starting at   {@code offset}. If this method attempts to read more bytes than the target byte buffer has remaining (with respect to   {@link ByteBuffer#remaining()}), this method will cause a   {@link BufferUnderflowException}.
 * @param offset The position where the bytes are started to be written to in this memory segment.
 * @param source The ByteBuffer to copy the bytes from.
 * @param numBytes The number of bytes to copy.
 * @throws IndexOutOfBoundsException If the offset is invalid, or the source buffer does notcontain the given number of bytes, or this segment does not have enough space for the bytes (counting from offset).
 */
public final void put(int offset,ByteBuffer source,int numBytes){
  source.get(this.memory,offset,numBytes);
}
Program: 55086
Project: 55086
Buggy source:
/** 
 * Creates a new memory segment of given size with the provided views.
 * @param size The size of the memory segment.
 * @param inputView The input view to use.
 * @param outputView The output view to use.
 */
public MemorySegment(byte[] memory){
  this.memory=memory;
}

Fixed version (ground truth):
/** 
 * Creates a new memory segment that represents the data in the given byte array.
 * @param memory The byte array that holds the data.
 */
public MemorySegment(byte[] memory){
  this.memory=memory;
}
Program: 55087
Project: 55087
Buggy source:
@SuppressWarnings("String_Node_Str") private ObjectArrayTypeInfo(Type arrayType,Type componentType){
  this.arrayType=arrayType;
  this.componentType=componentType;
  this.componentInfo=(TypeInformation<C>)TypeExtractor.createTypeInfo(componentType);
}

Fixed version (ground truth):
private ObjectArrayTypeInfo(Type arrayType,Type componentType,TypeInformation<C> componentInfo){
  this.arrayType=arrayType;
  this.componentType=componentType;
  this.componentInfo=componentInfo;
}
Program: 55088
Project: 55088
Buggy source:
@SuppressWarnings("String_Node_Str") public static <T,C>ObjectArrayTypeInfo<T,C> getInfoFor(Type type){
  if (type instanceof GenericArrayType) {
    GenericArrayType genericArray=(GenericArrayType)type;
    return new ObjectArrayTypeInfo<T,C>(type,genericArray.getGenericComponentType());
  }
 else   if (type instanceof Class<?> && ((Class<?>)type).isArray() && BasicTypeInfo.getInfoFor((Class<C>)type) == null) {
    Class<C> array=(Class<C>)type;
    return new ObjectArrayTypeInfo<T,C>(type,array.getComponentType());
  }
  throw new InvalidTypesException("String_Node_Str");
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static <T,C>ObjectArrayTypeInfo<T,C> getInfoFor(Type type){
  if (type instanceof Class<?> && ((Class<?>)type).isArray() && BasicTypeInfo.getInfoFor((Class<C>)type) == null) {
    Class<C> array=(Class<C>)type;
    return new ObjectArrayTypeInfo<T,C>(type,array.getComponentType());
  }
  throw new InvalidTypesException("String_Node_Str");
}
Program: 55090
Project: 55090
Buggy source:
@Test public void testBasicArray(){
  CoGroupFunction<?,?,?> function=new CoGroupFunction<String,String,String[]>(){
    private static final long serialVersionUID=1L;
    @Override public void combineFirst(    Iterator<String> records,    Collector<String> out) throws Exception {
    }
    @Override public void combineSecond(    Iterator<String> records,    Collector<String> out) throws Exception {
    }
    @Override public void coGroup(    Iterator<String> first,    Iterator<String> second,    Collector<String[]> out) throws Exception {
    }
  }
;
  TypeInformation<?> ti=TypeExtractor.getCoGroupReturnTypes(function,null,null);
  Assert.assertFalse(ti.isBasicType());
  Assert.assertFalse(ti.isTupleType());
  Assert.assertTrue(ti instanceof BasicArrayTypeInfo);
  Assert.assertEquals(BasicArrayTypeInfo.STRING_ARRAY_TYPE_INFO,ti);
}

Fixed version (ground truth):
@Test public void testBasicArray(){
  CoGroupFunction<?,?,?> function=new CoGroupFunction<String,String,String[]>(){
    private static final long serialVersionUID=1L;
    @Override public void combineFirst(    Iterator<String> records,    Collector<String> out) throws Exception {
    }
    @Override public void combineSecond(    Iterator<String> records,    Collector<String> out) throws Exception {
    }
    @Override public void coGroup(    Iterator<String> first,    Iterator<String> second,    Collector<String[]> out) throws Exception {
    }
  }
;
  TypeInformation<?> ti=TypeExtractor.getCoGroupReturnTypes(function,null,null);
  Assert.assertFalse(ti.isBasicType());
  Assert.assertFalse(ti.isTupleType());
  Assert.assertTrue(ti instanceof BasicArrayTypeInfo<?,?> || ti instanceof ObjectArrayTypeInfo<?,?>);
  if (ti instanceof BasicArrayTypeInfo<?,?>) {
    Assert.assertEquals(BasicArrayTypeInfo.STRING_ARRAY_TYPE_INFO,ti);
  }
 else {
    Assert.assertEquals(BasicTypeInfo.STRING_TYPE_INFO,((ObjectArrayTypeInfo<?,?>)ti).getComponentInfo());
  }
}
Program: 55091
Project: 55091
Buggy source:
@Override public Tuple2<String,String>[] map(String value) throws Exception {
  return null;
}

Fixed version (ground truth):
@Override public MyObject<String> map(Boolean value) throws Exception {
  return null;
}
Program: 55093
Project: 55093
Buggy source:
public NumberSequenceIterator(long from,long to){
  if (from > to)   throw new IllegalArgumentException("String_Node_Str");
  this.current=from;
  this.to=to;
}

Fixed version (ground truth):
/** 
 * Internal constructor to allow for empty iterators.
 * @param from
 * @param to
 * @param mark
 */
private NumberSequenceIterator(long from,long to,boolean mark){
  this.current=from;
  this.to=to;
}
Program: 55094
Project: 55094
Buggy source:
private static final void testSplitting(NumberSequenceIterator iter,int numSplits){
  NumberSequenceIterator[] splits=iter.split(numSplits);
  assertEquals(numSplits,splits.length);
  assertEquals(iter.getCurrent(),splits[0].getCurrent());
  assertEquals(iter.getTo(),splits[numSplits - 1].getTo());
  testMaxSplitDiff(splits);
}

Fixed version (ground truth):
private static final void testSplitting(NumberSequenceIterator iter,int numSplits){
  NumberSequenceIterator[] splits=iter.split(numSplits);
  assertEquals(numSplits,splits.length);
  assertEquals(iter.getCurrent(),splits[0].getCurrent());
  assertEquals(iter.getTo(),splits[numSplits - 1].getTo());
  for (int i=1; i < splits.length; i++) {
    assertEquals(splits[i - 1].getTo() + 1,splits[i].getCurrent());
  }
  testMaxSplitDiff(splits);
}
Program: 55095
Project: 55095
Buggy source:
private static final void testMaxSplitDiff(NumberSequenceIterator[] iters){
  long minSplitSize=Long.MAX_VALUE;
  long maxSplitSize=Long.MIN_VALUE;
  for (  NumberSequenceIterator iter : iters) {
    long diff=iter.getTo() - iter.getCurrent();
    if (diff < 0)     diff=Long.MAX_VALUE;
    minSplitSize=Math.min(minSplitSize,diff);
    maxSplitSize=Math.max(maxSplitSize,diff);
  }
  assertTrue(maxSplitSize == minSplitSize || maxSplitSize - 1 == minSplitSize);
}

Fixed version (ground truth):
private static final void testMaxSplitDiff(NumberSequenceIterator[] iters){
  long minSplitSize=Long.MAX_VALUE;
  long maxSplitSize=Long.MIN_VALUE;
  for (  NumberSequenceIterator iter : iters) {
    long diff;
    if (iter.getTo() < iter.getCurrent()) {
      diff=0;
    }
 else {
      diff=iter.getTo() - iter.getCurrent();
    }
    if (diff < 0)     diff=Long.MAX_VALUE;
    minSplitSize=Math.min(minSplitSize,diff);
    maxSplitSize=Math.max(maxSplitSize,diff);
  }
  assertTrue(maxSplitSize == minSplitSize || maxSplitSize - 1 == minSplitSize);
}
Program: 55096
Project: 55096
Buggy source:
@Override public String readRecord(String reusable,byte[] bytes,int offset,int numBytes){
  return new String(bytes,offset,numBytes,this.charset);
}

Fixed version (ground truth):
@Override public String readRecord(String reusable,byte[] bytes,int offset,int numBytes){
  if (this.getDelimiter() != null && this.getDelimiter().length == 1 && this.getDelimiter()[0] == NEW_LINE && offset + numBytes >= 1 && bytes[offset + numBytes - 1] == CARRIAGE_RETURN) {
    numBytes-=1;
  }
  return new String(bytes,offset,numBytes,this.charset);
}
Program: 55097
Project: 55097
Buggy source:
public Record readRecord(Record reuse,byte[] bytes,int offset,int numBytes){
  StringValue str=this.theString;
  if (this.ascii) {
    str.setValueAscii(bytes,offset,numBytes);
  }
 else {
    ByteBuffer byteWrapper=this.byteWrapper;
    if (bytes != byteWrapper.array()) {
      byteWrapper=ByteBuffer.wrap(bytes,0,bytes.length);
      this.byteWrapper=byteWrapper;
    }
    byteWrapper.limit(offset + numBytes);
    byteWrapper.position(offset);
    try {
      CharBuffer result=this.decoder.decode(byteWrapper);
      str.setValue(result);
    }
 catch (    CharacterCodingException e) {
      byte[] copy=new byte[numBytes];
      System.arraycopy(bytes,offset,copy,0,numBytes);
      LOG.warn("String_Node_Str" + Arrays.toString(copy),e);
      return null;
    }
  }
  reuse.clear();
  reuse.setField(this.pos,str);
  return reuse;
}

Fixed version (ground truth):
public Record readRecord(Record reuse,byte[] bytes,int offset,int numBytes){
  StringValue str=this.theString;
  if (this.getDelimiter() != null && this.getDelimiter().length == 1 && this.getDelimiter()[0] == NEW_LINE && offset + numBytes >= 1 && bytes[offset + numBytes - 1] == CARRIAGE_RETURN) {
    numBytes-=1;
  }
  if (this.ascii) {
    str.setValueAscii(bytes,offset,numBytes);
  }
 else {
    ByteBuffer byteWrapper=this.byteWrapper;
    if (bytes != byteWrapper.array()) {
      byteWrapper=ByteBuffer.wrap(bytes,0,bytes.length);
      this.byteWrapper=byteWrapper;
    }
    byteWrapper.limit(offset + numBytes);
    byteWrapper.position(offset);
    try {
      CharBuffer result=this.decoder.decode(byteWrapper);
      str.setValue(result);
    }
 catch (    CharacterCodingException e) {
      byte[] copy=new byte[numBytes];
      System.arraycopy(bytes,offset,copy,0,numBytes);
      LOG.warn("String_Node_Str" + Arrays.toString(copy),e);
      return null;
    }
  }
  reuse.clear();
  reuse.setField(this.pos,str);
  return reuse;
}
Program: 55098
Project: 55098
Buggy source:
/** 
 * Checks, whether the given number of bytes for a normalized suffice to determine the order of elements of the data type for which this comparator provides the comparison methods. For example, if the data type is ordered with respect to an integer value it contains, then this method would return true, if the number of key bytes was larger or equal to four.
 * @return True, if the given number of bytes for a normalized suffice to determine the order of elements,false otherwise.
 */
public abstract boolean isNormalizedKeyPrefixOnly(int keyBytes);

Fixed version (ground truth):
/** 
 * Checks, whether the given number of bytes for a normalized is only a prefix to determine the order of elements of the data type for which this comparator provides the comparison methods. For example, if the data type is ordered with respect to an integer value it contains, then this method would return true, if the number of key bytes is smaller than four.
 * @return True, if the given number of bytes is only a prefix,false otherwise.
 */
public abstract boolean isNormalizedKeyPrefixOnly(int keyBytes);
Program: 55099
Project: 55099
Buggy source:
/** 
 * Writes a given record to this sort buffer. The written record will be appended and take the last logical position.
 * @param record The record to be written.
 * @return True, if the record was successfully written, false, if the sort buffer was full.
 * @throws IOException Thrown, if an error occurred while serializing the record into the buffers.
 */
@Override public boolean write(T record) throws IOException {
  if (this.currentSortIndexOffset > this.lastIndexEntryOffset) {
    if (memoryAvailable()) {
      this.currentSortIndexSegment=nextMemorySegment();
      this.sortIndex.add(this.currentSortIndexSegment);
      this.currentSortIndexOffset=0;
      this.sortIndexBytes+=this.segmentSize;
    }
 else     return false;
  }
  this.currentSortIndexSegment.putLong(this.currentSortIndexOffset,this.currentDataBufferOffset);
  this.comparator.putNormalizedKey(record,this.currentSortIndexSegment,this.currentSortIndexOffset + OFFSET_LEN,this.numKeyBytes);
  try {
    this.serializer.serialize(record,this.recordCollector);
    this.currentSortIndexOffset+=this.indexEntrySize;
    this.currentDataBufferOffset=this.recordCollector.getCurrentOffset();
    this.numRecords++;
    return true;
  }
 catch (  EOFException eofex) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Writes a given record to this sort buffer. The written record will be appended and take the last logical position.
 * @param record The record to be written.
 * @return True, if the record was successfully written, false, if the sort buffer was full.
 * @throws IOException Thrown, if an error occurred while serializing the record into the buffers.
 */
@Override public boolean write(T record) throws IOException {
  if (this.currentSortIndexOffset > this.lastIndexEntryOffset) {
    if (memoryAvailable()) {
      this.currentSortIndexSegment=nextMemorySegment();
      this.sortIndex.add(this.currentSortIndexSegment);
      this.currentSortIndexOffset=0;
      this.sortIndexBytes+=this.segmentSize;
    }
 else     return false;
  }
  this.currentSortIndexSegment.putLong(this.currentSortIndexOffset,this.currentDataBufferOffset);
  if (this.numKeyBytes != 0) {
    this.comparator.putNormalizedKey(record,this.currentSortIndexSegment,this.currentSortIndexOffset + OFFSET_LEN,this.numKeyBytes);
  }
  try {
    this.serializer.serialize(record,this.recordCollector);
    this.currentSortIndexOffset+=this.indexEntrySize;
    this.currentDataBufferOffset=this.recordCollector.getCurrentOffset();
    this.numRecords++;
    return true;
  }
 catch (  EOFException eofex) {
    return false;
  }
}
Program: 55100
Project: 55100
Buggy source:
@Override public List<PlanNode> getAlternativePlans(CostEstimator estimator){
  if (this.cachedPlans != null) {
    return this.cachedPlans;
  }
  SourcePlanNode candidate=new SourcePlanNode(this,"String_Node_Str" + this.getPactContract().getName() + "String_Node_Str");
  candidate.updatePropertiesWithUniqueSets(getUniqueFields());
  final Costs costs=new Costs();
  if (FileInputFormat.class.isAssignableFrom(getPactContract().getFormatWrapper().getUserCodeObject().getClass()) && this.estimatedOutputSize >= 0) {
    estimator.addFileInputCost(this.estimatedOutputSize,costs);
  }
  candidate.setCosts(costs);
  List<PlanNode> plans=new ArrayList<PlanNode>(1);
  plans.add(candidate);
  this.cachedPlans=plans;
  return plans;
}

Fixed version (ground truth):
@Override public List<PlanNode> getAlternativePlans(CostEstimator estimator){
  if (this.cachedPlans != null) {
    return this.cachedPlans;
  }
  SourcePlanNode candidate=new SourcePlanNode(this,"String_Node_Str" + this.getPactContract().getName() + "String_Node_Str");
  candidate.updatePropertiesWithUniqueSets(getUniqueFields());
  final Costs costs=new Costs();
  if (FileInputFormat.class.isAssignableFrom(getPactContract().getFormatWrapper().getUserCodeClass()) && this.estimatedOutputSize >= 0) {
    estimator.addFileInputCost(this.estimatedOutputSize,costs);
  }
  candidate.setCosts(costs);
  List<PlanNode> plans=new ArrayList<PlanNode>(1);
  plans.add(candidate);
  this.cachedPlans=plans;
  return plans;
}
Program: 55101
Project: 55101
Buggy source:
public void compareResultsByLinesInMemory(String expectedResultStr,String resultPath) throws Exception {
  ArrayList<String> list=new ArrayList<String>();
  readAllResultLines(list,resultPath);
  String[] result=(String[])list.toArray(new String[list.size()]);
  Arrays.sort(result);
  String[] expected=expectedResultStr.split("String_Node_Str");
  Arrays.sort(expected);
  Assert.assertEquals("String_Node_Str",expected.length,result.length);
  Assert.assertArrayEquals(expected,result);
}

Fixed version (ground truth):
public void compareResultsByLinesInMemory(String expectedResultStr,String resultPath) throws Exception {
  ArrayList<String> list=new ArrayList<String>();
  readAllResultLines(list,resultPath,false);
  String[] result=(String[])list.toArray(new String[list.size()]);
  Arrays.sort(result);
  String[] expected=expectedResultStr.split("String_Node_Str");
  Arrays.sort(expected);
  Assert.assertEquals("String_Node_Str",expected.length,result.length);
  Assert.assertArrayEquals(expected,result);
}
Program: 55102
Project: 55102
Buggy source:
public void readAllResultLines(List<String> target,String resultPath) throws IOException {
  for (  BufferedReader reader : getResultReader(resultPath)) {
    String s=null;
    while ((s=reader.readLine()) != null) {
      target.add(s);
    }
  }
}

Fixed version (ground truth):
public void readAllResultLines(List<String> target,String resultPath,boolean inOrderOfFiles) throws IOException {
  for (  BufferedReader reader : getResultReader(resultPath,inOrderOfFiles)) {
    String s=null;
    while ((s=reader.readLine()) != null) {
      target.add(s);
    }
  }
}