nus-yam/ex-repair huggingface dataset:
Program: 75728
Project: 75728
Buggy source:
/** 
 * Return a new array that is formed by applying an instance of a FloatBinaryOperation to the two matrices, element by element, using the elements of the first matrix as the left operands and the elements of the second matrix as the right operands. (op.operate(matrix1[i][j], matrix2[i][j])).  If the matrices are not the same size, throw an IllegalArgumentException.
 */
public static final float[][] applyBinaryOperation(FloatBinaryOperation op,final float[][] matrix1,final float[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  float[][] returnValue=new float[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; i < columns; j++) {
      returnValue[i][j]=op.operate(matrix1[i][j],matrix2[i][j]);
    }
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is formed by applying an instance of a FloatBinaryOperation to the two matrices, element by element, using the elements of the first matrix as the left operands and the elements of the second matrix as the right operands. (op.operate(matrix1[i][j], matrix2[i][j])).  If the matrices are not the same size, throw an IllegalArgumentException.
 */
public static final float[][] applyBinaryOperation(FloatBinaryOperation op,final float[][] matrix1,final float[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  float[][] returnValue=new float[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; j < columns; j++) {
      returnValue[i][j]=op.operate(matrix1[i][j],matrix2[i][j]);
    }
  }
  return returnValue;
}
Program: 75729
Project: 75729
Buggy source:
/** 
 * Return a new array that formed by the bitwise complement of each element in the input matrix (~matrix[i][j]).
 */
public static final int[][] bitwiseComplement(final int[][] matrix){
  int rows=_rows(matrix);
  int columns=_columns(matrix);
  int[][] returnValue=new int[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; i < columns; j++) {
      returnValue[i][j]=~matrix[i][j];
    }
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that formed by the bitwise complement of each element in the input matrix (~matrix[i][j]).
 */
public static final int[][] bitwiseComplement(final int[][] matrix){
  int rows=_rows(matrix);
  int columns=_columns(matrix);
  int[][] returnValue=new int[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; j < columns; j++) {
      returnValue[i][j]=~matrix[i][j];
    }
  }
  return returnValue;
}
Program: 75730
Project: 75730
Buggy source:
/** 
 * Return a new array that is the element-by-element bitwise XOR of the two input matrices (matrix1[i][j] & matrix2[i][j]).  If the two matrices are not the same size, throw an IllegalArgumentException.
 */
public static final int[][] bitwiseXor(final int[][] matrix1,final int[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  int[][] returnValue=new int[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; i < columns; j++) {
      returnValue[i][j]=matrix1[i][j] ^ matrix2[i][j];
    }
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is the element-by-element bitwise XOR of the two input matrices (matrix1[i][j] & matrix2[i][j]).  If the two matrices are not the same size, throw an IllegalArgumentException.
 */
public static final int[][] bitwiseXor(final int[][] matrix1,final int[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  int[][] returnValue=new int[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; j < columns; j++) {
      returnValue[i][j]=matrix1[i][j] ^ matrix2[i][j];
    }
  }
  return returnValue;
}
Program: 75731
Project: 75731
Buggy source:
/** 
 * Return a new array that is formed by applying an instance of a IntegerUnaryOperation to each element in the input matrix (op.operate(matrix[i][j])).
 */
public static final int[][] applyUnaryOperation(final IntegerUnaryOperation op,final int[][] matrix){
  int rows=_rows(matrix);
  int columns=_columns(matrix);
  int[][] returnValue=new int[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; i < columns; j++) {
      returnValue[i][j]=op.operate(matrix[i][j]);
    }
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is formed by applying an instance of a IntegerUnaryOperation to each element in the input matrix (op.operate(matrix[i][j])).
 */
public static final int[][] applyUnaryOperation(final IntegerUnaryOperation op,final int[][] matrix){
  int rows=_rows(matrix);
  int columns=_columns(matrix);
  int[][] returnValue=new int[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; j < columns; j++) {
      returnValue[i][j]=op.operate(matrix[i][j]);
    }
  }
  return returnValue;
}
Program: 75732
Project: 75732
Buggy source:
/** 
 * Return a new array that is the element-by-element bitwise AND of the two input matrices (matrix1[i][j] & matrix2[i][j]).  If the two matrices are not the same size, throw an IllegalArgumentException.
 */
public static final int[][] bitwiseAnd(final int[][] matrix1,final int[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  int[][] returnValue=new int[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; i < columns; j++) {
      returnValue[i][j]=matrix1[i][j] & matrix2[i][j];
    }
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is the element-by-element bitwise AND of the two input matrices (matrix1[i][j] & matrix2[i][j]).  If the two matrices are not the same size, throw an IllegalArgumentException.
 */
public static final int[][] bitwiseAnd(final int[][] matrix1,final int[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  int[][] returnValue=new int[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; j < columns; j++) {
      returnValue[i][j]=matrix1[i][j] & matrix2[i][j];
    }
  }
  return returnValue;
}
Program: 75733
Project: 75733
Buggy source:
/** 
 * Return a new array that is formed by applying an instance of a IntegerBinaryOperation to the two matrices, element by element, using the elements of the first matrix as the left operands and the elements of the second matrix as the right operands.  (op.operate(matrix1[i][j], matrix2[i][j])).  If the matrices are not the same size, throw an IllegalArgumentException.
 */
public static final int[][] applyBinaryOperation(IntegerBinaryOperation op,final int[][] matrix1,final int[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  int[][] returnValue=new int[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; i < columns; j++) {
      returnValue[i][j]=op.operate(matrix1[i][j],matrix2[i][j]);
    }
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is formed by applying an instance of a IntegerBinaryOperation to the two matrices, element by element, using the elements of the first matrix as the left operands and the elements of the second matrix as the right operands.  (op.operate(matrix1[i][j], matrix2[i][j])).  If the matrices are not the same size, throw an IllegalArgumentException.
 */
public static final int[][] applyBinaryOperation(IntegerBinaryOperation op,final int[][] matrix1,final int[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  int[][] returnValue=new int[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; j < columns; j++) {
      returnValue[i][j]=op.operate(matrix1[i][j],matrix2[i][j]);
    }
  }
  return returnValue;
}
Program: 75734
Project: 75734
Buggy source:
/** 
 * Return a new array that is the element-by-element bitwise OR of the two input matrices (matrix1[i][j] | matrix2[i][j]).  If the two matrices are not the same size, throw an IllegalArgumentException.
 */
public static final int[][] bitwiseOr(final int[][] matrix1,final int[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  int[][] returnValue=new int[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; i < columns; j++) {
      returnValue[i][j]=matrix1[i][j] | matrix2[i][j];
    }
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is the element-by-element bitwise OR of the two input matrices (matrix1[i][j] | matrix2[i][j]).  If the two matrices are not the same size, throw an IllegalArgumentException.
 */
public static final int[][] bitwiseOr(final int[][] matrix1,final int[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  int[][] returnValue=new int[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; j < columns; j++) {
      returnValue[i][j]=matrix1[i][j] | matrix2[i][j];
    }
  }
  return returnValue;
}
Program: 75735
Project: 75735
Buggy source:
/** 
 * Return a new array that formed by the bitwise complement of each element in the input matrix (~matrix[i][j]).
 */
public static final long[][] bitwiseComplement(final long[][] matrix){
  int rows=_rows(matrix);
  int columns=_columns(matrix);
  long[][] returnValue=new long[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; i < columns; j++) {
      returnValue[i][j]=~matrix[i][j];
    }
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that formed by the bitwise complement of each element in the input matrix (~matrix[i][j]).
 */
public static final long[][] bitwiseComplement(final long[][] matrix){
  int rows=_rows(matrix);
  int columns=_columns(matrix);
  long[][] returnValue=new long[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; j < columns; j++) {
      returnValue[i][j]=~matrix[i][j];
    }
  }
  return returnValue;
}
Program: 75736
Project: 75736
Buggy source:
/** 
 * Return a new array that is the element-by-element bitwise XOR of the two input matrices (matrix1[i][j] & matrix2[i][j]).  If the two matrices are not the same size, throw an IllegalArgumentException.
 */
public static final long[][] bitwiseXor(final long[][] matrix1,final long[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  long[][] returnValue=new long[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; i < columns; j++) {
      returnValue[i][j]=matrix1[i][j] ^ matrix2[i][j];
    }
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is the element-by-element bitwise XOR of the two input matrices (matrix1[i][j] & matrix2[i][j]).  If the two matrices are not the same size, throw an IllegalArgumentException.
 */
public static final long[][] bitwiseXor(final long[][] matrix1,final long[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  long[][] returnValue=new long[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; j < columns; j++) {
      returnValue[i][j]=matrix1[i][j] ^ matrix2[i][j];
    }
  }
  return returnValue;
}
Program: 75737
Project: 75737
Buggy source:
/** 
 * Return a new array that is formed by applying an instance of a LongUnaryOperation to each element in the input matrix (op.operate(matrix[i][j])).
 */
public static final long[][] applyUnaryOperation(final LongUnaryOperation op,final long[][] matrix){
  int rows=_rows(matrix);
  int columns=_columns(matrix);
  long[][] returnValue=new long[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; i < columns; j++) {
      returnValue[i][j]=op.operate(matrix[i][j]);
    }
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is formed by applying an instance of a LongUnaryOperation to each element in the input matrix (op.operate(matrix[i][j])).
 */
public static final long[][] applyUnaryOperation(final LongUnaryOperation op,final long[][] matrix){
  int rows=_rows(matrix);
  int columns=_columns(matrix);
  long[][] returnValue=new long[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; j < columns; j++) {
      returnValue[i][j]=op.operate(matrix[i][j]);
    }
  }
  return returnValue;
}
Program: 75738
Project: 75738
Buggy source:
/** 
 * Return a new array that is the element-by-element bitwise AND of the two input matrices (matrix1[i][j] & matrix2[i][j]).  If the two matrices are not the same size, throw an IllegalArgumentException.
 */
public static final long[][] bitwiseAnd(final long[][] matrix1,final long[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  long[][] returnValue=new long[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; i < columns; j++) {
      returnValue[i][j]=matrix1[i][j] & matrix2[i][j];
    }
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is the element-by-element bitwise AND of the two input matrices (matrix1[i][j] & matrix2[i][j]).  If the two matrices are not the same size, throw an IllegalArgumentException.
 */
public static final long[][] bitwiseAnd(final long[][] matrix1,final long[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  long[][] returnValue=new long[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; j < columns; j++) {
      returnValue[i][j]=matrix1[i][j] & matrix2[i][j];
    }
  }
  return returnValue;
}
Program: 75739
Project: 75739
Buggy source:
/** 
 * Return a new array that is formed by applying an instance of a LongBinaryOperation to the two matrices, element by element, using the elements of the first matrix as the left operands and the elements of the second matrix as the right operands. (op.operate(matrix1[i][j], matrix2[i][j])).  If the matrices are not the same size, throw an IllegalArgumentException.
 */
public static final long[][] applyBinaryOperation(LongBinaryOperation op,final long[][] matrix1,final long[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  long[][] returnValue=new long[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; i < columns; j++) {
      returnValue[i][j]=op.operate(matrix1[i][j],matrix2[i][j]);
    }
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is formed by applying an instance of a LongBinaryOperation to the two matrices, element by element, using the elements of the first matrix as the left operands and the elements of the second matrix as the right operands. (op.operate(matrix1[i][j], matrix2[i][j])).  If the matrices are not the same size, throw an IllegalArgumentException.
 */
public static final long[][] applyBinaryOperation(LongBinaryOperation op,final long[][] matrix1,final long[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  long[][] returnValue=new long[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; j < columns; j++) {
      returnValue[i][j]=op.operate(matrix1[i][j],matrix2[i][j]);
    }
  }
  return returnValue;
}
Program: 75740
Project: 75740
Buggy source:
/** 
 * Return a new array that is the element-by-element bitwise OR of the two input matrices (matrix1[i][j] | matrix2[i][j]).  If the two matrices are not the same size, throw an IllegalArgumentException.
 */
public static final long[][] bitwiseOr(final long[][] matrix1,final long[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  long[][] returnValue=new long[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; i < columns; j++) {
      returnValue[i][j]=matrix1[i][j] | matrix2[i][j];
    }
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is the element-by-element bitwise OR of the two input matrices (matrix1[i][j] | matrix2[i][j]).  If the two matrices are not the same size, throw an IllegalArgumentException.
 */
public static final long[][] bitwiseOr(final long[][] matrix1,final long[][] matrix2){
  int rows=_rows(matrix1);
  int columns=_columns(matrix1);
  _checkSameDimension("String_Node_Str",matrix1,matrix2);
  long[][] returnValue=new long[rows][columns];
  for (int i=0; i < rows; i++) {
    for (int j=0; j < columns; j++) {
      returnValue[i][j]=matrix1[i][j] | matrix2[i][j];
    }
  }
  return returnValue;
}
Program: 75743
Project: 75743
Buggy source:
/** 
 * Get the BigDecimal which is the 2^exponent. If the value is already calculated, return this cached value, else calculate the value.
 * @param number the exponent.
 * @return the BigDecimal representing 2^exponent.
 */
private BigDecimal _getTwoRaisedTo(int number){
  if (number <= 128 || number >= 0) {
    return _twoRaisedTo[number];
  }
 else {
    BigInteger two=_two.toBigInteger();
    return new BigDecimal(two.pow(number));
  }
}

Fixed version (ground truth):
/** 
 * Get the BigDecimal which is the 2^exponent. If the value is already calculated, return this cached value, else calculate the value.
 * @param number the exponent.
 * @return the BigDecimal representing 2^exponent.
 */
private BigDecimal _getTwoRaisedTo(int number){
  if (number <= _twoRaisedTo.length && number >= 0) {
    return _twoRaisedTo[number];
  }
 else {
    BigInteger two=_two.toBigInteger();
    return new BigDecimal(two.pow(number));
  }
}
Program: 75745
Project: 75745
Buggy source:
public static void create(HashMutableDirectedGraph operatorGraph,String outDir,String packageName,String className) throws IOException {
  String fileName=outDir + "String_Node_Str" + className+ "String_Node_Str";
  System.out.println("String_Node_Str" + fileName);
  File outputFile=new File(fileName);
  FileWriter writer=new FileWriter(outputFile);
  write_header(writer,packageName,className);
  for (Iterator nodes=operatorGraph.getNodes().iterator(); nodes.hasNext(); ) {
    Object node=nodes.next();
    writer.write("String_Node_Str" + _getWireName(node) + "String_Node_Str");
  }
  for (Iterator nodes=operatorGraph.getNodes().iterator(); nodes.hasNext(); ) {
    Object node=nodes.next();
    if (node.toString().startsWith("String_Node_Str")) {
      Object pred=operatorGraph.getPredsOf(node).iterator().next();
      write_reg(writer,pred,node);
    }
 else     if (node.toString().startsWith("String_Node_Str")) {
      Iterator preds=operatorGraph.getPredsOf(node).iterator();
      Object in1=preds.next();
      Object in2=preds.next();
      write_add(writer,in1,in2,node);
    }
 else     if (node.toString().startsWith("String_Node_Str")) {
      Object pred=operatorGraph.getPredsOf(node).iterator().next();
      write_buf(writer,pred);
    }
 else {
      try {
        write_const(writer,node.toString(),Integer.parseInt(node.toString()));
      }
 catch (      Exception ex) {
      }
    }
  }
  write_footer(writer);
  writer.close();
}

Fixed version (ground truth):
public static void create(HashMutableDirectedGraph operatorGraph,String outDir,String packageName,String className) throws IOException {
  String fileName=outDir + "String_Node_Str" + className+ "String_Node_Str";
  System.out.println("String_Node_Str" + fileName);
  File outputFile=new File(fileName);
  FileWriter writer=new FileWriter(outputFile);
  write_header(writer,packageName,className);
  for (Iterator nodes=operatorGraph.getNodes().iterator(); nodes.hasNext(); ) {
    Object node=nodes.next();
    writer.write("String_Node_Str" + _getWireName(node) + "String_Node_Str");
  }
  for (Iterator nodes=operatorGraph.getNodes().iterator(); nodes.hasNext(); ) {
    Object node=nodes.next();
    if (node.toString().startsWith("String_Node_Str")) {
      Object pred=operatorGraph.getPredsOf(node).iterator().next();
      write_reg(writer,pred,node);
    }
 else     if (node.toString().startsWith("String_Node_Str")) {
      Object pred=operatorGraph.getPredsOf(node).iterator().next();
      write_fir(writer,pred,node);
    }
 else     if (node.toString().startsWith("String_Node_Str")) {
      Iterator preds=operatorGraph.getPredsOf(node).iterator();
      Object in1=preds.next();
      Object in2=preds.next();
      write_add(writer,in1,in2,node);
    }
 else     if (node.toString().startsWith("String_Node_Str")) {
      Object pred=operatorGraph.getPredsOf(node).iterator().next();
      write_buf(writer,pred);
    }
 else {
      try {
        write_const(writer,node.toString(),Integer.parseInt(node.toString()));
      }
 catch (      Exception ex) {
      }
    }
  }
  write_footer(writer);
  writer.close();
}
Program: 75746
Project: 75746
Buggy source:
/** 
 * Constructs an Exception with a detail message that includes the name of the first argument.
 * @param obj The object.
 * @param detail The message.
 */
public IllegalOutputException(Nameable obj,String detail){
  super(obj,detail);
}

Fixed version (ground truth):
/** 
 * Constructs an Exception with a detail message that includes the name of the first argument.
 * @param object The object.
 * @param detail The message.
 */
public IllegalOutputException(Nameable object,String detail){
  super(object,detail);
}
Program: 75747
Project: 75747
Buggy source:
/** 
 * Initialize the firing of the director by resetting state variables and obtaining the current time from an outside director if one exists.
 */
private void _initFiring() throws IllegalActionException {
  _actorsAllowedToFire=null;
  _actorsFired=null;
  _cachedAllInputsKnown=null;
  _cachedAllOutputsKnown=null;
  _lastNumOfActorsAllowedToFire=-1;
  _lastNumOfKnownReceivers=-1;
  CompositeActor container=(CompositeActor)getContainer();
  Director outsideDirector=container.getExecutiveDirector();
  if (outsideDirector != null) {
    setCurrentTime(outsideDirector.getCurrentTime());
  }
}

Fixed version (ground truth):
/** 
 * Initialize the firing of the director by resetting state variables and obtaining the current time from an outside director if one exists.
 */
private void _initFiring() throws IllegalActionException {
  _actorsAllowedToFire=null;
  _actorsFired=null;
  _cachedAllInputsKnown=null;
  _cachedAllOutputsKnown=null;
  _lastNumberOfActorsAllowedToFire=-1;
  _lastNumberOfKnownReceivers=-1;
  CompositeActor container=(CompositeActor)getContainer();
  Director outsideDirector=container.getExecutiveDirector();
  if (outsideDirector != null) {
    setCurrentTime(outsideDirector.getCurrentTime());
  }
}
Program: 75748
Project: 75748
Buggy source:
/** 
 * Reset all receivers to allow a new firing of the director.
 */
private void _resetAllReceivers(){
  _debug("String_Node_Str");
  _currentNumOfKnownReceivers=0;
  Iterator receiverIterator=_receivers.iterator();
  while (receiverIterator.hasNext()) {
    ((SRReceiver)receiverIterator.next()).reset();
  }
}

Fixed version (ground truth):
/** 
 * Reset all receivers to allow a new firing of the director.
 */
private void _resetAllReceivers(){
  _debug("String_Node_Str");
  _currentNumberOfKnownReceivers=0;
  Iterator receiverIterator=_receivers.iterator();
  while (receiverIterator.hasNext()) {
    ((SRReceiver)receiverIterator.next()).reset();
  }
}
Program: 75749
Project: 75749
Buggy source:
/** 
 * Return true if this iteration has converged.  The iteration has converged if both the number of known receivers has converged and the number of actors to fire has converged.
 */
private boolean _hasIterationConverged(){
  int previousNumOfActorsAllowedToFire=_lastNumOfActorsAllowedToFire;
  int previousNumOfKnownReceivers=_lastNumOfKnownReceivers;
  int currentNumOfActorsAllowedToFire=_numOfActorsAllowedToFire();
  int currentNumOfKnownReceivers=_currentNumOfKnownReceivers;
  if (_debugging) {
    _debug("String_Node_Str",String.valueOf(previousNumOfActorsAllowedToFire));
    _debug("String_Node_Str",String.valueOf(currentNumOfActorsAllowedToFire));
    _debug("String_Node_Str",String.valueOf(previousNumOfKnownReceivers));
    _debug("String_Node_Str",String.valueOf(currentNumOfKnownReceivers));
  }
  _lastNumOfActorsAllowedToFire=currentNumOfActorsAllowedToFire;
  _lastNumOfKnownReceivers=_currentNumOfKnownReceivers;
  if (previousNumOfKnownReceivers == -1) {
    return false;
  }
  if (previousNumOfActorsAllowedToFire != currentNumOfActorsAllowedToFire) {
    return false;
  }
  if (previousNumOfKnownReceivers != currentNumOfKnownReceivers) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Return true if this iteration has converged.  The iteration has converged if both the number of known receivers has converged and the number of actors to fire has converged.
 */
private boolean _hasIterationConverged(){
  int previousNumberOfActorsAllowedToFire=_lastNumberOfActorsAllowedToFire;
  int previousNumberOfKnownReceivers=_lastNumberOfKnownReceivers;
  int currentNumberOfActorsAllowedToFire=_NumberOfActorsAllowedToFire();
  int currentNumberOfKnownReceivers=_currentNumberOfKnownReceivers;
  if (_debugging) {
    _debug("String_Node_Str",String.valueOf(previousNumberOfActorsAllowedToFire));
    _debug("String_Node_Str",String.valueOf(currentNumberOfActorsAllowedToFire));
    _debug("String_Node_Str",String.valueOf(previousNumberOfKnownReceivers));
    _debug("String_Node_Str",String.valueOf(currentNumberOfKnownReceivers));
  }
  _lastNumberOfActorsAllowedToFire=currentNumberOfActorsAllowedToFire;
  _lastNumberOfKnownReceivers=_currentNumberOfKnownReceivers;
  if (previousNumberOfKnownReceivers == -1) {
    return false;
  }
  if (previousNumberOfActorsAllowedToFire != currentNumberOfActorsAllowedToFire) {
    return false;
  }
  if (previousNumberOfKnownReceivers != currentNumberOfKnownReceivers) {
    return false;
  }
  return true;
}
Program: 75750
Project: 75750
Buggy source:
/** 
 * React to the change in receiver status by incrementing the count of known receivers.
 */
public void receiverChanged(Receiver receiver){
  _currentNumOfKnownReceivers++;
}

Fixed version (ground truth):
/** 
 * React to the change in receiver status by incrementing the count of known receivers.
 */
public void receiverChanged(Receiver receiver){
  _currentNumberOfKnownReceivers++;
}
Program: 75751
Project: 75751
Buggy source:
/** 
 * Constructs an Exception with a detail message that includes the name of the first argument.
 * @param obj The object.
 * @param detail The message.
 */
public UnknownTokenException(Nameable obj,String detail){
  super(obj,detail);
}

Fixed version (ground truth):
/** 
 * Constructs an Exception with a detail message that includes the name of the first argument.
 * @param object The object.
 * @param detail The message.
 */
public UnknownTokenException(Nameable object,String detail){
  super(object,detail);
}
Program: 75752
Project: 75752
Buggy source:
private void _updateDestinations() throws IllegalActionException {
  try {
    workspace().getReadAccess();
    FSMActor fsm=(FSMActor)getContainer().getContainer();
    if (_destinationNames != null) {
      _destinations=new LinkedList();
      Iterator destinationNames=_destinationNames.iterator();
      while (destinationNames.hasNext()) {
        String destinationName=(String)destinationNames.next();
        NamedObj destination=_getDestination(destinationName);
        _destinations.add(destination);
      }
    }
    if (_variables != null) {
      Iterator vars=_variables.iterator();
      _variables=new LinkedList();
      while (vars.hasNext()) {
        Variable var=(Variable)vars.next();
        Transition container=(Transition)getContainer();
        _variables.add(container.getAttribute(var.getName()));
      }
    }
    _destinationsListVersion=workspace().getVersion();
  }
  finally {
    workspace().doneReading();
  }
}

Fixed version (ground truth):
private void _updateDestinations() throws IllegalActionException {
  try {
    workspace().getReadAccess();
    FSMActor fsm=(FSMActor)getContainer().getContainer();
    if (_destinationNames != null) {
      _destinations=new LinkedList();
      Iterator destinationNames=_destinationNames.iterator();
      while (destinationNames.hasNext()) {
        String destinationName=(String)destinationNames.next();
        NamedObj destination=_getDestination(destinationName);
        _destinations.add(destination);
      }
    }
    if (_variables != null) {
      Iterator variables=_variables.iterator();
      _variables=new LinkedList();
      while (variables.hasNext()) {
        Variable variable=(Variable)variables.next();
        Transition container=(Transition)getContainer();
        _variables.add(container.getAttribute(variable.getName()));
      }
    }
    _destinationsListVersion=workspace().getVersion();
  }
  finally {
    workspace().doneReading();
  }
}
Program: 75756
Project: 75756
Buggy source:
/** 
 * Wrapup execution of this actor.  Interrupt the thread that was created to read from the socket and close the socket.
 * @exception IllegalActionException If the thread or the socketwas not created.
 */
public void wrapup() throws IllegalActionException {
  if (_listenerThread != null) {
    _listenerThread.interrupt();
    _listenerThread=null;
  }
 else {
  }
  if (socket != null) {
    socket.close();
    socket=null;
  }
 else {
  }
}

Fixed version (ground truth):
/** 
 * Wrapup execution of this actor.  Interrupt the thread that was created to read from the socket and close the socket.
 * @exception IllegalActionException If the thread or the socketwas not created.
 */
public void wrapup() throws IllegalActionException {
  if (_listenerThread != null) {
    _listenerThread.interrupt();
    _listenerThread=null;
  }
 else {
    if (false)     System.out.println("String_Node_Str");
  }
  if (socket != null) {
    socket.close();
    socket=null;
  }
 else {
    if (false)     System.out.println("String_Node_Str");
  }
}
Program: 75757
Project: 75757
Buggy source:
/** 
 * Preinitialize this actor.  Create a new datagram socket and initialize the thread that reads from the socket.  The thread will stay alive until the socket is closed.
 * @exception IllegalActionException If the<i>localSocketNumber</i> parameter has a value of -1, or a socket could not be created.
 * @exception NameDuplicationException Not throw in this base class.
 */
public void preinitialize() throws IllegalActionException {
  super.preinitialize();
  _overwrite=((BooleanToken)(overwrite.getToken())).booleanValue();
  Variable var=(Variable)getAttribute("String_Node_Str");
  if (var == null) {
    try {
      var=new Variable(this,"String_Node_Str");
    }
 catch (    NameDuplicationException ex) {
      throw new IllegalActionException("String_Node_Str");
    }
  }
  _evalVar=var;
  int portNumber=((IntToken)(localSocketNumber.getToken())).intValue();
  if (portNumber == -1) {
    if (_debugging)     _debug("String_Node_Str");
    throw new IllegalActionException(this,"String_Node_Str");
  }
  try {
    if (_debugging) {
      _debug("String_Node_Str" + portNumber);
    }
    socket=new DatagramSocket(portNumber);
    if (_debugging) {
      _debug("String_Node_Str");
    }
  }
 catch (  SocketException ex) {
    throw new IllegalActionException(this,"String_Node_Str" + ex);
  }
  _listenerThread=new ListenerThread();
  _listenerThread.start();
  if (_debugging)   _debug("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Preinitialize this actor.  Create a new datagram socket and initialize the thread that reads from the socket.  The thread will stay alive until the socket is closed.
 * @exception IllegalActionException If the<i>localSocketNumber</i> parameter has a value of -1, or a socket could not be created.
 * @exception NameDuplicationException Not throw in this base class.
 */
public void preinitialize() throws IllegalActionException {
  super.preinitialize();
  _packetsAlreadyAwaitingFire=0;
  _overwrite=((BooleanToken)(overwrite.getToken())).booleanValue();
  Variable var=(Variable)getAttribute("String_Node_Str");
  if (var == null) {
    try {
      var=new Variable(this,"String_Node_Str");
    }
 catch (    NameDuplicationException ex) {
      throw new IllegalActionException("String_Node_Str");
    }
  }
  _evalVar=var;
  int portNumber=((IntToken)(localSocketNumber.getToken())).intValue();
  if (portNumber == -1) {
    if (false && _debugging)     _debug("String_Node_Str");
    throw new IllegalActionException(this,"String_Node_Str");
  }
  try {
    if (false && _debugging) {
      _debug("String_Node_Str" + portNumber);
    }
    socket=new DatagramSocket(portNumber);
    if (false && _debugging) {
      _debug("String_Node_Str");
    }
  }
 catch (  SocketException ex) {
    throw new IllegalActionException(this,"String_Node_Str" + ex);
  }
  _listenerThread=new ListenerThread();
  _listenerThread.start();
  if (_debugging)   _debug("String_Node_Str");
}
Program: 75758
Project: 75758
Buggy source:
/** 
 * React to the change of the given acttribute. If the parameter changed is <i>localSocketNumber</i> and the model is running (i.e. socket != null), then replace the current socket with a socket on the new number.  This involves interrupting the thread reading from the socket, creating a new socket, and restarting the thread.  This is done even if the port number has not actually changed.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == overwrite) {
    _overwrite=((BooleanToken)(overwrite.getToken())).booleanValue();
  }
 else   if (attribute == localSocketNumber) {
synchronized (this) {
      if (socket != null) {
        _listenerThread.interrupt();
        if (_debugging)         _debug("String_Node_Str" + socket.getLocalPort());
        socket.close();
        int portNum=((IntToken)(localSocketNumber.getToken())).intValue();
        if (_debugging)         _debug("String_Node_Str" + portNum);
        try {
          if (_debugging)           _debug("String_Node_Str" + portNum);
          socket=new DatagramSocket(portNum);
          if (_debugging)           _debug("String_Node_Str");
        }
 catch (        SocketException ex) {
          throw new InternalErrorException(KernelException.stackTraceToString(ex));
        }
        _listenerThread.start();
      }
    }
  }
 else {
    super.attributeChanged(attribute);
  }
}

Fixed version (ground truth):
/** 
 * React to the change of the given acttribute. If the parameter changed is <i>localSocketNumber</i> and the model is running (i.e. socket != null), then replace the current socket with a socket on the new number.  This involves interrupting the thread reading from the socket, creating a new socket, and restarting the thread.  This is done even if the port number has not actually changed.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == overwrite) {
    _overwrite=((BooleanToken)(overwrite.getToken())).booleanValue();
  }
 else   if (attribute == localSocketNumber) {
synchronized (this) {
      if (socket != null) {
        _listenerThread.interrupt();
        if (_debugging)         _debug("String_Node_Str" + socket.getLocalPort());
        socket.close();
        int portNum=((IntToken)(localSocketNumber.getToken())).intValue();
        if (false && _debugging)         _debug("String_Node_Str" + portNum);
        try {
          if (_debugging)           _debug("String_Node_Str" + portNum);
          socket=new DatagramSocket(portNum);
          if (false && _debugging)           _debug("String_Node_Str");
        }
 catch (        SocketException ex) {
          throw new InternalErrorException(KernelException.stackTraceToString(ex));
        }
        _listenerThread.start();
      }
    }
  }
 else {
    super.attributeChanged(attribute);
  }
}
Program: 75760
Project: 75760
Buggy source:
public void run(){
  while (true) {
    if (this.interrupted()) {
      return;
    }
    try {
      if (_debugging)       _debug("String_Node_Str");
      _receivePacket.setLength(440);
      socket.receive(_receivePacket);
      if (_debugging)       _debug("String_Node_Str");
    }
 catch (    IOException ex) {
      if (_debugging)       _debug("String_Node_Str");
      return;
    }
synchronized (_syncFireAndThread) {
      if (packetsAlreadyAwaitingFire != 0 && !_overwrite) {
        try {
          _syncFireAndThread.wait();
        }
 catch (        InterruptedException ex) {
        }
      }
      DatagramPacket tmp=_broadcastPacket;
      _broadcastPacket=_receivePacket;
      _receivePacket=tmp;
      if (packetsAlreadyAwaitingFire == 0) {
        packetsAlreadyAwaitingFire++;
        try {
          getDirector().fireAtCurrentTime(DatagramReceiver.this);
        }
 catch (        IllegalActionException ex) {
          if (_debugging)           _debug("String_Node_Str");
        }
      }
      _syncFireAndThread.notifyAll();
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (true) {
    if (this.interrupted()) {
      return;
    }
    try {
      if (false && _debugging)       _debug("String_Node_Str");
      _receivePacket.setLength(440);
      if (false)       System.out.println(this + "String_Node_Str");
      socket.receive(_receivePacket);
      if (false)       System.out.println(this + "String_Node_Str");
      if (false && _debugging)       _debug("String_Node_Str");
    }
 catch (    IOException ex) {
      if (false)       System.out.println(this + "String_Node_Str");
      if (false && _debugging)       _debug("String_Node_Str" + "String_Node_Str");
      return;
    }
synchronized (_syncFireAndThread) {
      if (false)       System.out.println(this + "String_Node_Str");
      if (_packetsAlreadyAwaitingFire != 0 && !_overwrite) {
        try {
          _syncFireAndThread.wait();
        }
 catch (        InterruptedException ex) {
          if (false)           System.out.println(this + "String_Node_Str");
        }
      }
      DatagramPacket tmp=_broadcastPacket;
      _broadcastPacket=_receivePacket;
      _receivePacket=tmp;
      if (_packetsAlreadyAwaitingFire == 0) {
        _packetsAlreadyAwaitingFire++;
        try {
          if (false)           System.out.println(this + "String_Node_Str");
          getDirector().fireAtCurrentTime(DatagramReceiver.this);
          if (false)           System.out.println(this + "String_Node_Str");
        }
 catch (        IllegalActionException ex) {
          if (false)           System.out.println(this + "String_Node_Str");
          if (false && _debugging)           _debug("String_Node_Str");
        }
      }
      _syncFireAndThread.notifyAll();
      if (false)       System.out.println(this + "String_Node_Str");
    }
  }
}
Program: 75761
Project: 75761
Buggy source:
/** 
 * Incremement the index number.
 * @exception IllegalActionException If there is no director.
 */
public boolean postfire() throws IllegalActionException {
  _index++;
  return super.postfire();
}

Fixed version (ground truth):
/** 
 * Increment the index number.
 * @exception IllegalActionException If there is no director.
 */
public boolean postfire() throws IllegalActionException {
  _index++;
  return super.postfire();
}
Program: 75762
Project: 75762
Buggy source:
/** 
 * Remove the listeners we have created when the frame closes. Remove our panner-updating listener from the entity. Also remove the listeners our graph model has created.
 */
protected boolean _close(){
  getModel().removeChangeListener(this);
  GraphModel gm=_jgraph.getGraphPane().getGraphModel();
  if (gm instanceof AbstractBasicGraphModel) {
    ((AbstractBasicGraphModel)gm).removeListeners();
  }
  return super._close();
}

Fixed version (ground truth):
/** 
 * Override the base class to remove the listeners we have created when the frame closes.  Specifically, remove our panner-updating listener from the entity. Also remove the listeners our graph model has created.
 * @return True if the close completes, and false otherwise.
 */
protected boolean _close(){
  boolean result=super._close();
  if (result) {
    getModel().removeChangeListener(this);
    GraphModel gm=_jgraph.getGraphPane().getGraphModel();
    if (gm instanceof AbstractBasicGraphModel) {
      ((AbstractBasicGraphModel)gm).removeListeners();
    }
  }
  return result;
}
Program: 75765
Project: 75765
Buggy source:
/** 
 * Create receivers and input variables for the input ports of this actor, and validate attributes. Set current state to the initial state. Throw an exception if this actor does not contain a state with name specified by the <i>initialStateName</i> attribute.
 * @exception IllegalActionException If this actor does not contain astate with name specified by the <i>initialStateName</i> attribute.
 */
public void preinitialize() throws IllegalActionException {
  _createReceivers();
  Iterator inputPorts=inputPortList().iterator();
  while (inputPorts.hasNext()) {
    TypedIOPort inport=(TypedIOPort)inputPorts.next();
    _removeInputVariables(inport);
  }
  Iterator attributes=attributeList(Settable.class).iterator();
  while (attributes.hasNext()) {
    Settable attribute=(Settable)attributes.next();
    attribute.validate();
  }
  _createInputVariables();
  _gotoInitialState();
}

Fixed version (ground truth):
/** 
 * Create receivers and input variables for the input ports of this actor, and validate attributes. Set current state to the initial state. Throw an exception if this actor does not contain a state with name specified by the <i>initialStateName</i> attribute.
 * @exception IllegalActionException If this actor does not contain astate with name specified by the <i>initialStateName</i> attribute.
 */
public void preinitialize() throws IllegalActionException {
  _createReceivers();
  Iterator inputPorts=inputPortList().iterator();
  while (inputPorts.hasNext()) {
    TypedIOPort inport=(TypedIOPort)inputPorts.next();
    _removeInputVariables(inport);
  }
  _createInputVariables();
  Iterator attributes=attributeList(Settable.class).iterator();
  while (attributes.hasNext()) {
    Settable attribute=(Settable)attributes.next();
    attribute.validate();
  }
  _gotoInitialState();
}
Program: 75766
Project: 75766
Buggy source:
protected void _reinitialize() throws IllegalActionException {
  if (_decPhase >= _dec) {
    throw new IllegalActionException(this,"String_Node_Str" + _decPhase + "String_Node_Str"+ _dec+ "String_Node_Str");
  }
  _phaseLength=(int)(_taps.length / _interp);
  if ((_taps.length % _interp) != 0)   _phaseLength++;
  if (_data == null || _data.length != _phaseLength) {
    _data=new Token[_phaseLength];
    for (int i=0; i < _phaseLength; i++) {
      _data[i]=_zero;
    }
    _mostRecent=_phaseLength;
  }
  _reinitializeNeeded=false;
}

Fixed version (ground truth):
protected void _reinitialize() throws IllegalActionException {
  if (_decPhase >= _dec) {
    throw new IllegalActionException(this,"String_Node_Str" + _decPhase + "String_Node_Str"+ _dec+ "String_Node_Str");
  }
  _phaseLength=(int)(_taps.length / _interp);
  if ((_taps.length % _interp) != 0)   _phaseLength++;
  int length=(int)Math.max(_phaseLength,_dec);
  if (_data == null || _data.length != length) {
    _data=new Token[_phaseLength];
    for (int i=0; i < _phaseLength; i++) {
      _data[i]=_zero;
    }
    _mostRecent=_phaseLength;
  }
  _reinitializeNeeded=false;
}
Program: 75767
Project: 75767
Buggy source:
/** 
 * Consume the inputs and produce the outputs of the FIR filter.
 * @exception IllegalActionException If parameter values are invalid,or if there is no director, or if runtime type conflicts occur.
 */
public void fire() throws IllegalActionException {
  int phase=_dec - _decPhase - 1;
  for (int inC=1; inC <= _dec; inC++) {
    if (--_mostRecent < 0)     _mostRecent=_data.length - 1;
    _data[_mostRecent]=input.get(0);
    while (phase < _interp) {
      _outToken=_zero;
      for (int i=0; i < _phaseLength; i++) {
        int tapsIndex=i * _interp + phase;
        int dataIndex=(_mostRecent + _dec - inC + i) % (_data.length);
        if (tapsIndex < _taps.length) {
          _tapItem=_taps[tapsIndex];
          _dataItem=_data[dataIndex];
          _dataItem=_tapItem.multiply(_dataItem);
          _outToken=_outToken.add(_dataItem);
        }
      }
      output.send(0,_outToken);
      phase+=_dec;
    }
    phase-=_interp;
  }
}

Fixed version (ground truth):
/** 
 * Consume the inputs and produce the outputs of the FIR filter.
 * @exception IllegalActionException If parameter values are invalid,or if there is no director, or if runtime type conflicts occur.
 */
public void fire() throws IllegalActionException {
  int phase=_dec - _decPhase - 1;
  for (int inC=1; inC <= _dec; inC++) {
    if (--_mostRecent < 0)     _mostRecent=_data.length - 1;
    _data[_mostRecent]=input.get(0);
  }
  for (int inC=1; inC <= _dec; inC++) {
    while (phase < _interp) {
      _outToken=_zero;
      for (int i=0; i < _phaseLength; i++) {
        int tapsIndex=i * _interp + phase;
        int dataIndex=(_mostRecent + _dec - inC + i) % (_data.length);
        if (tapsIndex < _taps.length) {
          _tapItem=_taps[tapsIndex];
          _dataItem=_data[dataIndex];
          _dataItem=_tapItem.multiply(_dataItem);
          _outToken=_outToken.add(_dataItem);
        }
      }
      output.send(0,_outToken);
      phase+=_dec;
    }
    phase-=_interp;
  }
}