nus-yam/ex-repair huggingface dataset:
Program: 42736
Project: 42736
Buggy source:
/** 
 * Starts the logging process
 */
private void setupLoggingTrigger(){
  new Subscriber(NodeChannel.GUI_LOGGING_BUTTON.getMsgPath(),new MessageListener(){
    @Override public void actionPerformed(    String topicName,    Message m){
      GuiLoggingButtonMessage message=(GuiLoggingButtonMessage)m;
      if (message.getLoggingMessage().equals(GuiLoggingButtonMessage.LoggingMessage.START)) {
        if (!createNewLogFile()) {
          new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
          return;
        }
        keepLogging=true;
        loggingThread=new LogWriterThread();
        loggingThread.start();
        new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
      }
 else       if (message.getLoggingMessage().equals(GuiLoggingButtonMessage.LoggingMessage.STOP)) {
        keepLogging=false;
        new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
        loggingThread.interrupt();
      }
 else {
        new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Starts the logging process
 */
private void setupLoggingTrigger(){
  new Subscriber(NodeChannel.GUI_LOGGING_BUTTON.getMsgPath(),new MessageListener(){
    @Override public void actionPerformed(    String topicName,    Message m){
      GuiLoggingButtonMessage message=(GuiLoggingButtonMessage)m;
      if (message.getLoggingMessage().equals(GuiLoggingButtonMessage.LoggingMessage.START)) {
        if (!createNewLogFile()) {
          new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
          return;
        }
        messageQueue.clear();
        keepLogging=true;
        loggingThread=new LogWriterThread();
        loggingThread.start();
        new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
      }
 else       if (message.getLoggingMessage().equals(GuiLoggingButtonMessage.LoggingMessage.STOP)) {
        keepLogging=false;
        new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
        loggingThread.interrupt();
      }
 else {
        new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
      }
    }
  }
);
}
Program: 42737
Project: 42737
Buggy source:
public ClientUpdater(){
  try {
    messageTranslator=new GsonBuilder().excludeFieldsWithModifiers(Modifier.TRANSIENT).serializeSpecialFloatingPointValues().create();
  }
 catch (  Exception e) {
  }
  for (  NodeChannel filter : NodeChannel.getLoggingChannels()) {
    new Subscriber(filter.getMsgPath(),new MessageListener(){
      @Override public void actionPerformed(      String topicName,      Message m){
        try {
          String msgAsJsonString=messageTranslator.toJson(m);
          updates.put(msgAsJsonString);
        }
 catch (        Exception e) {
          System.out.println("String_Node_Str");
        }
      }
    }
);
  }
  Thread updater=new Thread(){
    ConcurrentHashMap<Integer,Session> clients=WSHandler.clients;
    private LinkedBlockingQueue<String> updates=ClientUpdater.updates;
    public void run(){
      System.out.println("String_Node_Str");
      while (true) {
        try {
          String update=updates.take();
          System.out.println(update);
          Session session;
          for (          int key : clients.keySet()) {
            session=clients.get(key);
            session.getRemote().sendString(update);
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
  }
;
  updater.start();
}

Fixed version (ground truth):
/** 
 * starts a new client updater
 */
public ClientUpdater(){
  messageTranslator=new GsonBuilder().excludeFieldsWithModifiers(Modifier.TRANSIENT).serializeSpecialFloatingPointValues().create();
  for (  NodeChannel filter : NodeChannel.getLoggingChannels()) {
    new Subscriber(filter.getMsgPath(),new MessageListener(){
      @Override public void actionPerformed(      String topicName,      Message m){
        try {
          String msgAsJsonString=messageTranslator.toJson(m);
          updates.put(msgAsJsonString);
        }
 catch (        Exception e) {
          System.out.println("String_Node_Str");
        }
      }
    }
);
  }
  Thread updater=new Thread(){
    private ConcurrentHashMap<Integer,Session> clients=WSHandler.getClients();
    private LinkedBlockingQueue<String> updates=ClientUpdater.updates;
    public void run(){
      System.out.println("String_Node_Str");
      while (true) {
        try {
          String update=updates.take();
          System.out.println(update);
          Session session;
          for (          int key : clients.keySet()) {
            session=clients.get(key);
            session.getRemote().sendString(update);
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
  }
;
  updater.start();
}
Program: 42739
Project: 42739
Buggy source:
public RootHandler(){
}

Fixed version (ground truth):
/** 
 * initializes the roothandler
 */
public RootHandler(){
}
Program: 42740
Project: 42740
Buggy source:
@OnWebSocketConnect public void onConnect(Session session){
  clientID=clientCount;
  clients.put(clientID,session);
  System.out.println("String_Node_Str" + session.getRemoteAddress().getAddress());
  try {
    session.getRemote().sendString("String_Node_Str" + Integer.toString(clientCount));
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  clientCount++;
}

Fixed version (ground truth):
/** 
 * new client connected
 * @param session session that connected
 */
@OnWebSocketConnect public void onConnect(Session session){
  clientID=clientCount;
  clients.put(clientID,session);
  System.out.println("String_Node_Str" + session.getRemoteAddress().getAddress());
  try {
    session.getRemote().sendString("String_Node_Str" + Integer.toString(clientCount));
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  clientCount++;
}
Program: 42741
Project: 42741
Buggy source:
@OnWebSocketClose public void onClose(int statusCode,String reason){
  clients.remove(clientID);
  clientCount--;
  System.out.println("String_Node_Str" + statusCode + "String_Node_Str"+ reason);
}

Fixed version (ground truth):
/** 
 * we needed to close connection to this client
 * @param statusCode client status
 * @param reason client reason
 */
@OnWebSocketClose public void onClose(int statusCode,String reason){
  clients.remove(clientID);
  clientCount--;
  System.out.println("String_Node_Str" + statusCode + "String_Node_Str"+ reason);
}
Program: 42742
Project: 42742
Buggy source:
@OnWebSocketError public void onError(Throwable t){
  clients.remove(clientID);
  clientCount--;
  System.out.println("String_Node_Str" + t.getMessage());
}

Fixed version (ground truth):
/** 
 * client had an error
 * @param t the error that occurred
 */
@OnWebSocketError public void onError(Throwable t){
  clients.remove(clientID);
  clientCount--;
  System.out.println("String_Node_Str" + t.getMessage());
}
Program: 42743
Project: 42743
Buggy source:
@OnWebSocketMessage public void onMessage(String message){
  System.out.println("String_Node_Str" + message);
}

Fixed version (ground truth):
/** 
 * new message happened
 * @param message new message
 */
@OnWebSocketMessage public void onMessage(String message){
  System.out.println("String_Node_Str" + message);
}
Program: 42744
Project: 42744
Buggy source:
/** 
 * Run Alice
 * @param args : None
 */
public static void main(String[] args) throws Exception {
  JettyServer js=new JettyServer();
  try {
    JNISetup.setupJNI();
  }
 catch (  NoSuchFieldException e1) {
    e1.printStackTrace();
  }
catch (  SecurityException e1) {
    e1.printStackTrace();
  }
catch (  IllegalArgumentException e1) {
    e1.printStackTrace();
  }
catch (  IllegalAccessException e1) {
    e1.printStackTrace();
  }
  List<String> ports=getAvailablePorts();
  System.out.println(ports);
  Robot.getInstance();
  Gui.getInstance();
  if (RobobuggyConfigFile.DATA_PLAY_BACK) {
    new SensorPlayer("String_Node_Str",1);
  }
  Robot.getInstance().startNodes();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  try {
    Thread.sleep(5000);
    new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
    new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
    Thread.sleep(500);
    new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  }
 catch (  InterruptedException e) {
    new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  }
}

Fixed version (ground truth):
/** 
 * Run Alice
 * @param args : None
 */
public static void main(String[] args){
  new JettyServer();
  try {
    JNISetup.setupJNI();
  }
 catch (  NoSuchFieldException e1) {
    e1.printStackTrace();
  }
catch (  SecurityException e1) {
    e1.printStackTrace();
  }
catch (  IllegalArgumentException e1) {
    e1.printStackTrace();
  }
catch (  IllegalAccessException e1) {
    e1.printStackTrace();
  }
  List<String> ports=getAvailablePorts();
  System.out.println(ports);
  Robot.getInstance();
  Gui.getInstance();
  if (RobobuggyConfigFile.DATA_PLAY_BACK) {
    new SensorPlayer("String_Node_Str",1);
  }
  Robot.getInstance().startNodes();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
}
Program: 42745
Project: 42745
Buggy source:
/** 
 * Instantiates a new LogWriterThread by clearing the message queue
 */
public LogWriterThread(){
}

Fixed version (ground truth):
/** 
 * Instantiates a new LogWriterThread by clearing the message queue
 */
LogWriterThread(){
}
Program: 42746
Project: 42746
Buggy source:
/** 
 * Create a new   {@link RBSMPeriodicNode} object
 * @param period of the periodic behavior
 * @param channel of the RSBM node
 */
public RBSMPeriodicNode(NodeChannel channel,int period){
  super(new BuggyBaseNode(channel),period);
}

Fixed version (ground truth):
/** 
 * Create a new   {@link RBSMPeriodicNode} object
 * @param period of the periodic behavior
 * @param channel of the RSBM node
 */
RBSMPeriodicNode(NodeChannel channel,int period){
  super(new BuggyBaseNode(channel),period);
}
Program: 42747
Project: 42747
Buggy source:
/** 
 * Construct a new   {@link Graph}
 */
public Graph(){
  this.setPreferredSize(new Dimension(graphWidth + 2 * offset,graphHeight + 2 * offset));
}

Fixed version (ground truth):
/** 
 * Construct a new   {@link Graph}
 */
Graph(){
  this.setPreferredSize(new Dimension(graphWidth + 2 * offset,graphHeight + 2 * offset));
}
Program: 42748
Project: 42748
Buggy source:
public AutonomousPanel(){
  this.addComponent(new RoboBuggyGraph("String_Node_Str",NodeChannel.DRIVE_CTRL.getMsgPath(),new getGraphValues(){
    @Override public double getY(    Message m){
      DriveControlMessage steerM=(DriveControlMessage)m;
      return steerM.getAngleDouble();
    }
    @Override public double getX(    Message m){
      DriveControlMessage steerM=(DriveControlMessage)m;
      return steerM.getTimestamp().getTime();
    }
  }
),0,0,1,1);
}

Fixed version (ground truth):
/** 
 * starts a new autonomouspanel that shows what the drive control is on a graph
 */
public AutonomousPanel(){
  this.addComponent(new RoboBuggyGraph("String_Node_Str",NodeChannel.DRIVE_CTRL.getMsgPath(),new GetGraphValues(){
    @Override public double getY(    Message m){
      DriveControlMessage steerM=(DriveControlMessage)m;
      return steerM.getAngleDouble();
    }
    @Override public double getX(    Message m){
      DriveControlMessage steerM=(DriveControlMessage)m;
      return steerM.getTimestamp().getTime();
    }
  }
),0,0,1,1);
}
Program: 42749
Project: 42749
Buggy source:
/** 
 * @param points points to add to the map
 */
public void addPointsToMapTree(Color thisColor,LocTuple... points){
  for (  LocTuple point : points) {
    mapTree.getViewer().addMapMarker(new MapMarkerDot(thisColor,point.getLatitude(),point.getLongitude()));
  }
}

Fixed version (ground truth):
/** 
 * @param points points to add to the map
 * @param thisColor color of the point
 */
public void addPointsToMapTree(Color thisColor,LocTuple... points){
  for (  LocTuple point : points) {
    mapTree.getViewer().addMapMarker(new MapMarkerDot(thisColor,point.getLatitude(),point.getLongitude()));
  }
}
Program: 42750
Project: 42750
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=new FilenameFilter(){
      @Override public boolean accept(      File dir,      String name){
        if (name.contains("String_Node_Str")) {
          return true;
        }
        return false;
      }
    }
;
    String[] cachedImages=mapCacheDir.list(filter);
    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(mapTree.getViewer().getTileController().getTileSource(),xCoord,yCoord,zoomLevel,tileImageSource);
      cacheInsert.setLoaded(true);
      courseCache.addTile(cacheInsert);
    }
    mapTree.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]);
      int zoomLevel=Integer.parseInt(tileCoords[2]);
      Tile cacheInsert=new Tile(mapTree.getViewer().getTileController().getTileSource(),xCoord,yCoord,zoomLevel,tileImageSource);
      cacheInsert.setLoaded(true);
      courseCache.addTile(cacheInsert);
    }
    mapTree.getViewer().getTileController().setTileCache(courseCache);
  }
 catch (  IOException e) {
    new RobobuggyLogicNotification("String_Node_Str" + e.getMessage(),RobobuggyMessageLevel.EXCEPTION);
  }
}
Program: 42752
Project: 42752
Buggy source:
public void addPointsToMapTree(LocTuple... points){
  for (  LocTuple point : points) {
    mapTree.getViewer().addMapMarker(new MapMarkerDot(Color.BLUE,point.getLatitude(),point.getLongitude()));
  }
}

Fixed version (ground truth):
/** 
 * @param points points to add to the map
 */
public void addPointsToMapTree(LocTuple... points){
  for (  LocTuple point : points) {
    mapTree.getViewer().addMapMarker(new MapMarkerDot(Color.BLUE,point.getLatitude(),point.getLongitude()));
  }
}
Program: 42753
Project: 42753
Buggy source:
public void addLineToMap(LocTuple originPoint,double angle){
  double scalingFactor=0.001;
  double dx=originPoint.getLatitude() + Math.cos(angle) * scalingFactor;
  double dy=originPoint.getLongitude() + Math.sin(angle) * scalingFactor;
  LocTuple endpoint=new LocTuple(originPoint.getLatitude() + dx,originPoint.getLongitude() + dy);
  addLineToMap(originPoint,endpoint);
}

Fixed version (ground truth):
/** 
 * @param originPoint the origin point of the ray
 * @param angle the heading of the ray
 */
public void addLineToMap(LocTuple originPoint,double angle){
  double scalingFactor=0.001;
  double dx=originPoint.getLatitude() + Math.cos(angle) * scalingFactor;
  double dy=originPoint.getLongitude() + Math.sin(angle) * scalingFactor;
  LocTuple endpoint=new LocTuple(originPoint.getLatitude() + dx,originPoint.getLongitude() + dy);
  addLineToMap(originPoint,endpoint);
}
Program: 42754
Project: 42754
Buggy source:
HighTrustLocalizer(){
  wheelOrintation_buggyFrame=0.0;
  buggyFrame_gps_x=0.0;
  buggyFrame_gps_y=0.0;
  buggyFrame_gps_z=0.0;
  wheelOrintation_buggyFrame=0.0;
  new Subscriber(NodeChannel.ENCODER.getMsgPath(),new MessageListener(){
    @Override public void actionPerformed(    String topicName,    Message m){
    }
  }
);
}

Fixed version (ground truth):
HighTrustLocalizer(){
  wheelOrientationBuggyFrame=0.0;
  buggyFrameGpsX=0.0;
  buggyFrameGpsY=0.0;
  buggyFrameGpsZ=0.0;
  wheelOrientationBuggyFrame=0.0;
  new Subscriber(NodeChannel.ENCODER.getMsgPath(),new MessageListener(){
    @Override public void actionPerformed(    String topicName,    Message m){
    }
  }
);
  posePub=new Publisher(NodeChannel.POSE.getMsgPath());
}
Program: 42755
Project: 42755
Buggy source:
/** 
 * Set of all internal private functions 
 */
private Robot(){
  System.out.println("String_Node_Str");
  autonomous=RobobuggyConfigFile.AUTONOMOUS_DEFAULT;
  nodeList=new LinkedList<>();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  nodeList.add(new OdomLocalizer());
  nodeList.add(new ImuNode(NodeChannel.IMU,RobobuggyConfigFile.COM_PORT_IMU));
  nodeList.add(new RBSMNode(NodeChannel.ENCODER,NodeChannel.STEERING,RobobuggyConfigFile.COM_PORT_RBSM,COMMAND_PERIOD));
  nodeList.add(new LoggingNode(NodeChannel.GUI_LOGGING_BUTTON,RobobuggyConfigFile.LOG_FILE_LOCATION,NodeChannel.values()));
  try {
    nodeList.add(new WayPointFollowerPlanner(NodeChannel.UNKNOWN_CHANNEL,WayPointUtil.CreateWayPointsFromWaypointList("String_Node_Str")));
  }
 catch (  FileNotFoundException e1) {
    e1.printStackTrace();
  }
  nodeList.add(new CameraNode(NodeChannel.PUSHBAR_CAMERA,100));
  try {
    Thread.sleep(ARDUINO_BOOTLOADER_TIMEOUT);
  }
 catch (  InterruptedException e) {
    new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
    shutDown();
  }
}

Fixed version (ground truth):
/** 
 * Set of all internal private functions 
 */
private Robot(){
  System.out.println("String_Node_Str");
  autonomous=RobobuggyConfigFile.AUTONOMOUS_DEFAULT;
  nodeList=new LinkedList<>();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  nodeList.add(new OdomLocalizer());
  nodeList.add(new ImuNode(NodeChannel.IMU,RobobuggyConfigFile.COM_PORT_IMU));
  nodeList.add(new RBSMNode(NodeChannel.ENCODER,NodeChannel.STEERING,RobobuggyConfigFile.COM_PORT_RBSM,COMMAND_PERIOD));
  nodeList.add(new LoggingNode(NodeChannel.GUI_LOGGING_BUTTON,RobobuggyConfigFile.LOG_FILE_LOCATION,NodeChannel.values()));
  try {
    nodeList.add(new WayPointFollowerPlanner(NodeChannel.UNKNOWN_CHANNEL,WayPointUtil.createWayPointsFromWaypointList("String_Node_Str")));
  }
 catch (  FileNotFoundException e1) {
    e1.printStackTrace();
  }
  nodeList.add(new CameraNode(NodeChannel.PUSHBAR_CAMERA,100));
  try {
    Thread.sleep(ARDUINO_BOOTLOADER_TIMEOUT);
  }
 catch (  InterruptedException e) {
    new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
    shutDown();
  }
}
Program: 42756
Project: 42756
Buggy source:
/** 
 * @param x
 * @param y
 * @param newOrintation
 */
public So2Pose(double x,double y,double newOrintation){
  location=new Point(x,y);
  orintation=newOrintation;
}

Fixed version (ground truth):
/** 
 * @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;
}
Program: 42757
Project: 42757
Buggy source:
/** 
 * @param postPose the pose that is being applied to the right of the expresion
 */
public So2Pose mult(So2Pose postPose){
  double[][] aM={{Math.cos(orintation),-Math.sin(orintation),getX()},{Math.sin(orintation),Math.cos(orintation),getY()},{0,0,1}};
  double[][] bM={{Math.cos(postPose.orintation),-Math.sin(postPose.orintation),postPose.getX()},{Math.sin(postPose.orintation),Math.cos(postPose.orintation),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 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)));
}
Program: 42758
Project: 42758
Buggy source:
public void updatePoint(Point newPoint,double newOrintation){
  this.orintation=orintation;
  this.location=location;
}

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=newOrientation;
  this.location=newPoint;
}
Program: 42759
Project: 42759
Buggy source:
/** 
 * Constructor for the image message
 * @param newImage the image to transmit
 */
public ImageMessage(BufferedImage newImage,int frameNumber){
  thisImage=newImage;
  this.frameNumber=frameNumber;
}

Fixed version (ground truth):
/** 
 * Constructor for the image message
 * @param newImage the image to transmit;
 * @param frameNumber the frame number
 */
public ImageMessage(BufferedImage newImage,int frameNumber){
  thisImage=newImage;
  this.frameNumber=frameNumber;
}
Program: 42760
Project: 42760
Buggy source:
public int getFrameNumber(){
  return frameNumber;
}

Fixed version (ground truth):
/** 
 * @return the frame number of the image
 */
public int getFrameNumber(){
  return frameNumber;
}
Program: 42761
Project: 42761
Buggy source:
public NodeStatusMessage(Class node,INodeStatus message,JsonObject params){
  this.node=node;
  this.message=message;
  this.params=params;
}

Fixed version (ground truth):
/** 
 * @param node the node reporting the status
 * @param message the status of the node
 * @param params any parameters they want to pass along
 */
public NodeStatusMessage(Class node,INodeStatus message,JsonObject params){
  this.node=node;
  this.message=message;
  this.params=params;
}
Program: 42762
Project: 42762
Buggy source:
public INodeStatus getMessage(){
  return message;
}

Fixed version (ground truth):
/** 
 * @return the status of the node
 */
public INodeStatus getMessage(){
  return message;
}
Program: 42763
Project: 42763
Buggy source:
public Class getNode(){
  return node;
}

Fixed version (ground truth):
/** 
 * @return the node reporting status
 */
public Class getNode(){
  return node;
}
Program: 42764
Project: 42764
Buggy source:
public JsonObject getParams(){
  return params;
}

Fixed version (ground truth):
/** 
 * @return the paramters of the status
 */
public JsonObject getParams(){
  return params;
}
Program: 42765
Project: 42765
Buggy source:
private void predictStep(){
  Date now=new Date();
  Date dt=new Date(now.getTime() - mostRecentUpdateTime.getTime());
  state=mModel.applyMotionModel(state,dt);
  covariance=DF.times(covariance).times(DF.transpose());
}

Fixed version (ground truth):
/** 
 * TODO
 */
private void predictStep(){
  System.out.println("String_Node_Str");
}
Program: 42766
Project: 42766
Buggy source:
protected KfLocalizer(BuggyNode base,int period){
  super(base,period);
  posePub=new Publisher(NodeChannel.POSE.getMsgPath());
  startTime=new Date();
  double[][] startCovariance={{1,0,0},{0,1,0},{0,0,1}};
  covariance=new Matrix(startCovariance);
  state=Util.eye(3);
  mostRecentUpdateTime=startTime;
}

Fixed version (ground truth):
protected KfLocalizer(BuggyNode base,int period){
  super(base,period);
  posePub=new Publisher(NodeChannel.POSE.getMsgPath());
  double[][] startCovariance={{1,0,0},{0,1,0},{0,0,1}};
  covariance=new Matrix(startCovariance);
  state=Util.createIdentityMatrix(3);
}
Program: 42767
Project: 42767
Buggy source:
public void updateStep(Matrix measurement,ObservationModel oModel,Matrix DH){
  predictStep();
  Matrix inovation=measurement.minus(oModel.getObservationSpaceState(state));
  Matrix innovationCovariance=DH.times(covariance).times(DH.transpose());
  Matrix kalmanGain=covariance.times(DH.transpose()).times(innovationCovariance.inverse());
  covariance=(Util.eye(3).minus(kalmanGain.times(DH)).times(covariance));
  state=state.plus(kalmanGain.times(inovation));
  mostRecentUpdateTime=new Date();
}

Fixed version (ground truth):
/** 
 * TODO
 * @param measurement TODO
 * @param oModel TODO
 * @param matrixDH TODO
 */
public void updateStep(Matrix measurement,ObservationModel oModel,Matrix matrixDH){
  predictStep();
  Matrix inovation=measurement.minus(oModel.getObservationSpaceState(state));
  Matrix innovationCovariance=matrixDH.times(covariance).times(matrixDH.transpose());
  Matrix kalmanGain=covariance.times(matrixDH.transpose()).times(innovationCovariance.inverse());
  covariance=(Util.createIdentityMatrix(3).minus(kalmanGain.times(matrixDH)).times(covariance));
  state=state.plus(kalmanGain.times(inovation));
}
Program: 42768
Project: 42768
Buggy source:
/** 
 * Test with null input
 */
@Test public void testNull(){
  Date result=RobobuggyDateFormatter.formatRobobuggyDate("String_Node_Str");
  assertTrue(result != null);
}

Fixed version (ground truth):
/** 
 * Test with null input
 */
@Test public void testNull(){
  Date result=BaseMessage.tryToParseDate("String_Node_Str");
  assertTrue(result != null);
}
Program: 42769
Project: 42769
Buggy source:
/** 
 * Create a new   {@link LoggingNode} decorator
 * @param channel the {@link NodeChannel} of the {@link LoggingNode}
 * @param outputDirPath The path to the output directory (not file)
 * @param filters sensors to log. To log all sensors, just use NodeChannel.values()
 */
public LoggingNode(NodeChannel channel,String outputDirPath,NodeChannel... filters){
  super(new BuggyBaseNode(channel));
  this.filters=filters;
  messageQueue=new LinkedBlockingQueue<>();
  keepLogging=true;
  outputDirectory=new File(outputDirPath);
  setupSubscriberList();
  setupLoggingTrigger();
}

Fixed version (ground truth):
/** 
 * Create a new   {@link LoggingNode} decorator
 * @param channel the {@link NodeChannel} of the {@link LoggingNode}
 * @param outputDirPath The path to the output directory (not file)
 * @param filters sensors to log. To log all sensors, just use NodeChannel.values()
 */
public LoggingNode(NodeChannel channel,String outputDirPath,NodeChannel... filters){
  super(new BuggyBaseNode(channel));
  this.filters=filters;
  messageQueue=new LinkedBlockingQueue<>();
  keepLogging=true;
  outputDirectory=new File(outputDirPath);
  setupSubscriberList();
  if (!RobobuggyConfigFile.DATA_PLAY_BACK) {
    setupLoggingTrigger();
  }
}
Program: 42770
Project: 42770
Buggy source:
/** 
 * Creates the log file, and returns the status Returns false if anything went wrong, but already throws the logic exception
 * @return the status of the operation - true if it succeeded, false if it didn't
 */
private boolean createNewLogFile(){
  if (!outputDirectory.exists() || !outputDirectory.isDirectory()) {
    new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
    return false;
  }
  outputFile=new File(outputDirectory.getPath() + "String_Node_Str" + RobobuggyConfigFile.LOG_FILE_NAME+ "String_Node_Str"+ BaseMessage.formatDate(new Date())+ "String_Node_Str");
  try {
    if (!outputFile.createNewFile()) {
      new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
      return false;
    }
  }
 catch (  IOException e) {
    new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Creates the log file, and returns the status Returns false if anything went wrong, but already throws the logic exception
 * @return the status of the operation - true if it succeeded, false if it didn't
 */
private boolean createNewLogFile(){
  if (!outputDirectory.exists() || !outputDirectory.isDirectory()) {
    new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
    return false;
  }
  outputFile=new File(outputDirectory.getPath() + "String_Node_Str" + RobobuggyConfigFile.LOG_FILE_NAME+ "String_Node_Str"+ formatDateIntoFile(new Date())+ "String_Node_Str");
  try {
    if (!outputFile.createNewFile()) {
      new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
      return false;
    }
  }
 catch (  IOException e) {
    new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
    return false;
  }
  return true;
}
Program: 42771
Project: 42771
Buggy source:
private boolean validateLogFileMetadata(JsonObject logFile){
  if (!logFile.get("String_Node_Str").getAsString().equals(METADATA_NAME)) {
    return false;
  }
  if (logFile.get("String_Node_Str").getAsDouble() != METADATA_SCHEMA_VERSION) {
    return false;
  }
  if (!logFile.get("String_Node_Str").getAsString().equals(METADATA_HIGHLEVEL_SW_VERSION)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean validateLogFileMetadata(JsonObject logFile){
  if (!logFile.get("String_Node_Str").getAsString().equals(METADATA_NAME)) {
    return false;
  }
  if (!logFile.get("String_Node_Str").getAsString().equals(METADATA_SCHEMA_VERSION)) {
    return false;
  }
  if (!logFile.get("String_Node_Str").getAsString().equals(METADATA_HIGHLEVEL_SW_VERSION)) {
    return false;
  }
  return true;
}
Program: 42772
Project: 42772
Buggy source:
/** 
 * Set of all internal private functions 
 */
private Robot(){
  System.out.println("String_Node_Str");
  autonomous=RobobuggyConfigFile.AUTONOMOUS_DEFAULT;
  nodeList=new LinkedList<>();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  nodeList.add(new RBSMNode(NodeChannel.ENCODER,NodeChannel.STEERING,RobobuggyConfigFile.COM_PORT_RBSM,COMMAND_PERIOD));
  nodeList.add(new SweepNode(NodeChannel.BRAKE_CTRL));
  try {
    Thread.sleep(2000);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Set of all internal private functions 
 */
private Robot(){
  System.out.println("String_Node_Str");
  autonomous=RobobuggyConfigFile.AUTONOMOUS_DEFAULT;
  nodeList=new LinkedList<>();
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  nodeList.add(new RBSMNode(NodeChannel.ENCODER,NodeChannel.STEERING,RobobuggyConfigFile.COM_PORT_RBSM,COMMAND_PERIOD));
  nodeList.add(new SweepNode(NodeChannel.BRAKE_CTRL));
  try {
    Thread.sleep(ARDUINO_BOOTLOADER_TIMEOUT);
  }
 catch (  InterruptedException e) {
    new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.EXCEPTION);
  }
}
Program: 42773
Project: 42773
Buggy source:
/** 
 * 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());
  Thread t1=new Thread(new Runnable(){
    boolean sweepUp=false;
    public void run(){
      while (true) {
        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));
        System.out.println("String_Node_Str" + currentCommandedSteeringAngle);
      }
    }
  }
);
  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());
  Thread t1=new Thread(new Runnable(){
    private boolean sweepUp=false;
    public void run(){
      while (true) {
        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));
        System.out.println("String_Node_Str" + currentCommandedSteeringAngle);
      }
    }
  }
);
  t1.start();
}
Program: 42774
Project: 42774
Buggy source:
/** 
 * Set of all internal private functions 
 */
private Robot(){
  System.out.println("String_Node_Str");
  autonomous=RobobuggyConfigFile.AUTONOMOUS_DEFAULT;
  nodeList=new LinkedList<>();
  RobobuggyLogicNotification.setupLogicException(NodeChannel.LOGIC_EXCEPTION);
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  nodeList.add(new RBSMNode(NodeChannel.ENCODER,NodeChannel.STEERING,RobobuggyConfigFile.COM_PORT_RBSM,COMMAND_PERIOD));
}

Fixed version (ground truth):
/** 
 * Set of all internal private functions 
 */
private Robot(){
  System.out.println("String_Node_Str");
  autonomous=RobobuggyConfigFile.AUTONOMOUS_DEFAULT;
  nodeList=new LinkedList<>();
  RobobuggyLogicNotification.setupLogicException(NodeChannel.LOGIC_EXCEPTION);
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  nodeList.add(new GpsNode(NodeChannel.GPS,RobobuggyConfigFile.COM_PORT_GPS));
  nodeList.add(new ImuNode(NodeChannel.IMU,RobobuggyConfigFile.COM_PORT_IMU));
  nodeList.add(new RBSMNode(NodeChannel.ENCODER,NodeChannel.STEERING,RobobuggyConfigFile.COM_PORT_RBSM,COMMAND_PERIOD));
}
Program: 42776
Project: 42776
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public int peel(byte[] buffer,int start,int bytesAvailable){
  if (bytesAvailable < 30) {
    return 0;
  }
  if (buffer[start] != '#') {
    return 1;
  }
  if (buffer[start + 1] != 'Y') {
    return 1;
  }
  if (buffer[start + 2] != 'P') {
    return 1;
  }
  if (buffer[start + 3] != 'R') {
    return 1;
  }
  if (buffer[start + 4] != '=') {
    return 1;
  }
  double[] vals=new double[3];
  String imuRawStr=Arrays.toString(buffer).substring(start + 5,bytesAvailable - 5);
  int origLength=imuRawStr.length();
  for (int i=0; i < 2; i++) {
    int commaIndex=imuRawStr.indexOf(',');
    try {
      Double d=Double.parseDouble(imuRawStr.substring(0,commaIndex));
      vals[i]=d;
    }
 catch (    NumberFormatException nfe) {
      System.out.println("String_Node_Str");
      return 1;
    }
    imuRawStr=imuRawStr.substring(commaIndex + 1);
  }
  int hashIndex=imuRawStr.indexOf('#');
  vals[2]=Double.parseDouble(imuRawStr.substring(0,hashIndex));
  imuRawStr=imuRawStr.substring(hashIndex);
  msgPub.publish(new ImuMeasurement(vals[0],vals[1],vals[2]));
  setNodeState(NodeState.ON);
  return 4 + (origLength - imuRawStr.length());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int peel(byte[] buffer,int start,int bytesAvailable){
  if (bytesAvailable < 30) {
    return 0;
  }
  if (buffer[start] != '#') {
    return 1;
  }
  if (buffer[start + 1] != 'Y') {
    return 1;
  }
  if (buffer[start + 2] != 'P') {
    return 1;
  }
  if (buffer[start + 3] != 'R') {
    return 1;
  }
  if (buffer[start + 4] != '=') {
    return 1;
  }
  double[] vals=new double[3];
  String imuRawStr;
  try {
    imuRawStr=new String(buffer,start + 5,bytesAvailable - 5,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    return 1;
  }
  int origLength=imuRawStr.length();
  for (int i=0; i < 2; i++) {
    int commaIndex=imuRawStr.indexOf(',');
    try {
      Double d=Double.parseDouble(imuRawStr.substring(0,commaIndex));
      vals[i]=d;
    }
 catch (    NumberFormatException nfe) {
      System.out.println("String_Node_Str");
      return 1;
    }
    imuRawStr=imuRawStr.substring(commaIndex + 1);
  }
  int hashIndex=imuRawStr.indexOf('#');
  vals[2]=Double.parseDouble(imuRawStr.substring(0,hashIndex));
  imuRawStr=imuRawStr.substring(hashIndex);
  msgPub.publish(new ImuMeasurement(vals[0],vals[1],vals[2]));
  setNodeState(NodeState.ON);
  return 4 + (origLength - imuRawStr.length());
}
Program: 42777
Project: 42777
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public int peel(byte[] buffer,int start,int bytesAvailable){
  if (bytesAvailable < 80) {
    return 0;
  }
  if (buffer[start] != '#') {
    return 1;
  }
  if (buffer[start + 1] != 'A') {
    return 1;
  }
  if (buffer[start + 2] != 'C') {
    return 1;
  }
  if (buffer[start + 3] != 'G') {
    return 1;
  }
  if (buffer[start + 4] != '=') {
    return 1;
  }
  double[] vals=new double[9];
  String lightingRawStr=Arrays.toString(buffer).substring(start + 5,bytesAvailable - 5);
  int origLength=lightingRawStr.length();
  for (int i=0; i < 8; i++) {
    int commaIndex=lightingRawStr.indexOf(',');
    try {
      vals[i]=Double.parseDouble(lightingRawStr.substring(0,commaIndex));
    }
 catch (    NumberFormatException nfe) {
      System.out.println("String_Node_Str");
      return 1;
    }
    lightingRawStr=lightingRawStr.substring(commaIndex + 1);
  }
  int hashIndex=lightingRawStr.indexOf('#');
  vals[8]=Double.parseDouble(lightingRawStr.substring(0,hashIndex));
  lightingRawStr=lightingRawStr.substring(hashIndex);
  setNodeState(NodeState.ON);
  return 4 + (origLength - lightingRawStr.length());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int peel(byte[] buffer,int start,int bytesAvailable){
  if (bytesAvailable < 80) {
    return 0;
  }
  if (buffer[start] != '#') {
    return 1;
  }
  if (buffer[start + 1] != 'A') {
    return 1;
  }
  if (buffer[start + 2] != 'C') {
    return 1;
  }
  if (buffer[start + 3] != 'G') {
    return 1;
  }
  if (buffer[start + 4] != '=') {
    return 1;
  }
  double[] vals=new double[9];
  String lightingRawStr;
  try {
    lightingRawStr=new String(buffer,start + 5,bytesAvailable - 5,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    return 1;
  }
  int origLength=lightingRawStr.length();
  for (int i=0; i < 8; i++) {
    int commaIndex=lightingRawStr.indexOf(',');
    try {
      vals[i]=Double.parseDouble(lightingRawStr.substring(0,commaIndex));
    }
 catch (    NumberFormatException nfe) {
      System.out.println("String_Node_Str");
      return 1;
    }
    lightingRawStr=lightingRawStr.substring(commaIndex + 1);
  }
  int hashIndex=lightingRawStr.indexOf('#');
  vals[8]=Double.parseDouble(lightingRawStr.substring(0,hashIndex));
  lightingRawStr=lightingRawStr.substring(hashIndex);
  setNodeState(NodeState.ON);
  return 4 + (origLength - lightingRawStr.length());
}
Program: 42778
Project: 42778
Buggy source:
/** 
 * Construct a new   {@link SensorLogger} object
 * @param outputDir {@link File} of the output file directory
 */
public SensorLogger(File outputDir){
  if (outputDir == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (!outputDir.exists()) {
    if (!outputDir.mkdirs())     throw new RuntimeException("String_Node_Str");
  }
  File logFile=new File(outputDir,"String_Node_Str");
  System.out.println("String_Node_Str" + logFile.getAbsolutePath());
  PrintStream log;
  try {
    log=new PrintStream(logFile,"String_Node_Str");
  }
 catch (  FileNotFoundException|UnsupportedEncodingException e) {
    e.printStackTrace();
    throw new RuntimeException("String_Node_Str" + logFile + "String_Node_Str");
  }
  logQueue=startLoggingThread(log);
  Gui.getInstance().getControlPanel().getLoggingPanel().setFileName(outputDir + "String_Node_Str");
  for (  NodeChannel channel : NodeChannel.values()) {
    new Subscriber(channel.getMsgPath(),(topicName,m) -> logQueue.offer(topicName + "String_Node_Str" + m.toLogString()));
  }
}

Fixed version (ground truth):
public SensorLogger(File outputDir){
  if (outputDir == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (!outputDir.exists()) {
    if (!outputDir.mkdirs())     throw new RuntimeException("String_Node_Str");
  }
  File logFile=new File(outputDir,"String_Node_Str");
  System.out.println("String_Node_Str" + logFile.getAbsolutePath());
  PrintStream log;
  try {
    log=new PrintStream(logFile,"String_Node_Str");
  }
 catch (  FileNotFoundException|UnsupportedEncodingException e) {
    e.printStackTrace();
    throw new RuntimeException("String_Node_Str" + logFile + "String_Node_Str");
  }
  logQueue=startLoggingThread(log);
  Gui.getInstance().getControlPanel().getLoggingPanel().setFileName(outputDir + "String_Node_Str");
  for (  NodeChannel channel : NodeChannel.values()) {
    new Subscriber(channel.getMsgPath(),new MessageListener(){
      @Override public void actionPerformed(      String topicName,      Message m){
        logQueue.offer(topicName + "String_Node_Str" + m.toLogString());
      }
    }
);
  }
}
Program: 42779
Project: 42779
Buggy source:
/** 
 * Set of all internal private functions 
 */
private Robot(){
  System.out.println("String_Node_Str");
  autonomous=RobobuggyConfigFile.AUTONOMOUS_DEFAULT;
  nodeList=new LinkedList<>();
  RobobuggyLogicNotification.setupLogicException(NodeChannel.LOGIC_EXCEPTION);
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  nodeList.add(new GpsNode(NodeChannel.GPS,RobobuggyConfigFile.COM_PORT_GPS));
  nodeList.add(new ImuNode(NodeChannel.IMU,RobobuggyConfigFile.COM_PORT_IMU));
  nodeList.add(new RBSMNode(NodeChannel.ENCODER,NodeChannel.STEERING,RobobuggyConfigFile.COM_PORT_RBSM,COMMAND_PERIOD));
}

Fixed version (ground truth):
/** 
 * Set of all internal private functions 
 */
private Robot(){
  System.out.println("String_Node_Str");
  autonomous=RobobuggyConfigFile.AUTONOMOUS_DEFAULT;
  nodeList=new LinkedList<>();
  RobobuggyLogicNotification.setupLogicException(NodeChannel.LOGIC_EXCEPTION);
  new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
  nodeList.add(new RBSMNode(NodeChannel.ENCODER,NodeChannel.STEERING,RobobuggyConfigFile.COM_PORT_RBSM,COMMAND_PERIOD));
}
Program: 42780
Project: 42780
Buggy source:
/** 
 * Used to send the commanded angle and brake state to the Arduino.  {@inheritDoc}
 */
@Override protected void update(){
  RBSMessage msg=new RBSMessage(commandedAngle,commandedBrakeEngaged);
  send(msg.getMessageBytes());
}

Fixed version (ground truth):
/** 
 * Used to send the commanded angle and brake state to the Arduino.  {@inheritDoc}
 */
@Override protected void update(){
  commandedAngle=(short)((commandedAngle + 1) % 256);
  System.out.println("String_Node_Str" + commandedAngle);
  RBSMessage msg=new RBSMessage(commandedAngle,commandedBrakeEngaged);
  send(msg.getMessageBytes());
}
Program: 42781
Project: 42781
Buggy source:
/** 
 * Constructs a new   {@link RobobuggyLogicNotification}
 * @param exception description of the exception that occurred
 * @param level {@link RobobuggyMessageLevel} of the{@link RobobuggyLogicNotification}
 */
public RobobuggyLogicNotification(String exception,RobobuggyMessageLevel level){
  if (shouldMessageBeDisplayed(level)) {
    System.out.println(exception);
  }
  if (errorPub == null) {
    setupLogicException();
  }
  errorPub.publish(new RobobuggyLogicNotificationMeasurment(exception,level));
  if (level == RobobuggyMessageLevel.EXCEPTION) {
  }
}

Fixed version (ground truth):
/** 
 * Constructs a new   {@link RobobuggyLogicNotification}
 * @param exception description of the exception that occurred
 * @param level {@link RobobuggyMessageLevel} of the{@link RobobuggyLogicNotification}
 */
public RobobuggyLogicNotification(String exception,RobobuggyMessageLevel level){
  if (shouldMessageBeDisplayed(level)) {
    System.out.println(exception);
  }
  if (errorPub == null) {
    setupLogicException();
  }
  errorPub.publish(new RobobuggyLogicNotificationMeasurment(exception,level));
}
Program: 42782
Project: 42782
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public int peel(byte[] buffer,int start,int bytesAvailable){
  RBPair rbp=RBSerial.peel(buffer,start,bytesAvailable);
switch (rbp.getNumberOfBytesRead()) {
case 0:
    return 0;
case 1:
  return 1;
case 6:
break;
default :
System.out.println("String_Node_Str");
break;
}
RBSerialMessage message=rbp.getMessage();
byte headerByte=message.getHeaderByte();
switch (headerByte) {
case RBSerialMessage.ENC_TICK_SINCE_RESET:
int encoderReading=message.getDataWord();
maxEncoder=Integer.max(encoderReading,maxEncoder);
System.out.println("String_Node_Str" + maxEncoder + "String_Node_Str"+ encoderReading);
encTicks=message.getDataWord() & 0xFFFF;
messagePubEnc.publish(estimateVelocity(message.getDataWord()));
break;
case RBSerialMessage.RBSM_MID_MEGA_STEER_FEEDBACK:
potValue=message.getDataWord();
System.out.println(potValue);
messagePubPot.publish(new SteeringMeasurement(-(potValue + OFFSET) / ARD_TO_DEG));
break;
case RBSerialMessage.RBSM_MID_MEGA_STEER_ANGLE:
steeringAngle=message.getDataWord();
messagePubControllerSteering.publish(new SteeringMeasurement(steeringAngle));
break;
case RBSerialMessage.FP_HASH:
System.out.println(message.getDataWord());
messagePubFp.publish(new FingerPrintMessage(message.getDataWord()));
break;
default :
new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
break;
}
setNodeState(NodeState.ON);
return 6;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int peel(byte[] buffer,int start,int bytesAvailable){
  RBPair rbp=RBSerial.peel(buffer,start,bytesAvailable);
switch (rbp.getNumberOfBytesRead()) {
case 0:
    return 0;
case 1:
  return 1;
case 6:
break;
default :
System.out.println("String_Node_Str");
break;
}
RBSerialMessage message=rbp.getMessage();
byte headerByte=message.getHeaderByte();
switch (headerByte) {
case RBSerialMessage.ENC_TICK_SINCE_RESET:
encTicks=message.getDataWord() & 0xFFFF;
messagePubEnc.publish(estimateVelocity(message.getDataWord()));
break;
case RBSerialMessage.RBSM_MID_MEGA_STEER_FEEDBACK:
potValue=message.getDataWord();
System.out.println(potValue);
messagePubPot.publish(new SteeringMeasurement(-(potValue + OFFSET) / ARD_TO_DEG));
break;
case RBSerialMessage.RBSM_MID_MEGA_STEER_ANGLE:
steeringAngle=message.getDataWord();
messagePubControllerSteering.publish(new SteeringMeasurement(steeringAngle));
break;
case RBSerialMessage.FP_HASH:
System.out.println(message.getDataWord());
messagePubFp.publish(new FingerPrintMessage(message.getDataWord()));
break;
default :
new RobobuggyLogicNotification("String_Node_Str",RobobuggyMessageLevel.NOTE);
break;
}
setNodeState(NodeState.ON);
return 6;
}