Program: 42618
Project: 42618
Buggy source:
/** 
 * initializes a new Map with cache loaded
 */
public Map(){
  initMapTree();
  addCacheToTree();
  this.add(getMapTree());
  currentWaypoint.setColor(Color.BLUE);
  getMapTree().getViewer().addMapMarker(currentWaypoint);
  getMapTree().getViewer().addMapPolygon(currentHeading);
  new Subscriber("String_Node_Str",NodeChannel.POSE.getMsgPath(),new MessageListener(){
    @Override public void actionPerformed(    String topicName,    Message m){
      GPSPoseMessage gpsM=(GPSPoseMessage)m;
      zoomLevel=getMapTree().getViewer().getZoom();
      getMapTree().getViewer().setDisplayPosition(new Coordinate(gpsM.getLatitude(),gpsM.getLongitude()),zoomLevel);
      addPointsToMapTree(Color.RED,new LocTuple(gpsM.getLatitude(),gpsM.getLongitude()));
      getMapTree().getViewer().removeMapMarker(currentWaypoint);
      currentWaypoint.setLat(WayPointFollowerPlanner.currentWaypoint.getLatitude());
      currentWaypoint.setLon(WayPointFollowerPlanner.currentWaypoint.getLongitude());
      getMapTree().getViewer().addMapMarker(currentWaypoint);
      getMapTree().getViewer().removeMapPolygon(currentHeading);
      currentHeading=new MapPolygonImpl(new Coordinate(WayPointFollowerPlanner.currentWaypoint.getLatitude(),WayPointFollowerPlanner.currentWaypoint.getLongitude()),new Coordinate(WayPointFollowerPlanner.currentWaypoint.getLatitude() + 0.001 * Math.sin(WayPointFollowerPlanner.currentCommandedAngle),WayPointFollowerPlanner.currentWaypoint.getLongitude() + 0.001 * Math.cos(WayPointFollowerPlanner.currentCommandedAngle)),new Coordinate(WayPointFollowerPlanner.currentWaypoint.getLatitude(),WayPointFollowerPlanner.currentWaypoint.getLongitude()));
      getMapTree().getViewer().addMapPolygon(currentHeading);
    }
  }
);
  new Subscriber("String_Node_Str",NodeChannel.GPS.getMsgPath(),((topicName,m) -> {
    GpsMeasurement gps=((GpsMeasurement)m);
    addPointsToMapTree(Color.BLACK,new LocTuple(gps.getLatitude(),gps.getLongitude()));
  }
));
}

Fixed version (ground truth):
/** 
 * initializes a new Map with cache loaded
 */
public Map(){
  initMapTree();
  addCacheToTree();
  this.add(getMapTree());
  currentWaypoint.setColor(Color.BLUE);
  getMapTree().getViewer().addMapMarker(currentWaypoint);
  getMapTree().getViewer().addMapPolygon(currentHeadingMapObj);
  new Subscriber("String_Node_Str",NodeChannel.POSE.getMsgPath(),new MessageListener(){
    @Override public void actionPerformed(    String topicName,    Message m){
      GPSPoseMessage gpsM=(GPSPoseMessage)m;
      zoomLevel=getMapTree().getViewer().getZoom();
      getMapTree().getViewer().setDisplayPosition(new Coordinate(gpsM.getLatitude(),gpsM.getLongitude()),zoomLevel);
      addPointsToMapTree(Color.RED,new LocTuple(gpsM.getLatitude(),gpsM.getLongitude()));
      getMapTree().getViewer().removeMapMarker(currentWaypoint);
      currentWaypoint.setLat(WayPointFollowerPlanner.currentWaypoint.getLatitude());
      currentWaypoint.setLon(WayPointFollowerPlanner.currentWaypoint.getLongitude());
      getMapTree().getViewer().addMapMarker(currentWaypoint);
      double currentHeading=gpsM.getCurrentState().get(3,0);
      getMapTree().getViewer().removeMapPolygon(currentHeadingMapObj);
      currentHeadingMapObj=new MapPolygonImpl(new Coordinate(gpsM.getLatitude(),gpsM.getLongitude()),new Coordinate(gpsM.getLatitude() + 0.0001 * Math.sin(WayPointFollowerPlanner.currentCommandedAngle + currentHeading),gpsM.getLongitude() + 0.0001 * Math.cos(WayPointFollowerPlanner.currentCommandedAngle + currentHeading)),new Coordinate(gpsM.getLatitude(),gpsM.getLongitude()));
      getMapTree().getViewer().addMapPolygon(currentHeadingMapObj);
    }
  }
);
  new Subscriber("String_Node_Str",NodeChannel.GPS.getMsgPath(),((topicName,m) -> {
    GpsMeasurement gps=((GpsMeasurement)m);
    addPointsToMapTree(Color.BLACK,new LocTuple(gps.getLatitude(),gps.getLongitude()));
  }
));
}