nus-yam/ex-repair huggingface dataset:
Program: 42681
Project: 42681
Buggy source:
/** 
 * @param originPoint the origin point of the ray
 * @param angle the heading of the ray
 * @param lineColor the color of the line
 * @param clearPrevLine update the line or add a new one
 */
public void addLineToMap(LocTuple originPoint,double angle,Color lineColor,boolean clearPrevLine){
  if (clearPrevLine) {
    mapTree.getViewer().getMapPolygonList().clear();
  }
  double scalingFactor=0.0005;
  double dx=Math.cos(angle) * scalingFactor;
  double dy=Math.sin(angle) * scalingFactor;
  LocTuple endpoint=new LocTuple(originPoint.getLatitude() + dy,originPoint.getLongitude() + dx);
  addLineToMap(originPoint,endpoint,lineColor);
}

Fixed version (ground truth):
/** 
 * @param originPoint the origin point of the ray
 * @param angle the heading of the ray in radians
 * @param lineColor the color of the line
 * @param clearPrevLine update the line or add a new one
 */
public void addLineToMap(LocTuple originPoint,double angle,Color lineColor,boolean clearPrevLine){
  if (clearPrevLine) {
    mapTree.getViewer().getMapPolygonList().clear();
  }
  double scalingFactor=0.0005;
  double dx=Math.cos(angle) * scalingFactor;
  double dy=Math.sin(angle) * scalingFactor;
  LocTuple endpoint=new LocTuple(originPoint.getLatitude() + dy,originPoint.getLongitude() + dx);
  addLineToMap(originPoint,endpoint,lineColor);
}
Program: 42682
Project: 42682
Buggy source:
/** 
 * Run Alice
 * @param args : None
 */
public static void main(String[] args){
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  try {
    JNISetup.setupJNI();
  }
 catch (  NoSuchFieldException|SecurityException|IllegalAccessException|IllegalArgumentException e1) {
    e1.printStackTrace();
  }
  RobobuggyConfigFile.loadConfigFile();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  robot=TransistorAuton.getInstance();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  Gui.getInstance();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  robot.startNodes();
  try {
    new JettyServer();
    new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Run Alice
 * @param args : None
 */
public static void main(String[] args){
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  try {
    JNISetup.setupJNI();
  }
 catch (  NoSuchFieldException|SecurityException|IllegalAccessException|IllegalArgumentException e1) {
    e1.printStackTrace();
  }
  RobobuggyConfigFile.loadConfigFile();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  robot=SimRobot.getInstance();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  Gui.getInstance();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  robot.startNodes();
  try {
    new JettyServer();
    new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 42683
Project: 42683
Buggy source:
@Override public double getCommandedSteeringAngle(){
  int closestIndex=getClosestIndex(wayPoints,pose);
  if (closestIndex == -1) {
    return 17433504;
  }
  double delta=10 / 100000.0;
  int targetIndex=closestIndex + 5;
  if (targetIndex >= wayPoints.size()) {
    return 0;
  }
  GpsMeasurement targetPoint=wayPoints.get(targetIndex);
  MapMarkerDot destPoint=new MapMarkerDot(targetPoint.getLatitude(),targetPoint.getLongitude());
  AnalyticsPanel.getInstance().getDataPanel().getGpsPanel().setDestinationPoint(destPoint);
  double dLon=targetPoint.getLongitude() - pose.getLongitude();
  double dLat=targetPoint.getLatitude() - pose.getLatitude();
  double desiredHeading=Math.toDegrees(Math.atan2(LocalizerUtil.convertLatToMeters(dLat),LocalizerUtil.convertLonToMeters(dLon)));
  desiredHeading=Util.normalizeAngleDeg(desiredHeading);
  double poseHeading=Util.normalizeAngleDeg(pose.getHeading());
  return Util.normalizeAngleDeg(desiredHeading - poseHeading);
}

Fixed version (ground truth):
@Override public double getCommandedSteeringAngle(){
  int closestIndex=getClosestIndex(wayPoints,pose);
  if (closestIndex == -1) {
    return 17433504;
  }
  double delta=10 / 100000.0;
  int targetIndex=closestIndex + 2;
  if (targetIndex >= wayPoints.size()) {
    return 0;
  }
  GpsMeasurement targetPoint=wayPoints.get(targetIndex);
  MapMarkerDot destPoint=new MapMarkerDot(targetPoint.getLatitude(),targetPoint.getLongitude());
  AnalyticsPanel.getInstance().getDataPanel().getGpsPanel().setDestinationPoint(destPoint);
  double dLon=targetPoint.getLongitude() - pose.getLongitude();
  double dLat=targetPoint.getLatitude() - pose.getLatitude();
  double desiredHeading=Math.toDegrees(Math.atan2(LocalizerUtil.convertLatToMeters(dLat),LocalizerUtil.convertLonToMeters(dLon)));
  desiredHeading=Util.normalizeAngleDeg(desiredHeading);
  double poseHeading=Util.normalizeAngleDeg(pose.getHeading());
  return Util.normalizeAngleDeg(desiredHeading - poseHeading);
}
Program: 42684
Project: 42684
Buggy source:
private SimRobot(){
  super();
  nodeList.add(new HighTrustGPSLocalizer());
  nodeList.add(new SimulatedImuNode(100));
  nodeList.add(new SimulatedGPSNode(500));
  nodeList.add(new SimulatedRBSMNode());
  try {
    ArrayList<GpsMeasurement> wayPoints=WayPointUtil.createWayPointsFromWaypointList(RobobuggyConfigFile.getWaypointSourceLogFile());
    nodeList.add(new WayPointFollowerPlanner(wayPoints));
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
  SimulatedBuggy simBuggy=SimulatedBuggy.getInstance();
  simBuggy.setY(LocalizerUtil.convertLatToMeters(40.441705));
  simBuggy.setX(LocalizerUtil.convertLonToMeters(-79.941585));
  simBuggy.setTh(-100);
  simBuggy.setDx(.1);
  RobobuggyJFrame mainWindow=new RobobuggyJFrame("String_Node_Str",1.0,1.0);
  Gui.getInstance().addWindow(mainWindow);
  RobobuggyGUITabs tabs=new RobobuggyGUITabs();
  mainWindow.addComponent(tabs,0.0,0.0,1.0,1.0);
  tabs.addTab(new MainGuiWindow(),"String_Node_Str");
  tabs.addTab(new PoseGraphsPanel(),"String_Node_Str");
  tabs.addTab(new ImuPanel(),"String_Node_Str");
  tabs.addTab(new AutonomousPanel(),"String_Node_Str");
  tabs.addTab(new SimulationPanel(),"String_Node_Str");
  tabs.addTab(new PathPanel(),"String_Node_Str");
  tabs.addTab(new ConfigurationPanel(),"String_Node_Str");
}

Fixed version (ground truth):
private SimRobot(){
  super();
  nodeList.add(new HighTrustGPSLocalizer());
  nodeList.add(new SimulatedImuNode(100));
  nodeList.add(new SimulatedGPSNode(500));
  nodeList.add(new SimulatedRBSMNode());
  try {
    ArrayList<GpsMeasurement> wayPoints=WayPointUtil.createWayPointsFromWaypointList(RobobuggyConfigFile.getWaypointSourceLogFile());
    nodeList.add(new WayPointFollowerPlanner(wayPoints));
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
  SimulatedBuggy simBuggy=SimulatedBuggy.getInstance();
  simBuggy.setY(LocalizerUtil.convertLatToMeters(40.441705));
  simBuggy.setX(LocalizerUtil.convertLonToMeters(-79.941585));
  simBuggy.setTh(-110);
  try {
    Thread.sleep(1000);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  simBuggy.setDx(.5);
  RobobuggyJFrame mainWindow=new RobobuggyJFrame("String_Node_Str",1.0,1.0);
  Gui.getInstance().addWindow(mainWindow);
  RobobuggyGUITabs tabs=new RobobuggyGUITabs();
  mainWindow.addComponent(tabs,0.0,0.0,1.0,1.0);
  tabs.addTab(new MainGuiWindow(),"String_Node_Str");
  tabs.addTab(new PoseGraphsPanel(),"String_Node_Str");
  tabs.addTab(new ImuPanel(),"String_Node_Str");
  tabs.addTab(new AutonomousPanel(),"String_Node_Str");
  tabs.addTab(new SimulationPanel(),"String_Node_Str");
  tabs.addTab(new PathPanel(),"String_Node_Str");
  tabs.addTab(new ConfigurationPanel(),"String_Node_Str");
}
Program: 42685
Project: 42685
Buggy source:
/** 
 * @param destinationPoint the destinationPoint to set
 */
public synchronized void setDestinationPoint(MapMarkerDot destinationPoint){
  this.destinationPoint=destinationPoint;
}

Fixed version (ground truth):
/** 
 * @param destinationPoint the destinationPoint to set
 */
public synchronized void setDestinationPoint(MapMarkerDot destinationPoint){
  this.destinationPoint.setLat(destinationPoint.getLat());
  this.destinationPoint.setLon(destinationPoint.getLon());
}
Program: 42686
Project: 42686
Buggy source:
@Override public void mouseDragged(MouseEvent e){
  int zoomLevel=getMapTree().getViewer().getZoom();
  mapViewerLat-=((mapDragY - e.getY()) * 0.001) / (zoomLevel * 1000);
  mapViewerLon-=((e.getX() - mapDragX) * 0.001) / (zoomLevel * 1000);
  getMapTree().getViewer().setDisplayPosition(new Coordinate(mapViewerLat,mapViewerLon),zoomLevel);
}

Fixed version (ground truth):
@Override public void mouseDragged(MouseEvent e){
  zoomLevel=getMapTree().getViewer().getZoom();
  mapViewerLat-=((mapDragY - e.getY()) * 0.001) / (zoomLevel * 1000);
  mapViewerLon-=((e.getX() - mapDragX) * 0.001) / (zoomLevel * 1000);
  getMapTree().getViewer().setDisplayPosition(new Coordinate(mapViewerLat,mapViewerLon),zoomLevel);
}
Program: 42687
Project: 42687
Buggy source:
private void initMapTree(){
  setMapTree(new JMapViewerTree("String_Node_Str"));
  getMapTree().getViewer().setTileSource(new BingAerialTileSource());
  getMapTree().setSize(getWidth(),getHeight());
  getMapTree().getViewer().setSize(getWidth(),getHeight());
  getMapTree().getViewer().setTileLoader(new OsmTileLoader(getMapTree().getViewer()));
  getMapTree().getViewer().setDisplayPosition(new Coordinate(mapViewerLat,mapViewerLon),17);
  getMapTree().getViewer().addMouseListener(new MouseListener(){
    @Override public void mouseReleased(    MouseEvent e){
    }
    @Override public void mousePressed(    MouseEvent e){
      mapDragX=e.getX();
      mapDragY=e.getY();
    }
    @Override public void mouseExited(    MouseEvent e){
    }
    @Override public void mouseEntered(    MouseEvent e){
    }
    @Override public void mouseClicked(    MouseEvent e){
    }
  }
);
  getMapTree().getViewer().addMouseMotionListener(new MouseMotionListener(){
    @Override public void mouseMoved(    MouseEvent e){
    }
    @Override public void mouseDragged(    MouseEvent e){
      int zoomLevel=getMapTree().getViewer().getZoom();
      mapViewerLat-=((mapDragY - e.getY()) * 0.001) / (zoomLevel * 1000);
      mapViewerLon-=((e.getX() - mapDragX) * 0.001) / (zoomLevel * 1000);
      getMapTree().getViewer().setDisplayPosition(new Coordinate(mapViewerLat,mapViewerLon),zoomLevel);
    }
  }
);
}

Fixed version (ground truth):
private void initMapTree(){
  setMapTree(new JMapViewerTree("String_Node_Str"));
  getMapTree().getViewer().setTileSource(new BingAerialTileSource());
  getMapTree().setSize(getWidth(),getHeight());
  getMapTree().getViewer().setSize(getWidth(),getHeight());
  getMapTree().getViewer().setTileLoader(new OsmTileLoader(getMapTree().getViewer()));
  getMapTree().getViewer().setDisplayPosition(new Coordinate(mapViewerLat,mapViewerLon),zoomLevel);
  getMapTree().getViewer().addMouseListener(new MouseListener(){
    @Override public void mouseReleased(    MouseEvent e){
    }
    @Override public void mousePressed(    MouseEvent e){
      mapDragX=e.getX();
      mapDragY=e.getY();
    }
    @Override public void mouseExited(    MouseEvent e){
    }
    @Override public void mouseEntered(    MouseEvent e){
    }
    @Override public void mouseClicked(    MouseEvent e){
    }
  }
);
  getMapTree().getViewer().addMouseMotionListener(new MouseMotionListener(){
    @Override public void mouseMoved(    MouseEvent e){
    }
    @Override public void mouseDragged(    MouseEvent e){
      zoomLevel=getMapTree().getViewer().getZoom();
      mapViewerLat-=((mapDragY - e.getY()) * 0.001) / (zoomLevel * 1000);
      mapViewerLon-=((e.getX() - mapDragX) * 0.001) / (zoomLevel * 1000);
      getMapTree().getViewer().setDisplayPosition(new Coordinate(mapViewerLat,mapViewerLon),zoomLevel);
    }
  }
);
}
Program: 42688
Project: 42688
Buggy source:
private void addCacheToTree(){
  try {
    TileCache courseCache=new MemoryTileCache();
    File mapCacheDir=new File(mapCacheFolderDiskPath);
    if (!mapCacheDir.isDirectory() || !mapCacheDir.exists()) {
      throw new IOException("String_Node_Str");
    }
    FilenameFilter filter=(dir,name) -> {
      if (name.contains("String_Node_Str")) {
        return true;
      }
      return false;
    }
;
    String[] cachedImages=mapCacheDir.list(filter);
    if (cachedImages == null) {
      return;
    }
    for (    String imageName : cachedImages) {
      BufferedImage tileImageSource=ImageIO.read(new File(mapCacheDir.getAbsolutePath() + "String_Node_Str" + imageName));
      String[] tileCoords=imageName.substring(0,imageName.indexOf("String_Node_Str")).split("String_Node_Str");
      int xCoord=Integer.parseInt(tileCoords[0]);
      int yCoord=Integer.parseInt(tileCoords[1]);
      int zoomLevel=Integer.parseInt(tileCoords[2]);
      Tile cacheInsert=new Tile(getMapTree().getViewer().getTileController().getTileSource(),xCoord,yCoord,zoomLevel,tileImageSource);
      cacheInsert.setLoaded(true);
      courseCache.addTile(cacheInsert);
    }
    getMapTree().getViewer().getTileController().setTileCache(courseCache);
  }
 catch (  IOException e) {
    new RobobuggyLogicNotification("String_Node_Str" + e.getMessage(),RobobuggyMessageLevel.EXCEPTION);
  }
}

Fixed version (ground truth):
private void addCacheToTree(){
  try {
    TileCache courseCache=new MemoryTileCache();
    File mapCacheDir=new File(mapCacheFolderDiskPath);
    if (!mapCacheDir.isDirectory() || !mapCacheDir.exists()) {
      throw new IOException("String_Node_Str");
    }
    FilenameFilter filter=(dir,name) -> {
      if (name.contains("String_Node_Str")) {
        return true;
      }
      return false;
    }
;
    String[] cachedImages=mapCacheDir.list(filter);
    if (cachedImages == null) {
      return;
    }
    for (    String imageName : cachedImages) {
      BufferedImage tileImageSource=ImageIO.read(new File(mapCacheDir.getAbsolutePath() + "String_Node_Str" + imageName));
      String[] tileCoords=imageName.substring(0,imageName.indexOf("String_Node_Str")).split("String_Node_Str");
      int xCoord=Integer.parseInt(tileCoords[0]);
      int yCoord=Integer.parseInt(tileCoords[1]);
      zoomLevel=Integer.parseInt(tileCoords[2]);
      Tile cacheInsert=new Tile(getMapTree().getViewer().getTileController().getTileSource(),xCoord,yCoord,zoomLevel,tileImageSource);
      cacheInsert.setLoaded(true);
      courseCache.addTile(cacheInsert);
    }
    getMapTree().getViewer().getTileController().setTileCache(courseCache);
  }
 catch (  IOException e) {
    new RobobuggyLogicNotification("String_Node_Str" + e.getMessage(),RobobuggyMessageLevel.EXCEPTION);
  }
}
Program: 42689
Project: 42689
Buggy source:
/** 
 * initializes a new Map with cache loaded
 */
public Map(){
  initMapTree();
  addCacheToTree();
  this.add(getMapTree());
}

Fixed version (ground truth):
/** 
 * initializes a new Map with cache loaded
 */
public Map(){
  initMapTree();
  addCacheToTree();
  this.add(getMapTree());
  new Subscriber(NodeChannel.POSE.getMsgPath(),new MessageListener(){
    @Override public void actionPerformed(    String topicName,    Message m){
      GPSPoseMessage gpsM=(GPSPoseMessage)m;
      getMapTree().getViewer().setDisplayPosition(new Coordinate(gpsM.getLatitude(),gpsM.getLongitude()),zoomLevel);
    }
  }
);
}
Program: 42690
Project: 42690
Buggy source:
/** 
 * evaluates to the inverse of the so2 pose (the position change needed to get to zero) 
 * @return an So2Pose object that is the inverse of the current object
 */
public So2Pose inverse(){
  return new So2Pose(-1 * location.getX(),-1 * location.getY(),-1 * orientation);
}

Fixed version (ground truth):
/** 
 * evaluates to the inverse of the so2 pose (the position change needed to get to zero) 
 * @return an So2Pose object that is the inverse of the current object
 */
public So2Pose inverse(){
  double[][] m={{Math.cos(orientation),-Math.sin(orientation),getX()},{Math.sin(orientation),Math.cos(orientation),getY()},{0,0,1}};
  Matrix M=new Matrix(m);
  Matrix M_inv=M.inverse();
  double th=Math.atan2(M_inv.get(1,0),M_inv.get(0,0));
  return new So2Pose(M_inv.get(0,2),M_inv.get(1,2),th);
}
Program: 42691
Project: 42691
Buggy source:
@Test public void test_2(){
  So2Pose A=new So2Pose(0.0,1.0,0.0);
  So2Pose B=new So2Pose(0.0,2.0,0.0);
  So2Pose C=A.mult(B);
  if (C.getY() != 3.0) {
    fail("String_Node_Str");
  }
  So2Pose D=B.mult(A);
  if (D.getY() != 3.0) {
    fail("String_Node_Str");
  }
  So2Pose E=new So2Pose(1.2,2.4,3.2);
  So2Pose F=new So2Pose(3.4,5.6,18);
  So2Pose G=E.mult(F);
  So2Pose H=G.mult(F.inverse());
  System.out.println("String_Node_Str" + E);
  System.out.println("String_Node_Str" + H);
  if (E.getX() != H.getX() || E.getY() != H.getY() || E.getOrientation() != H.getOrientation()) {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
@Test public void test_2(){
  So2Pose A=new So2Pose(0.0,1.0,0.0);
  So2Pose B=new So2Pose(0.0,2.0,0.0);
  So2Pose C=A.mult(B);
  if (C.getY() != 3.0) {
    fail("String_Node_Str");
  }
  So2Pose D=B.mult(A);
  if (D.getY() != 3.0) {
    fail("String_Node_Str");
  }
  So2Pose E=new So2Pose(1.2,2.4,3.2);
  So2Pose F=new So2Pose(3.4,5.6,18);
  So2Pose G=E.mult(F);
  So2Pose H=G.mult(F.inverse());
}
Program: 42692
Project: 42692
Buggy source:
@Test public void test_inverse(){
  So2Pose A=new So2Pose(1.0,2.0,3.0);
  So2Pose B=A.inverse();
}

Fixed version (ground truth):
@Test public void test_inverse(){
  So2Pose A=new So2Pose(1.0,2.0,3.0);
  So2Pose B=A.inverse();
  So2Pose C=B.mult(A);
  if (!C.equals(So2Pose.Identity())) {
    fail("String_Node_Str");
  }
  So2Pose D=A.mult(B);
  if (!D.equals(So2Pose.Identity())) {
    fail("String_Node_Str");
  }
}
Program: 42693
Project: 42693
Buggy source:
/** 
 * evaluates to the inverse of the so2 pose (the position change needed to get to zero) 
 * @return an So2Pose object that is the inverse of the current object
 */
public So2Pose inverse(){
  double[][] m={{Math.cos(orientation),-Math.sin(orientation),getX()},{Math.sin(orientation),Math.cos(orientation),getY()},{0,0,1}};
  Matrix M=new Matrix(m);
  Matrix M_inv=M.inverse();
  double th=Math.atan2(M_inv.get(1,0),M_inv.get(0,0));
  return new So2Pose(M_inv.get(0,2),M_inv.get(1,2),th);
}

Fixed version (ground truth):
/** 
 * evaluates to the inverse of the so2 pose (the position change needed to get to zero) 
 * @return an So2Pose object that is the inverse of the current object
 */
public So2Pose inverse(){
  double[][] mArray={{Math.cos(orientation),-Math.sin(orientation),getX()},{Math.sin(orientation),Math.cos(orientation),getY()},{0,0,1}};
  Matrix mMatrix=new Matrix(mArray);
  Matrix mMatrixInv=mMatrix.inverse();
  double th=Util.normilizeAngleRad(Math.atan2(mMatrixInv.get(1,0),mMatrixInv.get(0,0)));
  return new So2Pose(mMatrixInv.get(0,2),mMatrixInv.get(1,2),th);
}
Program: 42694
Project: 42694
Buggy source:
/** 
 * @param x x coord of the point
 * @param y y coord of the point
 * @param newOrientation the new orientation
 */
public So2Pose(double x,double y,double newOrientation){
  location=new Point(x,y);
  orientation=newOrientation;
}

Fixed version (ground truth):
/** 
 * @param x x cord of the point
 * @param y y cord of the point
 * @param newOrientation the new orientation
 */
public So2Pose(double x,double y,double newOrientation){
  location=new Point(x,y);
  orientation=Util.normilizeAngleRad(newOrientation);
}
Program: 42695
Project: 42695
Buggy source:
/** 
 * @param postPose the pose that is being applied to the right of the expresion
 * @return the new So2Pose TODO
 */
public So2Pose mult(So2Pose postPose){
  double[][] aM={{Math.cos(orientation),-Math.sin(orientation),getX()},{Math.sin(orientation),Math.cos(orientation),getY()},{0,0,1}};
  double[][] bM={{Math.cos(postPose.orientation),-Math.sin(postPose.orientation),postPose.getX()},{Math.sin(postPose.orientation),Math.cos(postPose.orientation),postPose.getY()},{0,0,1}};
  Matrix a=new Matrix(aM);
  Matrix b=new Matrix(bM);
  Matrix c=a.times(b);
  return new So2Pose(c.get(0,2),c.get(1,2),Math.atan2(c.get(1,0),c.get(0,0)));
}

Fixed version (ground truth):
/** 
 * @param postPose the pose that is being applied to the right of the expression
 * @return the new So2Pose TODO
 */
public So2Pose mult(So2Pose postPose){
  double[][] aM={{Math.cos(orientation),-Math.sin(orientation),getX()},{Math.sin(orientation),Math.cos(orientation),getY()},{0,0,1}};
  double[][] bM={{Math.cos(postPose.orientation),-Math.sin(postPose.orientation),postPose.getX()},{Math.sin(postPose.orientation),Math.cos(postPose.orientation),postPose.getY()},{0,0,1}};
  Matrix a=new Matrix(aM);
  Matrix b=new Matrix(bM);
  Matrix c=a.times(b);
  double th=Util.normilizeAngleRad(Math.atan2(c.get(1,0),c.get(0,0)));
  return new So2Pose(c.get(0,2),c.get(1,2),th);
}
Program: 42696
Project: 42696
Buggy source:
/** 
 * evaluates to a string encoding infromation about this class
 */
public String toString(){
  return "String_Node_Str" + getX() + "String_Node_Str"+ getY()+ "String_Node_Str"+ getOrientation()+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * evaluates to a string encoding information about this class
 * @return a string encoding what this objects information 
 */
public String toString(){
  return "String_Node_Str" + getX() + "String_Node_Str"+ getY()+ "String_Node_Str"+ getOrientation()+ "String_Node_Str";
}
Program: 42697
Project: 42697
Buggy source:
/** 
 * updates the values of the pose
 * @param newPoint the new se2 point to be set
 * @param newOrientation the new orientation
 */
public void updatePoint(Point newPoint,double newOrientation){
  this.orientation=newOrientation;
  this.location=newPoint;
}

Fixed version (ground truth):
/** 
 * updates the values of the pose
 * @param newPoint the new se2 point to be set
 * @param newOrientation the new orientation
 */
public void updatePoint(Point newPoint,double newOrientation){
  this.orientation=Util.normilizeAngleRad(newOrientation);
  this.location=newPoint;
}
Program: 42698
Project: 42698
Buggy source:
public String getMessage(){
  return message;
}

Fixed version (ground truth):
/** 
 * evaluates to a string encoding of the message
 * @return string encoding of the message
 */
public String getMessage(){
  return message;
}
Program: 42699
Project: 42699
Buggy source:
public HillCrestIMUMessage(String Message){
  message=Message;
}

Fixed version (ground truth):
/** 
 * constructor for the datatype 
 * @param message message to encode 
 */
public HillCrestIMUMessage(String message){
  this.message=message;
}
Program: 42700
Project: 42700
Buggy source:
/** 
 * Constructs a new   {@link MagMeasurement} at time now
 * @param rotationX rotationx value
 * @param rotationy rotationy value
 * @param rotationz rotationz value
 */
public MagneticMeasurement(double rotationX,double rotationY,double rotationZ){
  this.timestamp=new Date().getTime();
  this.rotationX=rotationX;
  this.rotationY=rotationY;
  this.rotationZ=rotationZ;
}

Fixed version (ground truth):
/** 
 * Constructs a new   {@link MagMeasurement} at time now
 * @param rotationX rotationX value
 * @param rotationY rotationY value
 * @param rotationZ rotationZ value
 */
public MagneticMeasurement(double rotationX,double rotationY,double rotationZ){
  this.timestamp=new Date().getTime();
  this.rotationX=rotationX;
  this.rotationY=rotationY;
  this.rotationZ=rotationZ;
}
Program: 42701
Project: 42701
Buggy source:
/** 
 * Creates a new decorator for the given   {@link Node}
 * @param node {@link Node} to decorate
 */
public BuggyDecoratorNode(BuggyNode node,String name){
  this.node=node;
}

Fixed version (ground truth):
/** 
 * Creates a new decorator for the given   {@link Node}
 * @param node {@link Node} to decorate
 * @param name the name we want for this node to store so that it can be refrenced later 
 */
public BuggyDecoratorNode(BuggyNode node,String name){
  this.node=node;
}
Program: 42703
Project: 42703
Buggy source:
public HillCrestImuNode(){
  super();
  Discovery discover=Discovery.getInstance();
  discover.addListener(this);
}

Fixed version (ground truth):
/** 
 * Constructor for the hillcrest imu
 */
public HillCrestImuNode(){
  super();
  Discovery discover=Discovery.getInstance();
  discover.addListener(this);
}
Program: 42704
Project: 42704
Buggy source:
@Override public void freespaceDeviceInserted(Device arg0){
  device_=arg0;
  device_.open(this);
  deviceStats=device_.getStatistics();
  System.out.println("String_Node_Str");
  System.out.println(deviceStats.toString());
  FreespaceMsgOutDataModeControlV2Request msg=new FreespaceMsgOutDataModeControlV2Request();
  msg.setPacketSelect(8);
  msg.setModeAndStatus(0);
  msg.setFormatSelect(0);
  msg.setFf0(true);
  msg.setFf1(true);
  msg.setFf2(true);
  msg.setFf3(true);
  msg.setFf4(true);
  msg.setFf5(true);
  msg.setFf6(true);
  msg.setFf7(true);
  device_.sendMessageAsync(msg);
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
@Override public void freespaceDeviceInserted(Device arg0){
  thisDevice=arg0;
  thisDevice.open(this);
  deviceStats=thisDevice.getStatistics();
  System.out.println("String_Node_Str");
  System.out.println(deviceStats.toString());
  FreespaceMsgOutDataModeControlV2Request msg=new FreespaceMsgOutDataModeControlV2Request();
  msg.setPacketSelect(8);
  msg.setModeAndStatus(0);
  msg.setFormatSelect(0);
  msg.setFf0(true);
  msg.setFf1(true);
  msg.setFf2(true);
  msg.setFf3(true);
  msg.setFf4(true);
  msg.setFf5(true);
  msg.setFf6(true);
  msg.setFf7(true);
  thisDevice.sendMessageAsync(msg);
  System.out.println("String_Node_Str");
}
Program: 42705
Project: 42705
Buggy source:
@Override public void freespaceDeviceRemoved(Device arg0){
  device_=null;
}

Fixed version (ground truth):
@Override public void freespaceDeviceRemoved(Device arg0){
  thisDevice=null;
}
Program: 42706
Project: 42706
Buggy source:
/** 
 * constructor for the simulated gps node
 */
public SimulatedGPSNode(int period){
  super(new BuggyBaseNode(NodeChannel.GPS),period,"String_Node_Str");
  resume();
}

Fixed version (ground truth):
/** 
 * constructor for the simulated gps node
 * @param period the number of milliseconds between gps update messages  
 */
public SimulatedGPSNode(int period){
  super(new BuggyBaseNode(NodeChannel.GPS),period,"String_Node_Str");
  resume();
}
Program: 42707
Project: 42707
Buggy source:
public SimulatedImuNode(int period){
  super(new BuggyBaseNode(NodeChannel.IMU),period,"String_Node_Str");
  simBuggy=SimulatedBuggy.getInstance();
  resume();
}

Fixed version (ground truth):
/** 
 * Constructor for the simulated imu node
 * @param period how many milliseconds between new simulated imu messages
 */
public SimulatedImuNode(int period){
  super(new BuggyBaseNode(NodeChannel.IMU),period,"String_Node_Str");
  simBuggy=SimulatedBuggy.getInstance();
  resume();
}
Program: 42708
Project: 42708
Buggy source:
@Override public double getCommandedSteeringAngle(){
  int closestIndex=getClosestIndex(wayPoints,pose);
  if (closestIndex == -1) {
    return 17433504;
  }
  double delta=10 / 100000.0;
  int targetIndex=closestIndex + 5;
  if (targetIndex >= wayPoints.size()) {
    return 0;
  }
  GpsMeasurement targetPoint=wayPoints.get(targetIndex);
  double dLon=targetPoint.getLongitude() - pose.getLongitude();
  double dLat=targetPoint.getLatitude() - pose.getLatitude();
  double desiredHeading=180 * Math.atan2(dLat,-dLon) / Math.PI;
  return desiredHeading - pose.getHeading();
}

Fixed version (ground truth):
@Override public double getCommandedSteeringAngle(){
  int closestIndex=getClosestIndex(wayPoints,pose);
  if (closestIndex == -1) {
    return 17433504;
  }
  double delta=10 / 100000.0;
  int targetIndex=closestIndex + 5;
  if (targetIndex >= wayPoints.size()) {
    return 0;
  }
  GpsMeasurement targetPoint=wayPoints.get(targetIndex);
  double dLon=targetPoint.getLongitude() - pose.getLongitude();
  double dLat=targetPoint.getLatitude() - pose.getLatitude();
  double desiredHeading=180 * Math.atan2(dLat,-dLon) / Math.PI;
  if (desiredHeading < 0) {
    desiredHeading+=360;
  }
  double poseHeading=pose.getHeading();
  if (poseHeading < 0) {
    poseHeading+=360;
  }
  return desiredHeading - poseHeading;
}
Program: 42709
Project: 42709
Buggy source:
/** 
 * @param wayPoints the list of waypoints to follow
 */
public WayPointFollowerPlanner(ArrayList wayPoints){
  super(NodeChannel.PATH_PLANNER);
  this.wayPoints=wayPoints;
  pose=new GPSPoseMessage(new Date(0),0,0,0);
}

Fixed version (ground truth):
/** 
 * @param wayPoints the list of waypoints to follow
 */
public WayPointFollowerPlanner(ArrayList<GpsMeasurement> wayPoints){
  super(NodeChannel.PATH_PLANNER);
  this.wayPoints=wayPoints;
  pose=new GPSPoseMessage(new Date(0),0,0,0);
}
Program: 42711
Project: 42711
Buggy source:
/** 
 * gets the new playback speed from the GUI and puts it into playbackSpeed
 */
public void getNewPlaybackSpeed(){
  playbackSpeed=Gui.getInstance().getMainGuiWindow().getCtrlPanel().getLoggingPanel().getPlaybackSpeed();
}

Fixed version (ground truth):
/** 
 * gets the new playback speed from the GUI and puts it into playbackSpeed
 */
public void getNewPlaybackSpeed(){
  playbackSpeed=RobobuggyConfigFile.getPlayBackSpeed();
}
Program: 42712
Project: 42712
Buggy source:
/** 
 * Construct a new   {@link AnalyticsPanel}
 */
public AnalyticsPanel(){
  name="String_Node_Str";
  dataPanel=new DataPanel();
  graphPanel=new GraphPanel();
  this.addComponent(dataPanel,0,0,1,.6);
  this.addComponent(graphPanel,0,.6,1,.4);
}

Fixed version (ground truth):
/** 
 * Construct a new   {@link AnalyticsPanel}
 */
private AnalyticsPanel(){
  name="String_Node_Str";
  dataPanel=new DataPanel();
  graphPanel=new GraphPanel();
  this.addComponent(dataPanel,0,0,1,.6);
  this.addComponent(graphPanel,0,.6,1,.4);
}
Program: 42713
Project: 42713
Buggy source:
public synchronized void deleteWindow(int windowRefrence){
  windowMap.remove(windowRefrence);
}

Fixed version (ground truth):
/** 
 * removes a reference to a particular frame of the window 
 * @param windowRefrence the reference to remove
 * @return 
 */
public synchronized void deleteWindow(int windowRefrence){
  windowMap.remove(windowRefrence);
}
Program: 42714
Project: 42714
Buggy source:
public synchronized void getWindow(int windowRefrence){
  windowMap.get(windowRefrence);
}

Fixed version (ground truth):
/** 
 * gets a reference to a particular frame of the window 
 * @param windowRefrence the reference to receive
 * @return the requested frames reference 
 */
public synchronized RobobuggyJFrame getWindow(int windowRefrence){
  return windowMap.get(windowRefrence);
}
Program: 42716
Project: 42716
Buggy source:
/** 
 * constructor for the main gui window, sets up what is shown on the window
 */
public MainGuiWindow(){
  analyPane=new AnalyticsPanel();
  ctrlPanel=new ControlPanel();
  addComponent(ctrlPanel,0.0,0.0,.3,1.0);
  addComponent(analyPane,0.3,0.0,.7,1.0);
}

Fixed version (ground truth):
/** 
 * constructor for the main gui window, sets up what is shown on the window
 */
public MainGuiWindow(){
  analyPane=AnalyticsPanel.getInstance();
  ctrlPanel=new ControlPanel();
  addComponent(ctrlPanel,0.0,0.0,.3,1.0);
  addComponent(analyPane,0.3,0.0,.7,1.0);
}
Program: 42717
Project: 42717
Buggy source:
/** 
 * A constructor for a gps measurement that is as basic as possible
 * @param latitude latitude measurement
 * @param longitude longitude measurement
 */
public GpsMeasurement(double latitude,double longitude){
  this.timestamp=new Date().getTime();
  this.gpsTimestamp=new Date();
  this.latitude=latitude;
  this.north=true;
  this.longitude=longitude;
  this.west=true;
  this.qualityValue=0;
  this.numSatellites=-1;
  this.horizontalDilutionOfPrecision=0.0;
  this.antennaAltitude=0.0;
}

Fixed version (ground truth):
/** 
 * A constructor for a gps measurement that is as basic as possible
 * @param latitude latitude measurement
 * @param longitude longitude measurement
 */
public GpsMeasurement(double latitude,double longitude){
  this.timestamp=new Date().getTime();
  this.gpsTimestamp=new Date();
  this.latitude=latitude;
  this.north=latitude > 0;
  this.longitude=longitude;
  this.west=longitude < 0;
  this.qualityValue=0;
  this.numSatellites=-1;
  this.horizontalDilutionOfPrecision=0.0;
  this.antennaAltitude=0.0;
}
Program: 42718
Project: 42718
Buggy source:
@Override public void actionPerformed(String topicName,Message m){
  GpsMeasurement newGPSData=(GpsMeasurement)m;
  double oldGPSX=buggyFrameGpsX;
  double oldGPSY=buggyFrameGpsY;
  buggyFrameGpsY=newGPSData.getLatitude();
  buggyFrameGpsX=newGPSData.getLongitude();
  double dy=buggyFrameGpsY - oldGPSY;
  double dx=buggyFrameGpsX - oldGPSX;
  buggyFrameRotZ=Math.toDegrees(Math.atan2(dy,dx));
  publishUpdate();
}

Fixed version (ground truth):
@Override public void actionPerformed(String topicName,Message m){
  GpsMeasurement newGPSData=(GpsMeasurement)m;
  double oldGPSX=buggyFrameGpsLon;
  double oldGPSY=buggyFrameGpsLat;
  buggyFrameGpsLat=newGPSData.getLatitude();
  buggyFrameGpsLon=newGPSData.getLongitude();
  double dLat=buggyFrameGpsLat - oldGPSY;
  double dLon=buggyFrameGpsLon - oldGPSX;
  buggyFrameRotZ=Math.toDegrees(Math.atan2(dLat,dLon));
  publishUpdate();
}
Program: 42719
Project: 42719
Buggy source:
/** 
 * Constructor for the High Trust Localizer which will initialize the system to an identity (zero position)
 */
public HighTrustGPSLocalizer(){
  buggyFrameGpsX=0.0;
  buggyFrameGpsY=0.0;
  posePub=new Publisher(NodeChannel.POSE.getMsgPath());
  new Subscriber(NodeChannel.GPS.getMsgPath(),new MessageListener(){
    @Override public void actionPerformed(    String topicName,    Message m){
      GpsMeasurement newGPSData=(GpsMeasurement)m;
      double oldGPSX=buggyFrameGpsX;
      double oldGPSY=buggyFrameGpsY;
      buggyFrameGpsY=newGPSData.getLatitude();
      buggyFrameGpsX=newGPSData.getLongitude();
      double dy=buggyFrameGpsY - oldGPSY;
      double dx=buggyFrameGpsX - oldGPSX;
      buggyFrameRotZ=Math.toDegrees(Math.atan2(dy,dx));
      publishUpdate();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Constructor for the High Trust Localizer which will initialize the system to an identity (zero position)
 */
public HighTrustGPSLocalizer(){
  buggyFrameGpsLon=0.0;
  buggyFrameGpsLat=0.0;
  posePub=new Publisher(NodeChannel.POSE.getMsgPath());
  new Subscriber(NodeChannel.GPS.getMsgPath(),new MessageListener(){
    @Override public void actionPerformed(    String topicName,    Message m){
      GpsMeasurement newGPSData=(GpsMeasurement)m;
      double oldGPSX=buggyFrameGpsLon;
      double oldGPSY=buggyFrameGpsLat;
      buggyFrameGpsLat=newGPSData.getLatitude();
      buggyFrameGpsLon=newGPSData.getLongitude();
      double dLat=buggyFrameGpsLat - oldGPSY;
      double dLon=buggyFrameGpsLon - oldGPSX;
      buggyFrameRotZ=Math.toDegrees(Math.atan2(dLat,dLon));
      publishUpdate();
    }
  }
);
}
Program: 42720
Project: 42720
Buggy source:
private void publishUpdate(){
  posePub.publish(new GPSPoseMessage(new Date(),buggyFrameGpsY,buggyFrameGpsX,buggyFrameRotZ));
}

Fixed version (ground truth):
private void publishUpdate(){
  posePub.publish(new GPSPoseMessage(new Date(),buggyFrameGpsLat,buggyFrameGpsLon,buggyFrameRotZ));
}
Program: 42721
Project: 42721
Buggy source:
@Override public boolean shutdown(){
  posePub=null;
  buggyFrameGpsX=0.0;
  buggyFrameGpsY=0.0;
  return true;
}

Fixed version (ground truth):
@Override public boolean shutdown(){
  posePub=null;
  buggyFrameGpsLon=0.0;
  buggyFrameGpsLat=0.0;
  return true;
}
Program: 42722
Project: 42722
Buggy source:
@Override public double getCommandedSteeringAngle(){
  int closestIndex=getClosestIndex(wayPoints,pose);
  if (closestIndex == -1) {
    return 17433504;
  }
  double delta=10;
  int targetIndex=closestIndex;
  while (GPSPoseMessage.getDistance(pose,wayPoints.get(targetIndex).toGpsPoseMessage(0)) < delta) {
    targetIndex=targetIndex + 1;
  }
  if (targetIndex >= wayPoints.size()) {
    return 0;
  }
  GpsMeasurement targetPoint=wayPoints.get(targetIndex);
  double dx=targetPoint.getLongitude() - pose.getLongitude();
  double dy=targetPoint.getLatitude() - pose.getLatitude();
  double desiredHeading=180 * Math.atan2(dy,dx) / Math.PI;
  return desiredHeading - pose.getHeading();
}

Fixed version (ground truth):
@Override public double getCommandedSteeringAngle(){
  int closestIndex=getClosestIndex(wayPoints,pose);
  if (closestIndex == -1) {
    return 17433504;
  }
  double delta=10;
  int targetIndex=closestIndex;
  while (GPSPoseMessage.getDistance(pose,wayPoints.get(targetIndex).toGpsPoseMessage(0)) < delta) {
    targetIndex=targetIndex + 1;
  }
  if (targetIndex >= wayPoints.size()) {
    return 0;
  }
  GpsMeasurement targetPoint=wayPoints.get(targetIndex);
  double dLon=targetPoint.getLongitude() - pose.getLongitude();
  double dLat=targetPoint.getLatitude() - pose.getLatitude();
  double desiredHeading=180 * Math.atan2(dLat,dLon) / Math.PI;
  return desiredHeading - pose.getHeading();
}
Program: 42724
Project: 42724
Buggy source:
public RBSMConfigReader(){
  headers=new JsonObject();
  try {
    Scanner fileIn=new Scanner(new File(RobobuggyConfigFile.RBSM_HEADER_FILE_LOCATION),"String_Node_Str");
    while (fileIn.hasNextLine()) {
      String line=fileIn.nextLine();
      if (!line.equals("String_Node_Str")) {
        String[] lineContents=line.split("String_Node_Str");
        String headerName=lineContents[0];
        int headerNumber=Integer.parseInt(lineContents[1]);
        headers.addProperty(headerName,headerNumber);
      }
    }
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * The constructor for the RBSMConfig reader, this file function is where the RBSM header file is read and its data is stored
 */
public RBSMConfigReader(){
  headers=new JsonObject();
  try {
    Scanner fileIn=new Scanner(new File(RobobuggyConfigFile.RBSM_HEADER_FILE_LOCATION),"String_Node_Str");
    while (fileIn.hasNextLine()) {
      String line=fileIn.nextLine();
      if (!line.equals("String_Node_Str")) {
        String[] lineContents=line.split("String_Node_Str");
        String headerName=lineContents[0];
        int headerNumber=Integer.parseInt(lineContents[1]);
        headers.addProperty(headerName,headerNumber);
      }
    }
  }
 catch (  FileNotFoundException e) {
    new RobobuggyLogicNotification("String_Node_Str" + e.getMessage(),RobobuggyMessageLevel.EXCEPTION);
  }
}
Program: 42725
Project: 42725
Buggy source:
public JsonObject getHeaders(){
  return headers;
}

Fixed version (ground truth):
/** 
 * gets the headers json object  
 * @return the json object to lookup header values
 */
public JsonObject getHeaders(){
  return headers;
}
Program: 42726
Project: 42726
Buggy source:
/** 
 * Determines if the headerByte is a valid RBSM header
 * @param headerByte header byte
 * @return true iff the headerByte is valid
 */
public static boolean isValidHeader(byte headerByte){
  for (  Map.Entry<String,JsonElement> object : headers.entrySet()) {
    if (object.getValue().getAsByte() == headerByte) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Determines if the headerByte is a valid RBSM header
 * @param headerByte header byte
 * @return true iff the headerByte is valid
 */
public boolean isValidHeader(byte headerByte){
  for (  Map.Entry<String,JsonElement> object : headers.entrySet()) {
    if (object.getValue().getAsByte() == headerByte) {
      return true;
    }
  }
  return false;
}
Program: 42727
Project: 42727
Buggy source:
public static RBSMConfigReader getInstance(){
  if (instance == null) {
    instance=new RBSMConfigReader();
  }
  return instance;
}

Fixed version (ground truth):
/** 
 * evaluates to a reference of the only RBSMConfigReader on the system allows for any object to access header information  
 * @return RBSMConfigReader reference
 */
public static synchronized RBSMConfigReader getInstance(){
  if (instance == null) {
    instance=new RBSMConfigReader();
  }
  return instance;
}
Program: 42728
Project: 42728
Buggy source:
/** 
 * Run Alice
 * @param args : None
 */
public static void main(String[] args){
  try {
    JettyServer js=new JettyServer();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  try {
    JNISetup.setupJNI();
  }
 catch (  NoSuchFieldException e1) {
    e1.printStackTrace();
  }
catch (  SecurityException e1) {
    e1.printStackTrace();
  }
catch (  IllegalArgumentException e1) {
    e1.printStackTrace();
  }
catch (  IllegalAccessException e1) {
    e1.printStackTrace();
  }
  RobobuggyConfigFile.loadConfigFile();
  RBSerialMessage.initializeHeaders();
  Robot.getInstance();
  Gui.getInstance();
  if (RobobuggyConfigFile.isDataPlayBack()) {
    new SensorPlayer(RobobuggyConfigFile.getPlayBackSourceFile(),1);
  }
  Robot.getInstance().startNodes();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
}

Fixed version (ground truth):
/** 
 * Run Alice
 * @param args : None
 */
public static void main(String[] args){
  try {
    new JettyServer();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  try {
    JNISetup.setupJNI();
  }
 catch (  NoSuchFieldException e1) {
    e1.printStackTrace();
  }
catch (  SecurityException e1) {
    e1.printStackTrace();
  }
catch (  IllegalArgumentException e1) {
    e1.printStackTrace();
  }
catch (  IllegalAccessException e1) {
    e1.printStackTrace();
  }
  RobobuggyConfigFile.loadConfigFile();
  RBSerialMessage.initializeHeaders();
  Robot.getInstance();
  Gui.getInstance();
  if (RobobuggyConfigFile.isDataPlayBack()) {
    new SensorPlayer(RobobuggyConfigFile.getPlayBackSourceFile(),1);
  }
  Robot.getInstance().startNodes();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
}
Program: 42729
Project: 42729
Buggy source:
/** 
 * reads the headers text file and puts it into the headers object
 * @return whether initialization succeeded or not
 */
public static synchronized boolean initializeHeaders(){
  if (headers == null) {
    instance=new RBSerialMessage();
    headers=new JsonObject();
  }
  return true;
}

Fixed version (ground truth):
/** 
 * reads the headers text file and puts it into the headers object
 * @return whether initialization succeeded or not
 */
public static synchronized boolean initializeHeaders(){
  if (headers == null) {
    headers=new JsonObject();
    instance=new RBSerialMessage();
  }
  return true;
}
Program: 42730
Project: 42730
Buggy source:
/** 
 * reads the headers text file and puts it into the headers object
 * @return whether initialization succeeded or not
 */
public static boolean initializeHeaders(){
  if (headers != null) {
    return true;
  }
  headers=new JsonObject();
  try {
    Scanner fileIn=new Scanner(new File(RobobuggyConfigFile.RBSM_HEADER_FILE_LOCATION),"String_Node_Str");
    while (fileIn.hasNextLine()) {
      String line=fileIn.nextLine();
      if (!line.equals("String_Node_Str")) {
        String[] lineContents=line.split("String_Node_Str");
        String headerName=lineContents[0];
        byte headerByte=Byte.parseByte(lineContents[1]);
        headers.addProperty(headerName,headerByte);
      }
    }
    return true;
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
    return false;
  }
}

Fixed version (ground truth):
/** 
 * reads the headers text file and puts it into the headers object
 * @return whether initialization succeeded or not
 */
public static synchronized boolean initializeHeaders(){
  if (headers == null) {
    instance=new RBSerialMessage();
  }
  return true;
}
Program: 42731
Project: 42731
Buggy source:
/** 
 * reads the headers text file and puts it into the headers object
 * @return whether initialization succeeded or not
 */
public static synchronized boolean initializeHeaders(){
  if (headers == null) {
    instance=new RBSerialMessage();
  }
  return true;
}

Fixed version (ground truth):
/** 
 * reads the headers text file and puts it into the headers object
 * @return whether initialization succeeded or not
 */
public static synchronized boolean initializeHeaders(){
  if (headers == null) {
    instance=new RBSerialMessage();
    headers=new JsonObject();
  }
  return true;
}
Program: 42734
Project: 42734
Buggy source:
private void publishUpdate(){
  posePub.publish(new GPSPoseMessage(new Date(),buggyFrame_gps_x,buggyFrame_gps_y,buggyFrame_rot_z));
}

Fixed version (ground truth):
private void publishUpdate(){
  posePub.publish(new GPSPoseMessage(new Date(),buggyFrameGpsX,buggyFrameGpsY,buggyFrameRotZ));
}
Program: 42735
Project: 42735
Buggy source:
/** 
 * Construct a new   {@link PathPlannerNode}
 * @param channel {@link NodeChannel} on which to broadcast statusinformation about the node
 */
public SweepNode(){
  super(NodeChannel.UNKNOWN_CHANNEL);
  steeringPublisher=new Publisher(NodeChannel.DRIVE_CTRL.getMsgPath());
  brakePublisher=new Publisher(NodeChannel.BRAKE_CTRL.getMsgPath());
  Thread t1=new Thread(new Runnable(){
    private boolean sweepUp=false;
    public void run(){
      while (true) {
        System.out.println("String_Node_Str");
        if (!sweepUp && currentCommandedSteeringAngle <= STEERING_ANGLE_LOWER_BOUND) {
          sweepUp=true;
        }
 else         if (sweepUp && currentCommandedSteeringAngle >= STEERING_ANGLE_UPPER_BOUND) {
          sweepUp=false;
        }
        if (sweepUp) {
          currentCommandedSteeringAngle+=STEERING_ANGLE_INCREMENT;
        }
 else {
          currentCommandedSteeringAngle-=STEERING_ANGLE_INCREMENT;
        }
        try {
          Thread.sleep(100);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
        steeringPublisher.publish(new DriveControlMessage(new Date(),currentCommandedSteeringAngle));
        brakePublisher.publish(new BrakeControlMessage(new Date(),false));
      }
    }
  }
);
  t1.start();
}

Fixed version (ground truth):
/** 
 * Construct a new   {@link PathPlannerNode}
 * @param channel {@link NodeChannel} on which to broadcast statusinformation about the node
 */
public SweepNode(NodeChannel channel){
  super(channel);
  steeringPublisher=new Publisher(NodeChannel.DRIVE_CTRL.getMsgPath());
  brakePublisher=new Publisher(NodeChannel.BRAKE_CTRL.getMsgPath());
  Thread t1=new Thread(new Runnable(){
    private boolean sweepUp=false;
    public void run(){
      while (true) {
        System.out.println("String_Node_Str");
        if (!sweepUp && currentCommandedSteeringAngle <= STEERING_ANGLE_LOWER_BOUND) {
          sweepUp=true;
        }
 else         if (sweepUp && currentCommandedSteeringAngle >= STEERING_ANGLE_UPPER_BOUND) {
          sweepUp=false;
        }
        if (sweepUp) {
          currentCommandedSteeringAngle+=STEERING_ANGLE_INCREMENT;
        }
 else {
          currentCommandedSteeringAngle-=STEERING_ANGLE_INCREMENT;
        }
        try {
          Thread.sleep(100);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
        steeringPublisher.publish(new DriveControlMessage(new Date(),currentCommandedSteeringAngle));
        brakePublisher.publish(new BrakeControlMessage(new Date(),false));
      }
    }
  }
);
  t1.start();
}