nus-yam/ex-repair huggingface dataset:
Program: 95182
Project: 95182
Buggy source:
public RadioButtonCenter(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  final TypedArray attributes=context.obtainStyledAttributes(attrs,R.styleable.RadioButtonCenter,defStyle,0);
  try {
    mButtonDrawable=attributes.getDrawable(R.styleable.RadioButtonCenter_android_button);
  }
  finally {
    attributes.recycle();
  }
}

Fixed version (ground truth):
public RadioButtonCenter(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  final TypedArray attributes=context.obtainStyledAttributes(attrs,R.styleable.RadioButtonCenter,defStyle,0);
  try {
    mButtonDrawable=attributes.getDrawable(R.styleable.RadioButtonCenter_android_button);
  }
  finally {
    attributes.recycle();
  }
  setButtonDrawable(android.R.color.transparent);
}
Program: 95183
Project: 95183
Buggy source:
@Override public void onDroneEvent(DroneEventsType event,Drone drone){
switch (event) {
case NAVIGATION:
    break;
case ORIENTATION:
  onOrientationUpdate(drone);
break;
case SPEED:
onSpeedAltitudeAndClimbRateUpdate(drone);
break;
default :
break;
}
}

Fixed version (ground truth):
@Override public void onDroneEvent(DroneEventsType event,Drone drone){
switch (event) {
case NAVIGATION:
    break;
case ATTITUDE:
  onOrientationUpdate(drone);
break;
case SPEED:
onSpeedAltitudeAndClimbRateUpdate(drone);
break;
default :
break;
}
}
Program: 95184
Project: 95184
Buggy source:
public void setRollPitchYaw(double roll,double pitch,double yaw){
  this.roll=roll;
  this.pitch=pitch;
  this.yaw=yaw;
  myDrone.events.notifyDroneEvent(DroneEventsType.ATTIUTDE);
}

Fixed version (ground truth):
public void setRollPitchYaw(double roll,double pitch,double yaw){
  this.roll=roll;
  this.pitch=pitch;
  this.yaw=yaw;
  myDrone.events.notifyDroneEvent(DroneEventsType.ATTITUDE);
}
Program: 95185
Project: 95185
Buggy source:
private void updateROI(){
  Log.d("String_Node_Str","String_Node_Str");
  if (realLocation == null) {
    return;
  }
  Coord2D gcsCoord=new Coord2D(realLocation.getLatitude(),realLocation.getLongitude());
  float bearing=realLocation.getBearing();
  float distanceTraveledSinceLastPoint=realLocation.getSpeed() * (System.currentTimeMillis() - timeOfLastLocation) / 1000;
  Coord2D goCoord=GeoTools.newCoordFromBearingAndDistance(gcsCoord,bearing,distanceTraveledSinceLastPoint);
  double latitude=goCoord.getLat();
  double longitude=goCoord.getLng();
  Location newLocation=new Location(realLocation);
  newLocation.setLatitude(latitude);
  newLocation.setLongitude(longitude);
  newLocation.setBearing(bearing);
  MavLinkROI.setROI(drone,new Coord3D(newLocation.getLatitude(),newLocation.getLongitude(),new Altitude(0.0)));
  watchdog.postDelayed(watchdogCallback,TIMEOUT);
}

Fixed version (ground truth):
private void updateROI(){
  if (realLocation == null) {
    return;
  }
  Coord2D gcsCoord=new Coord2D(realLocation.getLatitude(),realLocation.getLongitude());
  float bearing=realLocation.getBearing();
  float distanceTraveledSinceLastPoint=realLocation.getSpeed() * (System.currentTimeMillis() - timeOfLastLocation) / 1000f;
  Coord2D goCoord=GeoTools.newCoordFromBearingAndDistance(gcsCoord,bearing,distanceTraveledSinceLastPoint);
  double latitude=goCoord.getLat();
  double longitude=goCoord.getLng();
  Location newLocation=new Location(realLocation);
  newLocation.setLatitude(latitude);
  newLocation.setLongitude(longitude);
  newLocation.setBearing(bearing);
  if (distanceTraveledSinceLastPoint > 0.05) {
    MavLinkROI.setROI(drone,new Coord3D(newLocation.getLatitude(),newLocation.getLongitude(),new Altitude(0.0)));
  }
  watchdog.postDelayed(watchdogCallback,TIMEOUT);
}
Program: 95186
Project: 95186
Buggy source:
@Override public void onDisconnect(){
  couldNotOpenConnection=true;
  selfDestryService();
}

Fixed version (ground truth):
@Override public void onDisconnect(){
  couldNotOpenConnection=true;
  selfDestroyService();
}
Program: 95187
Project: 95187
Buggy source:
private void disableFollowMe(){
  if (followMeEnabled) {
    Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
    followMeEnabled=false;
    Log.d("String_Node_Str","String_Node_Str");
  }
  mLocationClient.removeLocationUpdates(this);
}

Fixed version (ground truth):
private void disableFollowMe(){
  if (followMeEnabled) {
    Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
    followMeEnabled=false;
    Log.d("String_Node_Str","String_Node_Str");
  }
  if (mLocationClient.isConnected())   mLocationClient.removeLocationUpdates(this);
}
Program: 95188
Project: 95188
Buggy source:
@Override public void onDisconnect(){
  couldNotOpenConnection=true;
  selfDestryService();
}

Fixed version (ground truth):
@Override public void onDisconnect(){
  couldNotOpenConnection=true;
  selfDestroyService();
}
Program: 95189
Project: 95189
Buggy source:
private void disableFollowMe(){
  if (followMeEnabled) {
    Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
    followMeEnabled=false;
    Log.d("String_Node_Str","String_Node_Str");
  }
  mLocationClient.removeLocationUpdates(this);
}

Fixed version (ground truth):
private void disableFollowMe(){
  if (followMeEnabled) {
    Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
    followMeEnabled=false;
    Log.d("String_Node_Str","String_Node_Str");
  }
  if (mLocationClient.isConnected())   mLocationClient.removeLocationUpdates(this);
}
Program: 95190
Project: 95190
Buggy source:
@Override public void onDroneEvent(DroneEventsType event,Drone drone){
switch (event) {
case MODE:
    if ((drone.state.getMode() != ApmModes.ROTOR_GUIDED)) {
      disableFollowMe();
    }
  break;
default :
return;
}
}

Fixed version (ground truth):
@Override public void onDroneEvent(DroneEventsType event,Drone drone){
switch (event) {
case MODE:
    if ((drone.state.getMode() != ApmModes.ROTOR_GUIDED)) {
      disableFollowMe();
    }
  break;
case DISCONNECTED:
disableFollowMe();
break;
default :
return;
}
}
Program: 95191
Project: 95191
Buggy source:
@Override public void onListVisibilityChanged(){
}

Fixed version (ground truth):
@Override public void onListVisibilityChanged(){
  updateMapPadding();
}
Program: 95195
Project: 95195
Buggy source:
public void onFailsafeChanged(Drone drone){
  if (drone.state.isFailsafe()) {
    failsafeTextView.setVisibility(View.VISIBLE);
  }
 else {
    failsafeTextView.setVisibility(View.GONE);
  }
}

Fixed version (ground truth):
public void onFailsafeChanged(Drone drone){
  if (drone.state.isFailsafe()) {
    failsafeView.setVisibility(View.VISIBLE);
  }
 else {
    failsafeView.setVisibility(View.GONE);
  }
}
Program: 95198
Project: 95198
Buggy source:
@Override public void onDroneEvent(DroneInterfaces.DroneEventsType event,Drone drone){
switch (event) {
case MODE:
    sendDataToWatch(KEY_MODE,drone.state.getMode().getName());
  break;
case BATTERY:
sendTelem(drone);
break;
case SPEED:
sendTelem(drone);
break;
default :
break;
}
}

Fixed version (ground truth):
@Override public void onDroneEvent(DroneInterfaces.DroneEventsType event,Drone drone){
switch (event) {
case MODE:
    sendDataToWatchNow(drone);
  break;
case BATTERY:
sendDataToWatchIfTimeHasElapsed(drone);
break;
case SPEED:
sendDataToWatchIfTimeHasElapsed(drone);
break;
default :
break;
}
}
Program: 95199
Project: 95199
Buggy source:
private void maxVolumeIfEnabled(){
  if (mAppPrefs.keepScreenOn()) {
    AudioManager audioManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
    audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC),0);
  }
}

Fixed version (ground truth):
private void maxVolumeIfEnabled(){
  if (mAppPrefs.maxVolumeOnStart()) {
    AudioManager audioManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
    audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC),0);
  }
}
Program: 95200
Project: 95200
Buggy source:
@Override public void run(){
  super.run();
  try {
    parser.stats.mavlinkResetStats();
    openConnection();
    GAUtils.startNewSession(parentContext);
    logFile=FileStream.getTLogFile();
    logWriter=FileStream.openOutputStream(logFile);
    logBuffer=ByteBuffer.allocate(Long.SIZE / Byte.SIZE);
    logBuffer.order(ByteOrder.BIG_ENDIAN);
    String login=prefs.getDroneshareLogin();
    String password=prefs.getDronesharePassword();
    if (prefs.getLiveUploadEnabled() && !login.isEmpty() && !password.isEmpty()) {
      Log.i(TAG,"String_Node_Str");
      uploader=new DroneshareClient();
      uploader.connect(login,password);
    }
 else {
      Log.w(TAG,"String_Node_Str");
    }
    while (connected) {
      readDataBlock();
      handleData();
    }
  }
 catch (  FileNotFoundException e) {
    listener.onComError(e.getMessage());
    e.printStackTrace();
  }
catch (  IOException e) {
    if (connected) {
      listener.onComError(e.getMessage());
      e.printStackTrace();
    }
  }
 finally {
    try {
      if (logWriter != null) {
        logWriter.close();
        logWriter=null;
        FileStream.commitFile(logFile);
        parentContext.startService(UploaderService.createIntent(parentContext));
      }
      if (uploader != null)       uploader.close();
      closeConnection();
    }
 catch (    IOException e) {
    }
  }
  listener.onDisconnect();
}

Fixed version (ground truth):
@Override public void run(){
  super.run();
  try {
    parser.stats.mavlinkResetStats();
    openConnection();
    GAUtils.startNewSession(parentContext);
    logFile=FileStream.getTLogFile();
    logWriter=FileStream.openOutputStream(logFile);
    logBuffer=ByteBuffer.allocate(4 * Long.SIZE / Byte.SIZE);
    logBuffer.order(ByteOrder.BIG_ENDIAN);
    String login=prefs.getDroneshareLogin();
    String password=prefs.getDronesharePassword();
    if (prefs.getLiveUploadEnabled() && !login.isEmpty() && !password.isEmpty()) {
      Log.i(TAG,"String_Node_Str");
      uploader=new DroneshareClient();
      uploader.connect(login,password);
    }
 else {
      Log.w(TAG,"String_Node_Str");
    }
    while (connected) {
      readDataBlock();
      handleData();
    }
  }
 catch (  FileNotFoundException e) {
    listener.onComError(e.getMessage());
    e.printStackTrace();
  }
catch (  IOException e) {
    if (connected) {
      listener.onComError(e.getMessage());
      e.printStackTrace();
    }
  }
 finally {
    try {
      if (logWriter != null) {
        logWriter.close();
        logWriter=null;
        FileStream.commitFile(logFile);
        parentContext.startService(UploaderService.createIntent(parentContext));
      }
      if (uploader != null)       uploader.close();
      closeConnection();
    }
 catch (    IOException e) {
    }
  }
  listener.onDisconnect();
}
Program: 95201
Project: 95201
Buggy source:
private void saveToLog(MAVLinkPacket receivedPacket) throws IOException {
  if (logWriter != null) {
    try {
      logBuffer.clear();
      long time=System.currentTimeMillis() * 1000;
      logBuffer.putLong(time);
      byte[] bytes=receivedPacket.encodePacket();
      logWriter.write(logBuffer.array());
      logWriter.write(bytes);
      if (uploader != null)       uploader.filterMavlink(uploader.interfaceNum,bytes);
    }
 catch (    IOException e) {
      Log.e(TAG,"String_Node_Str" + e);
    }
catch (    NullPointerException e) {
      Log.e(TAG,"String_Node_Str" + e);
    }
  }
}

Fixed version (ground truth):
private void saveToLog(MAVLinkPacket receivedPacket) throws IOException {
  if (logWriter != null) {
    try {
      logBuffer.clear();
      long time=System.currentTimeMillis() * 1000;
      logBuffer.putLong(time);
      byte[] bytes=receivedPacket.encodePacket();
      logWriter.write(logBuffer.array());
      logWriter.write(bytes);
      if (uploader != null)       uploader.filterMavlink(uploader.interfaceNum,bytes);
    }
 catch (    IOException e) {
      Log.e(TAG,"String_Node_Str" + e);
    }
catch (    BufferOverflowException e) {
      Log.e(TAG,"String_Node_Str" + e);
    }
catch (    NullPointerException e) {
      Log.e(TAG,"String_Node_Str" + e);
    }
  }
}
Program: 95202
Project: 95202
Buggy source:
@Override public List<LatLng> getPathPoints(){
  List<LatLng> pathPoints=new ArrayList<LatLng>();
  LatLng lastPoint=null;
  for (  MissionItemRender missionItem : mMissionItems) {
    pathPoints.addAll(missionItem.getPath(lastPoint));
    lastPoint=pathPoints.get(pathPoints.size() - 1);
  }
  return pathPoints;
}

Fixed version (ground truth):
@Override public List<LatLng> getPathPoints(){
  List<LatLng> pathPoints=new ArrayList<LatLng>();
  LatLng lastPoint=null;
  for (  MissionItemRender missionItem : mMissionItems) {
    pathPoints.addAll(missionItem.getPath(lastPoint));
    if (pathPoints.size() > 0) {
      lastPoint=pathPoints.get(pathPoints.size() - 1);
    }
 else {
      lastPoint=null;
    }
  }
  return pathPoints;
}
Program: 95203
Project: 95203
Buggy source:
private void addItemDetail(MissionItemRender item){
  itemDetailFragment=item.getDetailFragment();
  if (itemDetailFragment == null)   return;
  if (mContainerItemDetail == null) {
    itemDetailFragment.show(fragmentManager,"String_Node_Str");
  }
 else {
    fragmentManager.beginTransaction().replace(R.id.containerItemDetail,itemDetailFragment).commit();
  }
}

Fixed version (ground truth):
private void addItemDetail(final MissionItemRender item){
  itemDetailFragment=item.getDetailFragment();
  if (itemDetailFragment == null)   return;
  if (mContainerItemDetail == null) {
    itemDetailFragment.show(fragmentManager,ITEM_DETAIL_TAG);
  }
 else {
    fragmentManager.beginTransaction().replace(R.id.containerItemDetail,itemDetailFragment,ITEM_DETAIL_TAG).commit();
  }
}
Program: 95204
Project: 95204
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_editor);
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  fragmentManager=getSupportFragmentManager();
  planningMapFragment=((EditorMapFragment)fragmentManager.findFragmentById(R.id.mapFragment));
  gestureMapFragment=((GestureMapFragment)fragmentManager.findFragmentById(R.id.gestureMapFragment));
  editorToolsFragment=(EditorToolsFragment)fragmentManager.findFragmentById(R.id.editorToolsFragment);
  missionListFragment=(EditorListFragment)fragmentManager.findFragmentById(R.id.missionFragment1);
  infoView=(TextView)findViewById(R.id.editorInfoWindow);
  mContainerItemDetail=findViewById(R.id.containerItemDetail);
  missionRender=((DroidPlannerApp)getApplication()).missionRender;
  gestureMapFragment.setOnPathFinishedListener(this);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_editor);
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  fragmentManager=getSupportFragmentManager();
  planningMapFragment=((EditorMapFragment)fragmentManager.findFragmentById(R.id.mapFragment));
  gestureMapFragment=((GestureMapFragment)fragmentManager.findFragmentById(R.id.gestureMapFragment));
  editorToolsFragment=(EditorToolsFragment)fragmentManager.findFragmentById(R.id.editorToolsFragment);
  missionListFragment=(EditorListFragment)fragmentManager.findFragmentById(R.id.missionFragment1);
  infoView=(TextView)findViewById(R.id.editorInfoWindow);
  itemDetailFragment=(MissionDetailFragment)fragmentManager.findFragmentByTag(ITEM_DETAIL_TAG);
  mContainerItemDetail=findViewById(R.id.containerItemDetail);
  missionRender=((DroidPlannerApp)getApplication()).missionRender;
  gestureMapFragment.setOnPathFinishedListener(this);
}
Program: 95205
Project: 95205
Buggy source:
@Override public void onItemClick(MissionItemRender item){
switch (editorToolsFragment.getTool()) {
default :
    if (contextualActionBar != null) {
      if (missionRender.selection.selectionContains(item)) {
        missionRender.selection.removeItemFromSelection(item);
      }
 else {
        missionRender.selection.addToSelection(item);
      }
    }
 else {
      if (missionRender.selection.selectionContains(item)) {
        missionRender.selection.clearSelection();
      }
 else {
        editorToolsFragment.setTool(EditorTools.NONE);
        missionRender.selection.setSelectionTo(item);
      }
    }
  break;
case TRASH:
missionRender.removeItem(item);
missionRender.selection.clearSelection();
if (missionRender.getItems().size() <= 0) {
editorToolsFragment.setTool(EditorTools.NONE);
}
break;
}
}

Fixed version (ground truth):
@Override public void onItemClick(MissionItemRender item){
switch (getTool()) {
default :
    if (contextualActionBar != null) {
      if (missionRender.selection.selectionContains(item)) {
        missionRender.selection.removeItemFromSelection(item);
      }
 else {
        missionRender.selection.addToSelection(item);
      }
    }
 else {
      if (missionRender.selection.selectionContains(item)) {
        missionRender.selection.clearSelection();
      }
 else {
        editorToolsFragment.setTool(EditorTools.NONE);
        missionRender.selection.setSelectionTo(item);
      }
    }
  break;
case TRASH:
missionRender.removeItem(item);
missionRender.selection.clearSelection();
if (missionRender.getItems().size() <= 0) {
editorToolsFragment.setTool(EditorTools.NONE);
}
break;
}
}
Program: 95206
Project: 95206
Buggy source:
public void onWaypointTypeChanged(MissionItemRender newItem,MissionItemRender oldItem);

Fixed version (ground truth):
/** 
 * Notifies the listener that the mission item proxy was changed.
 * @param newItem previous mission item proxy
 * @param oldItem new mission item proxy
 */
public void onWaypointTypeChanged(MissionItemRender newItem,MissionItemRender oldItem);
Program: 95207
Project: 95207
Buggy source:
@Override public void onAttach(Activity activity){
  super.onAttach(activity);
  mListener=(OnWayPointTypeChangeListener)activity;
}

Fixed version (ground truth):
@Override public void onAttach(Activity activity){
  super.onAttach(activity);
  if (!(activity instanceof OnMissionDetailListener)) {
    throw new IllegalStateException("String_Node_Str" + OnMissionDetailListener.class.getName());
  }
  mListener=(OnMissionDetailListener)activity;
}
Program: 95208
Project: 95208
Buggy source:
@Override public void editorToolChanged(EditorTools tools){
  missionRender.selection.clearSelection();
switch (tools) {
case DRAW:
case POLY:
    Toast.makeText(this,R.string.draw_the_survey_region,Toast.LENGTH_SHORT).show();
  gestureMapFragment.enableGestureDetection();
break;
case MARKER:
case TRASH:
case NONE:
gestureMapFragment.disableGestureDetection();
break;
}
}

Fixed version (ground truth):
@Override public void editorToolChanged(EditorTools tools){
  missionRender.selection.clearSelection();
  setupTool(tools);
}
Program: 95209
Project: 95209
Buggy source:
@Override public void onClick(View v){
  EditorTools newTool=EditorTools.NONE;
switch (v.getId()) {
case R.id.editor_tools_marker:
    newTool=EditorTools.MARKER;
  break;
case R.id.editor_tools_draw:
newTool=EditorTools.DRAW;
break;
case R.id.editor_tools_poly:
newTool=EditorTools.POLY;
break;
case R.id.editor_tools_trash:
newTool=EditorTools.TRASH;
break;
}
if (newTool == this.tool) {
newTool=EditorTools.NONE;
mEditorRadioGroup.clearCheck();
}
setTool(newTool);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  EditorTools newTool=getToolForView(v.getId());
  if (newTool == this.tool) {
    newTool=EditorTools.NONE;
    mEditorRadioGroup.clearCheck();
  }
  setTool(newTool);
}
Program: 95210
Project: 95210
Buggy source:
@Override public boolean onLongClick(View v){
  EditorTools newTool=EditorTools.NONE;
switch (v.getId()) {
case R.id.editor_tools_marker:
    newTool=EditorTools.MARKER;
  break;
case R.id.editor_tools_draw:
newTool=EditorTools.DRAW;
break;
case R.id.editor_tools_poly:
newTool=EditorTools.POLY;
break;
case R.id.editor_tools_trash:
newTool=EditorTools.TRASH;
break;
}
if (newTool != EditorTools.NONE) {
listener.editorToolLongClicked(newTool);
}
return false;
}

Fixed version (ground truth):
@Override public boolean onLongClick(View v){
  EditorTools newTool=getToolForView(v.getId());
  if (newTool != EditorTools.NONE) {
    listener.editorToolLongClicked(newTool);
  }
  return false;
}
Program: 95211
Project: 95211
Buggy source:
@Override public void onAttach(Activity activity){
  super.onAttach(activity);
  listener=(OnEditorToolSelected)activity;
}

Fixed version (ground truth):
@Override public void onAttach(Activity activity){
  super.onAttach(activity);
  if (!(activity instanceof OnEditorToolSelected)) {
    throw new IllegalStateException("String_Node_Str" + OnEditorToolSelected.class.getName());
  }
  listener=(OnEditorToolSelected)activity;
}
Program: 95212
Project: 95212
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_editor_tools,container,false);
  mEditorRadioGroup=(RadioGroup)view.findViewById(R.id.editor_tools_layout);
  final RadioButtonCenter buttonDraw=(RadioButtonCenter)view.findViewById(R.id.editor_tools_draw);
  final RadioButtonCenter buttonMarker=(RadioButtonCenter)view.findViewById(R.id.editor_tools_marker);
  final RadioButtonCenter buttonPoly=(RadioButtonCenter)view.findViewById(R.id.editor_tools_poly);
  final RadioButtonCenter buttonTrash=(RadioButtonCenter)view.findViewById(R.id.editor_tools_trash);
  for (  View vv : new View[]{buttonDraw,buttonMarker,buttonPoly,buttonTrash}) {
    vv.setOnClickListener(this);
    vv.setOnLongClickListener(this);
  }
  mEditorRadioGroup.check(R.id.editor_tools_marker);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.fragment_editor_tools,container,false);
}
Program: 95213
Project: 95213
Buggy source:
public void setTool(EditorTools tool){
  this.tool=tool;
  if (tool == EditorTools.NONE) {
    mEditorRadioGroup.clearCheck();
  }
  listener.editorToolChanged(this.tool);
}

Fixed version (ground truth):
/** 
 * Updates the selected tool, and optionally notify listeners.
 * @param tool selected tool.
 * @param notifyListeners true to notify listeners, false otherwise.
 */
private void setTool(EditorTools tool,boolean notifyListeners){
  this.tool=tool;
  if (tool == EditorTools.NONE) {
    mEditorRadioGroup.clearCheck();
  }
  if (listener != null && notifyListeners) {
    listener.editorToolChanged(this.tool);
  }
}
Program: 95214
Project: 95214
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mDrawerLayout=(DrawerLayout)getLayoutInflater().inflate(R.layout.activity_drawer_navigation_ui,null);
  mNavHubView=(ExpandableListView)mDrawerLayout.findViewById(R.id.nav_drawer_container);
  mDrawerToggle=new ActionBarDrawerToggle(this,mDrawerLayout,R.drawable.ic_drawer,R.string.drawer_open,R.string.drawer_close);
  mDrawerLayout.setDrawerListener(mDrawerToggle);
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeButtonEnabled(true);
  }
  mNavDrawerAdapter=new NavigationDrawerAdapter(this);
  mNavDrawerAdapter.attachExpandableListView();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mDrawerLayout=(DrawerLayout)getLayoutInflater().inflate(R.layout.activity_drawer_navigation_ui,null);
  mNavHubView=(ExpandableListView)mDrawerLayout.findViewById(R.id.nav_drawer_container);
  mDrawerToggle=new ActionBarDrawerToggle(this,mDrawerLayout,R.drawable.ic_drawer,R.string.drawer_open,R.string.drawer_close);
  mDrawerLayout.setDrawerListener(mDrawerToggle);
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setHomeButtonEnabled(true);
  }
  mNavDrawerAdapter=new NavigationDrawerAdapter(this);
  mNavDrawerAdapter.attachExpandableListView();
}
Program: 95215
Project: 95215
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_editor);
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  fragmentManager=getSupportFragmentManager();
  planningMapFragment=((EditorMapFragment)fragmentManager.findFragmentById(R.id.mapFragment));
  gestureMapFragment=((GestureMapFragment)fragmentManager.findFragmentById(R.id.gestureMapFragment));
  editorToolsFragment=(EditorToolsFragment)fragmentManager.findFragmentById(R.id.editorToolsFragment);
  missionListFragment=(EditorListFragment)fragmentManager.findFragmentById(R.id.missionFragment1);
  infoView=(TextView)findViewById(R.id.editorInfoWindow);
  mSplineToggleContainer=findViewById(R.id.editorSplineToggleContainer);
  mSplineToggleContainer.setVisibility(View.INVISIBLE);
  final RadioButton normalToggle=(RadioButton)findViewById(R.id.normalWpToggle);
  normalToggle.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      mIsSplineEnabled=!normalToggle.isChecked();
    }
  }
);
  final RadioButton splineToggle=(RadioButton)findViewById(R.id.splineWpToggle);
  splineToggle.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      mIsSplineEnabled=splineToggle.isChecked();
    }
  }
);
  mContainerItemDetail=findViewById(R.id.containerItemDetail);
  missionProxy=((DroidPlannerApp)getApplication()).missionProxy;
  gestureMapFragment.setOnPathFinishedListener(this);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_editor);
  fragmentManager=getSupportFragmentManager();
  planningMapFragment=((EditorMapFragment)fragmentManager.findFragmentById(R.id.mapFragment));
  gestureMapFragment=((GestureMapFragment)fragmentManager.findFragmentById(R.id.gestureMapFragment));
  editorToolsFragment=(EditorToolsFragment)fragmentManager.findFragmentById(R.id.editorToolsFragment);
  missionListFragment=(EditorListFragment)fragmentManager.findFragmentById(R.id.missionFragment1);
  infoView=(TextView)findViewById(R.id.editorInfoWindow);
  mSplineToggleContainer=findViewById(R.id.editorSplineToggleContainer);
  mSplineToggleContainer.setVisibility(View.VISIBLE);
  final RadioButton normalToggle=(RadioButton)findViewById(R.id.normalWpToggle);
  normalToggle.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      mIsSplineEnabled=!normalToggle.isChecked();
    }
  }
);
  final RadioButton splineToggle=(RadioButton)findViewById(R.id.splineWpToggle);
  splineToggle.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      mIsSplineEnabled=splineToggle.isChecked();
    }
  }
);
  mContainerItemDetail=findViewById(R.id.containerItemDetail);
  missionProxy=((DroidPlannerApp)getApplication()).missionProxy;
  gestureMapFragment.setOnPathFinishedListener(this);
}
Program: 95216
Project: 95216
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  PreferenceManager.setDefaultValues(this,R.xml.preferences,false);
  if (PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getBoolean("String_Node_Str",false)) {
    getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  }
  app=(DroidPlannerApp)getApplication();
  this.drone=app.drone;
  setVolumeControlStream(AudioManager.STREAM_MUSIC);
  screenOrientation.unlock();
  Utils.updateUILanguage(getApplicationContext());
  gcsHeartbeat=new GCSHeartbeat(drone,1);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  PreferenceManager.setDefaultValues(this,R.xml.preferences,false);
  if (PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getBoolean("String_Node_Str",false)) {
    getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  }
  app=(DroidPlannerApp)getApplication();
  this.drone=app.drone;
  setVolumeControlStream(AudioManager.STREAM_MUSIC);
  screenOrientation.unlock();
  Utils.updateUILanguage(getApplicationContext());
  gcsHeartbeat=new GCSHeartbeat(drone,1);
}
Program: 95217
Project: 95217
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_editor_tools,container,false);
  mEditorRadioGroup=(RadioGroup)view.findViewById(R.id.editor_tools_layout);
  final RadioButtonCenter buttonDraw=(RadioButtonCenter)view.findViewById(R.id.editor_tools_draw);
  final RadioButtonCenter buttonMarker=(RadioButtonCenter)view.findViewById(R.id.editor_tools_marker);
  final RadioButtonCenter buttonPoly=(RadioButtonCenter)view.findViewById(R.id.editor_tools_poly);
  final RadioButtonCenter buttonTrash=(RadioButtonCenter)view.findViewById(R.id.editor_tools_trash);
  for (  View vv : new View[]{buttonDraw,buttonMarker,buttonPoly,buttonTrash}) {
    vv.setOnClickListener(this);
    vv.setOnLongClickListener(this);
  }
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.fragment_editor_tools,container,false);
}
Program: 95218
Project: 95218
Buggy source:
@Override public void setPosition(Coord2D coord){
  guidedPoint.forcedGuidedCoordinate(coord);
}

Fixed version (ground truth):
@Override public void setPosition(Coord2D coord){
  try {
    guidedPoint.forcedGuidedCoordinate(coord);
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 95219
Project: 95219
Buggy source:
public static List<MarkerInfo> newInstance(MissionItemProxy origin){
  List<MarkerInfo> markerInfos=new ArrayList<MarkerInfo>();
switch (origin.getMissionItem().getType()) {
case LAND:
    markerInfos.add(new LandMarkerInfo(origin));
  break;
case LOITER:
case LOITER_INF:
case LOITERN:
case LOITERT:
markerInfos.add(new LoiterMarkerInfo(origin));
break;
case ROI:
markerInfos.add(new ROIMarkerInfo(origin));
break;
case WAYPOINT:
markerInfos.add(new WaypointMarkerInfo(origin));
break;
case SPLINE_WAYPOINT:
markerInfos.add(new SplineWaypointMarkerInfo(origin));
break;
case SURVEY:
markerInfos.addAll(new SurveyMarkerInfoProvider(origin).getMarkersInfos());
break;
default :
break;
}
return markerInfos;
}

Fixed version (ground truth):
public static List<MarkerInfo> newInstance(MissionItemProxy origin){
  List<MarkerInfo> markerInfos=new ArrayList<MarkerInfo>();
switch (origin.getMissionItem().getType()) {
case LAND:
    markerInfos.add(new LandMarkerInfo(origin));
  break;
case LOITER:
case LOITER_INF:
case LOITERT:
markerInfos.add(new LoiterMarkerInfo(origin));
break;
case ROI:
markerInfos.add(new ROIMarkerInfo(origin));
break;
case WAYPOINT:
markerInfos.add(new WaypointMarkerInfo(origin));
break;
case SPLINE_WAYPOINT:
markerInfos.add(new SplineWaypointMarkerInfo(origin));
break;
case SURVEY:
markerInfos.addAll(new SurveyMarkerInfoProvider(origin).getMarkersInfos());
break;
default :
break;
}
return markerInfos;
}
Program: 95220
Project: 95220
Buggy source:
public void addTakeoff(){
  Takeoff takeoff=new Takeoff(mMission,new Altitude(10));
  mMissionItems.add(new MissionItemRender(this,takeoff));
  mMission.addWaypoint(takeoff);
}

Fixed version (ground truth):
public void addTakeoff(){
  Takeoff takeoff=new Takeoff(mMission,new Altitude(10));
  mMissionItems.add(new MissionItemProxy(this,takeoff));
  mMission.addWaypoint(takeoff);
}
Program: 95221
Project: 95221
Buggy source:
public msg_mission_item packMavlink(){
  msg_mission_item mavMsg=new msg_mission_item();
  mavMsg.autocontinue=1;
  mavMsg.current=1;
  mavMsg.frame=MAV_FRAME.MAV_FRAME_GLOBAL;
  mavMsg.target_component=1;
  mavMsg.target_system=1;
  if (isValid()) {
    mavMsg.x=(float)getCoord().getLat();
    mavMsg.y=(float)getCoord().getLng();
    mavMsg.z=(float)getAltitude().valueInMeters();
  }
  return mavMsg;
}

Fixed version (ground truth):
public msg_mission_item packMavlink(){
  msg_mission_item mavMsg=new msg_mission_item();
  mavMsg.autocontinue=1;
  mavMsg.command=MAV_CMD.MAV_CMD_NAV_WAYPOINT;
  mavMsg.current=0;
  mavMsg.frame=MAV_FRAME.MAV_FRAME_GLOBAL;
  mavMsg.target_component=1;
  mavMsg.target_system=1;
  if (isValid()) {
    mavMsg.x=(float)getCoord().getLat();
    mavMsg.y=(float)getCoord().getLng();
    mavMsg.z=(float)getAltitude().valueInMeters();
  }
  return mavMsg;
}
Program: 95222
Project: 95222
Buggy source:
public static Coord2D LatLngToCoord(LatLng point){
  return new Coord2D(point.longitude,point.latitude);
}

Fixed version (ground truth):
public static Coord2D LatLngToCoord(LatLng point){
  return new Coord2D(point.latitude,point.longitude);
}
Program: 95224
Project: 95224
Buggy source:
public void setHome(msg_mission_item msg){
  this.coordinate=new Coord2D(msg.y,msg.x);
  this.altitude=new Altitude(msg.z);
  myDrone.events.notifyDroneEvent(DroneEventsType.HOME);
}

Fixed version (ground truth):
public void setHome(msg_mission_item msg){
  this.coordinate=new Coord2D(msg.x,msg.y);
  this.altitude=new Altitude(msg.z);
  myDrone.events.notifyDroneEvent(DroneEventsType.HOME);
}
Program: 95225
Project: 95225
Buggy source:
public msg_mission_item packMavlink(){
  msg_mission_item mavMsg=new msg_mission_item();
  mavMsg.autocontinue=1;
  mavMsg.current=1;
  mavMsg.frame=MAV_FRAME.MAV_FRAME_GLOBAL;
  mavMsg.target_component=1;
  mavMsg.target_system=1;
  if (isValid()) {
    mavMsg.x=(float)getCoord().getX();
    mavMsg.y=(float)getCoord().getY();
    mavMsg.z=(float)getAltitude().valueInMeters();
  }
  return mavMsg;
}

Fixed version (ground truth):
public msg_mission_item packMavlink(){
  msg_mission_item mavMsg=new msg_mission_item();
  mavMsg.autocontinue=1;
  mavMsg.current=1;
  mavMsg.frame=MAV_FRAME.MAV_FRAME_GLOBAL;
  mavMsg.target_component=1;
  mavMsg.target_system=1;
  if (isValid()) {
    mavMsg.x=(float)getCoord().getLat();
    mavMsg.y=(float)getCoord().getLng();
    mavMsg.z=(float)getAltitude().valueInMeters();
  }
  return mavMsg;
}
Program: 95226
Project: 95226
Buggy source:
public double getLat(){
  return y;
}

Fixed version (ground truth):
public double getLat(){
  return latitude;
}
Program: 95227
Project: 95227
Buggy source:
public double getX(){
  return x;
}

Fixed version (ground truth):
public double getX(){
  return latitude;
}
Program: 95228
Project: 95228
Buggy source:
public void set(Coord2D coord){
  set(coord.x,coord.y);
}

Fixed version (ground truth):
public void set(Coord2D coord){
  set(coord.latitude,coord.longitude);
}
Program: 95229
Project: 95229
Buggy source:
public double getY(){
  return y;
}

Fixed version (ground truth):
public double getY(){
  return longitude;
}
Program: 95230
Project: 95230
Buggy source:
public double getLng(){
  return x;
}

Fixed version (ground truth):
public double getLng(){
  return longitude;
}
Program: 95231
Project: 95231
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + getX() + "String_Node_Str"+ getY();
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + getLat() + "String_Node_Str"+ getLng();
}
Program: 95232
Project: 95232
Buggy source:
public void set(double x,double y,Altitude alt){
  super.set(x,y);
  this.alt=alt;
}

Fixed version (ground truth):
public void set(double lat,double lon,Altitude alt){
  super.set(lat,lon);
  this.alt=alt;
}
Program: 95233
Project: 95233
Buggy source:
public Coord3D(int x,int y,int alt){
  this(x,y,new Altitude(alt));
}

Fixed version (ground truth):
public Coord3D(int lat,int lon,int alt){
  this(lat,lon,new Altitude(alt));
}
Program: 95234
Project: 95234
Buggy source:
public void setAltitude(Altitude altitude){
  coordinate.set(coordinate.getX(),coordinate.getY(),altitude);
}

Fixed version (ground truth):
public void setAltitude(Altitude altitude){
  coordinate.set(coordinate.getLat(),coordinate.getLng(),altitude);
}
Program: 95235
Project: 95235
Buggy source:
@Override public void unpackMAVMessage(msg_mission_item mavMsg){
  Altitude alt=new Altitude(mavMsg.z);
  setCoordinate(new Coord3D(mavMsg.y,mavMsg.x,alt));
}

Fixed version (ground truth):
@Override public void unpackMAVMessage(msg_mission_item mavMsg){
  Altitude alt=new Altitude(mavMsg.z);
  setCoordinate(new Coord3D(mavMsg.x,mavMsg.y,alt));
}
Program: 95236
Project: 95236
Buggy source:
public void testPackMissionItem(){
  Mission mission=new Mission(null);
  Waypoint item=new Waypoint(mission,new Coord3D(0.1,1,new Altitude(2)));
  msg_mission_item mavMsg=item.packMissionItem().get(0);
  assertEquals(1,mavMsg.autocontinue);
  assertEquals(1,mavMsg.target_component);
  assertEquals(1,mavMsg.target_system);
  assertEquals(MAV_FRAME.MAV_FRAME_GLOBAL_RELATIVE_ALT,mavMsg.frame);
  assertEquals(1f,mavMsg.x);
  assertEquals(0.1f,mavMsg.y);
  assertEquals(2f,mavMsg.z);
}

Fixed version (ground truth):
public void testPackMissionItem(){
  Mission mission=new Mission(null);
  Waypoint item=new Waypoint(mission,new Coord3D(0.1,1,new Altitude(2)));
  msg_mission_item mavMsg=item.packMissionItem().get(0);
  assertEquals(1,mavMsg.autocontinue);
  assertEquals(1,mavMsg.target_component);
  assertEquals(1,mavMsg.target_system);
  assertEquals(MAV_FRAME.MAV_FRAME_GLOBAL_RELATIVE_ALT,mavMsg.frame);
  assertEquals(0.1f,mavMsg.x);
  assertEquals(1f,mavMsg.y);
  assertEquals(2f,mavMsg.z);
}
Program: 95237
Project: 95237
Buggy source:
@Override public float getAlpha(){
  return 0;
}

Fixed version (ground truth):
@Override public float getAlpha(){
  return 1;
}
Program: 95238
Project: 95238
Buggy source:
@Override public void updateMarker(MarkerInfo markerInfo,boolean isDraggable){
  Marker marker=mMarkers.get(markerInfo);
  if (marker == null) {
    marker=mMap.addMarker(new MarkerOptions());
    mMarkers.put(markerInfo,marker);
  }
  marker.setAlpha(markerInfo.getAlpha());
  marker.setAnchor(markerInfo.getAnchorU(),markerInfo.getAnchorV());
  marker.setIcon(BitmapDescriptorFactory.fromBitmap(markerInfo.getIcon(getResources())));
  marker.setInfoWindowAnchor(markerInfo.getInfoWindowAnchorU(),markerInfo.getInfoWindowAnchorV());
  marker.setPosition(DroneHelper.CoordToLatLang(markerInfo.getPosition()));
  marker.setRotation(markerInfo.getRotation());
  marker.setSnippet(markerInfo.getSnippet());
  marker.setTitle(markerInfo.getTitle());
  marker.setDraggable(isDraggable);
  marker.setFlat(markerInfo.isFlat());
  marker.setVisible(markerInfo.isVisible());
}

Fixed version (ground truth):
@Override public void updateMarker(MarkerInfo markerInfo,boolean isDraggable){
  final LatLng position=DroneHelper.CoordToLatLang(markerInfo.getPosition());
  Marker marker=mMarkers.get(markerInfo);
  if (marker == null) {
    marker=mMap.addMarker(new MarkerOptions().position(position));
    mMarkers.put(markerInfo,marker);
  }
  marker.setAlpha(markerInfo.getAlpha());
  marker.setAnchor(markerInfo.getAnchorU(),markerInfo.getAnchorV());
  marker.setIcon(BitmapDescriptorFactory.fromBitmap(markerInfo.getIcon(getResources())));
  marker.setInfoWindowAnchor(markerInfo.getInfoWindowAnchorU(),markerInfo.getInfoWindowAnchorV());
  marker.setPosition(position);
  marker.setRotation(markerInfo.getRotation());
  marker.setSnippet(markerInfo.getSnippet());
  marker.setTitle(markerInfo.getTitle());
  marker.setDraggable(isDraggable);
  marker.setFlat(markerInfo.isFlat());
  marker.setVisible(markerInfo.isVisible());
}
Program: 95239
Project: 95239
Buggy source:
@Override public void updateMarker(MarkerInfo markerInfo,boolean isDraggable){
  Marker marker=mMarkers.get(markerInfo);
  if (marker == null) {
    marker=new Marker(mMapView);
    marker.setOnMarkerClickListener(mMarkerClickHandler);
    marker.setOnMarkerDragListener(mMarkerDragHandler);
    mMarkers.put(markerInfo,marker);
  }
  final Resources res=getResources();
  marker.setAlpha(markerInfo.getAlpha());
  marker.setAnchor(markerInfo.getAnchorU(),markerInfo.getAnchorV());
  marker.setIcon(new BitmapDrawable(res,markerInfo.getIcon(res)));
  marker.setInfoWindowAnchor(markerInfo.getInfoWindowAnchorU(),markerInfo.getInfoWindowAnchorV());
  marker.setPosition(DroneHelper.CoordToGeoPoint(markerInfo.getPosition()));
  marker.setRotation(markerInfo.getRotation());
  marker.setSnippet(markerInfo.getSnippet());
  marker.setTitle(markerInfo.getTitle());
  marker.setDraggable(isDraggable);
  marker.setFlat(markerInfo.isFlat());
  marker.setEnabled(markerInfo.isVisible());
}

Fixed version (ground truth):
@Override public void updateMarker(MarkerInfo markerInfo,boolean isDraggable){
  final GeoPoint position=DroneHelper.CoordToGeoPoint(markerInfo.getPosition());
  Marker marker=mMarkers.get(markerInfo);
  if (marker == null) {
    marker=new Marker(mMapView);
    marker.setPosition(position);
    marker.setOnMarkerClickListener(mMarkerClickHandler);
    marker.setOnMarkerDragListener(mMarkerDragHandler);
    mMapView.getOverlays().add(marker);
    mMapView.invalidate();
    mMarkers.put(markerInfo,marker);
  }
  final Resources res=getResources();
  marker.setAlpha(markerInfo.getAlpha());
  marker.setAnchor(markerInfo.getAnchorU(),markerInfo.getAnchorV());
  marker.setIcon(new BitmapDrawable(res,markerInfo.getIcon(res)));
  marker.setInfoWindowAnchor(markerInfo.getInfoWindowAnchorU(),markerInfo.getInfoWindowAnchorV());
  marker.setPosition(position);
  marker.setRotation(markerInfo.getRotation());
  marker.setSnippet(markerInfo.getSnippet());
  marker.setTitle(markerInfo.getTitle());
  marker.setDraggable(isDraggable);
  marker.setFlat(markerInfo.isFlat());
  marker.setEnabled(markerInfo.isVisible());
}
Program: 95240
Project: 95240
Buggy source:
public static List<Coord2D> projectPathIntoMap(List<Coord2D> path,GoogleMap map){
  List<Coord2D> coords=new ArrayList<Coord2D>();
  Projection projection=map.getProjection();
  for (  Coord2D point : path) {
    LatLng coord=projection.fromScreenLocation(new Point((int)point.getX(),(int)point.getY()));
    coords.add(new Coord2D(coord.longitude,coord.latitude));
  }
  return coords;
}

Fixed version (ground truth):
public static List<Coord2D> projectPathIntoMap(List<Coord2D> path,GoogleMap map){
  List<Coord2D> coords=new ArrayList<Coord2D>();
  Projection projection=map.getProjection();
  for (  Coord2D point : path) {
    LatLng coord=projection.fromScreenLocation(new Point((int)point.getX(),(int)point.getY()));
    coords.add(new Coord2D(coord.latitude,coord.longitude));
  }
  return coords;
}
Program: 95241
Project: 95241
Buggy source:
public Coord2D getMiddle(){
  return (new Coord2D((ne_1quadrant.getX() + sw_3quadrant.getX()) / 2,(ne_1quadrant.getY() + sw_3quadrant.getY()) / 2));
}

Fixed version (ground truth):
public Coord2D getMiddle(){
  return (new Coord2D((ne_1quadrant.getLat() + sw_3quadrant.getLat()) / 2,(ne_1quadrant.getLng() + sw_3quadrant.getLng()) / 2));
}
Program: 95242
Project: 95242
Buggy source:
/** 
 * Extrapolate latitude/longitude given a heading and distance thanks to http://www.movable-type.co.uk/scripts/latlong.html
 * @param origin Point of origin
 * @param bearing bearing to navigate
 * @param distance distance to be added
 * @return New point with the added distance
 */
public static Coord2D newCoordFromBearingAndDistance(Coord2D origin,double bearing,double distance){
  double lat=origin.getY();
  double lon=origin.getX();
  double lat1=Math.toRadians(lat);
  double lon1=Math.toRadians(lon);
  double brng=Math.toRadians(bearing);
  double dr=distance / RADIUS_OF_EARTH;
  double lat2=Math.asin(Math.sin(lat1) * Math.cos(dr) + Math.cos(lat1) * Math.sin(dr) * Math.cos(brng));
  double lon2=lon1 + Math.atan2(Math.sin(brng) * Math.sin(dr) * Math.cos(lat1),Math.cos(dr) - Math.sin(lat1) * Math.sin(lat2));
  return (new Coord2D(Math.toDegrees(lon2),Math.toDegrees(lat2)));
}

Fixed version (ground truth):
/** 
 * Extrapolate latitude/longitude given a heading and distance thanks to http://www.movable-type.co.uk/scripts/latlong.html
 * @param origin Point of origin
 * @param bearing bearing to navigate
 * @param distance distance to be added
 * @return New point with the added distance
 */
public static Coord2D newCoordFromBearingAndDistance(Coord2D origin,double bearing,double distance){
  double lat=origin.getLat();
  double lon=origin.getLng();
  double lat1=Math.toRadians(lat);
  double lon1=Math.toRadians(lon);
  double brng=Math.toRadians(bearing);
  double dr=distance / RADIUS_OF_EARTH;
  double lat2=Math.asin(Math.sin(lat1) * Math.cos(dr) + Math.cos(lat1) * Math.sin(dr) * Math.cos(brng));
  double lon2=lon1 + Math.atan2(Math.sin(brng) * Math.sin(dr) * Math.cos(lat1),Math.cos(dr) - Math.sin(lat1) * Math.sin(lat2));
  return (new Coord2D(Math.toDegrees(lat2),Math.toDegrees(lon2)));
}
Program: 95243
Project: 95243
Buggy source:
/** 
 * Calculates the arc between two points http://en.wikipedia.org/wiki/Haversine_formula
 * @return the arc in degrees
 */
static double getArcInRadians(Coord2D from,Coord2D to){
  double latitudeArc=Math.toRadians(from.getY() - to.getY());
  double longitudeArc=Math.toRadians(from.getX() - to.getX());
  double latitudeH=Math.sin(latitudeArc * 0.5);
  latitudeH*=latitudeH;
  double lontitudeH=Math.sin(longitudeArc * 0.5);
  lontitudeH*=lontitudeH;
  double tmp=Math.cos(Math.toRadians(from.getY())) * Math.cos(Math.toRadians(to.getY()));
  return Math.toDegrees(2.0 * Math.asin(Math.sqrt(latitudeH + tmp * lontitudeH)));
}

Fixed version (ground truth):
/** 
 * Calculates the arc between two points http://en.wikipedia.org/wiki/Haversine_formula
 * @return the arc in degrees
 */
static double getArcInRadians(Coord2D from,Coord2D to){
  double latitudeArc=Math.toRadians(from.getLat() - to.getLat());
  double longitudeArc=Math.toRadians(from.getLng() - to.getLng());
  double latitudeH=Math.sin(latitudeArc * 0.5);
  latitudeH*=latitudeH;
  double lontitudeH=Math.sin(longitudeArc * 0.5);
  lontitudeH*=lontitudeH;
  double tmp=Math.cos(Math.toRadians(from.getLat())) * Math.cos(Math.toRadians(to.getLat()));
  return Math.toDegrees(2.0 * Math.asin(Math.sqrt(latitudeH + tmp * lontitudeH)));
}
Program: 95244
Project: 95244
Buggy source:
public Coord2D getMiddle(){
  return (new Coord2D((ne_1quadrant.getY() + sw_3quadrant.getY()) / 2,(ne_1quadrant.getX() + sw_3quadrant.getX()) / 2));
}

Fixed version (ground truth):
public Coord2D getMiddle(){
  return (new Coord2D((ne_1quadrant.getX() + sw_3quadrant.getX()) / 2,(ne_1quadrant.getY() + sw_3quadrant.getY()) / 2));
}
Program: 95245
Project: 95245
Buggy source:
/** 
 * Extrapolate latitude/longitude given a heading and distance thanks to http://www.movable-type.co.uk/scripts/latlong.html
 * @param origin Point of origin
 * @param bearing bearing to navigate
 * @param distance distance to be added
 * @return New point with the added distance
 */
public static Coord2D newCoordFromBearingAndDistance(Coord2D origin,double bearing,double distance){
  double lat=origin.getY();
  double lon=origin.getX();
  double lat1=Math.toRadians(lat);
  double lon1=Math.toRadians(lon);
  double brng=Math.toRadians(bearing);
  double dr=distance / RADIUS_OF_EARTH;
  double lat2=Math.asin(Math.sin(lat1) * Math.cos(dr) + Math.cos(lat1) * Math.sin(dr) * Math.cos(brng));
  double lon2=lon1 + Math.atan2(Math.sin(brng) * Math.sin(dr) * Math.cos(lat1),Math.cos(dr) - Math.sin(lat1) * Math.sin(lat2));
  return (new Coord2D(Math.toDegrees(lat2),Math.toDegrees(lon2)));
}

Fixed version (ground truth):
/** 
 * Extrapolate latitude/longitude given a heading and distance thanks to http://www.movable-type.co.uk/scripts/latlong.html
 * @param origin Point of origin
 * @param bearing bearing to navigate
 * @param distance distance to be added
 * @return New point with the added distance
 */
public static Coord2D newCoordFromBearingAndDistance(Coord2D origin,double bearing,double distance){
  double lat=origin.getY();
  double lon=origin.getX();
  double lat1=Math.toRadians(lat);
  double lon1=Math.toRadians(lon);
  double brng=Math.toRadians(bearing);
  double dr=distance / RADIUS_OF_EARTH;
  double lat2=Math.asin(Math.sin(lat1) * Math.cos(dr) + Math.cos(lat1) * Math.sin(dr) * Math.cos(brng));
  double lon2=lon1 + Math.atan2(Math.sin(brng) * Math.sin(dr) * Math.cos(lat1),Math.cos(dr) - Math.sin(lat1) * Math.sin(lat2));
  return (new Coord2D(Math.toDegrees(lon2),Math.toDegrees(lat2)));
}