Program: 72396
Project: 72396
Buggy source:
/** 
 * Return an array of records representing the most recently detected tags from an invocation of   {@link #filter(BufferedImage,BufferedImage)}, or null if there has been no such invocation or if no tags were detected. Each record includes the following fields: <ul> <li> id: The ID of the detected tag. <li> center: An array with two doubles giving the center of the tag in pixel coordinates. <li> perimeter: An array with four arrays, each of which gives the x and y coordinates of a corner of the AprilTag, listed in a counter-clockwise direction. </ul>
 * @throws IllegalActionException If the array cannot be constructed.
 */
public ArrayToken tags() throws IllegalActionException {
  if (_tags == null || _tags.size() == 0) {
    return null;
  }
  Token[] tags=new RecordToken[_tags.size()];
  int i=0;
  for (  TagDetection tag : _tags) {
    Map<String,Token> fieldMap=new HashMap<String,Token>();
    fieldMap.put("String_Node_Str",new IntToken(tag.id));
    DoubleToken[] center=new DoubleToken[2];
    center[0]=new DoubleToken(tag.cxy[0]);
    center[1]=new DoubleToken(tag.cxy[1]);
    fieldMap.put("String_Node_Str",new ArrayToken(center));
    DoubleToken[] corner=new DoubleToken[2];
    ArrayToken[] perimeter=new ArrayToken[4];
    for (int k=0; k < 4; k++) {
      corner[0]=new DoubleToken(tag.p[k][0]);
      corner[1]=new DoubleToken(tag.p[k][1]);
      perimeter[k]=new ArrayToken(corner);
    }
    fieldMap.put("String_Node_Str",new ArrayToken(perimeter));
    tags[i++]=new RecordToken(fieldMap);
  }
  return new ArrayToken(tags);
}

Fixed version (ground truth):
/** 
 * Return an array of records representing the most recently detected tags from an invocation of   {@link #filter(BufferedImage,BufferedImage)}, or null if there has been no such invocation or if no tags were detected. Each record includes the following fields: <ul> <li> id: The ID of the detected tag. <li> center: An array with two doubles giving the center of the tag in pixel coordinates. <li> perimeter: An array with four arrays, each of which gives the x and y coordinates of a corner of the AprilTag, listed in a counter-clockwise direction. </ul>
 * @exception IllegalActionException If the array cannot be constructed.
 */
public ArrayToken tags() throws IllegalActionException {
  if (_tags == null || _tags.size() == 0) {
    return null;
  }
  Token[] tags=new RecordToken[_tags.size()];
  int i=0;
  for (  TagDetection tag : _tags) {
    Map<String,Token> fieldMap=new HashMap<String,Token>();
    fieldMap.put("String_Node_Str",new IntToken(tag.id));
    DoubleToken[] center=new DoubleToken[2];
    center[0]=new DoubleToken(tag.cxy[0]);
    center[1]=new DoubleToken(tag.cxy[1]);
    fieldMap.put("String_Node_Str",new ArrayToken(center));
    DoubleToken[] corner=new DoubleToken[2];
    ArrayToken[] perimeter=new ArrayToken[4];
    for (int k=0; k < 4; k++) {
      corner[0]=new DoubleToken(tag.p[k][0]);
      corner[1]=new DoubleToken(tag.p[k][1]);
      perimeter[k]=new ArrayToken(corner);
    }
    fieldMap.put("String_Node_Str",new ArrayToken(perimeter));
    tags[i++]=new RecordToken(fieldMap);
  }
  return new ArrayToken(tags);
}