nus-yam/ex-repair huggingface dataset:
Program: 95078
Project: 95078
Buggy source:
@Override public String toString(){
  String toString="String_Node_Str";
  final ParameterMetadata metadata=getMetadata();
  if (metadata != null) {
    toString=metadata.getDisplayName();
  }
  if (toString == null) {
    final Parameter param=getParameter();
    if (param != null) {
      toString=param.name;
    }
  }
  return toString;
}

Fixed version (ground truth):
@Override public String toString(){
  String toString="String_Node_Str";
  final Parameter param=getParameter();
  if (param != null) {
    toString=param.name + "String_Node_Str";
  }
  final ParameterMetadata metadata=getMetadata();
  if (metadata != null) {
    toString+=metadata.getDisplayName();
  }
  return toString;
}
Program: 95079
Project: 95079
Buggy source:
@Override public void onDroneEvent(DroneEventsType event,Drone drone){
  super.onDroneEvent(event,drone);
switch (event) {
case MISSION_UPDATE:
    Length missionLength=missionProxy.getMissionLength();
  Speed speedParameter=drone.getSpeed().getSpeedParameter();
String infoString="String_Node_Str" + missionLength;
if (speedParameter != null) {
int time=(int)(missionLength.valueInMeters() / speedParameter.valueInMetersPerSecond());
infoString=infoString + String.format("String_Node_Str",time / 60,time % 60);
}
infoView.setText(infoString);
if (itemDetailFragment != null) {
if (!missionProxy.contains(itemDetailFragment.getItem())) {
removeItemDetail();
}
}
break;
default :
break;
}
}

Fixed version (ground truth):
@Override public void onDroneEvent(DroneEventsType event,Drone drone){
  super.onDroneEvent(event,drone);
switch (event) {
case MISSION_UPDATE:
    Length missionLength=missionProxy.getMissionLength();
  Speed speedParameter=drone.getSpeed().getSpeedParameter();
String infoString="String_Node_Str" + missionLength;
if (speedParameter != null) {
int time=(int)(missionLength.valueInMeters() / speedParameter.valueInMetersPerSecond());
infoString=infoString + String.format("String_Node_Str",time / 60,time % 60);
}
infoView.setText(infoString);
if (missionProxy.selection.getSelected().isEmpty() && itemDetailFragment != null) {
removeItemDetail();
}
break;
default :
break;
}
}
Program: 95080
Project: 95080
Buggy source:
private void enableSlidingUpPanel(Drone drone){
  if (mSlidingPanel == null) {
    return;
  }
  final State droneState=drone.getState();
  final boolean isEnabled=drone.getMavClient().isConnected() && droneState.isArmed() && droneState.isFlying();
  if (isEnabled) {
    mSlidingPanel.setPanelSlideListener(null);
    mSlidingPanel.setSlidingEnabled(true);
  }
 else {
    if (!mSlidingPanelCollapsing.get()) {
      if (mSlidingPanel.isPanelExpanded()) {
        mSlidingPanel.setPanelSlideListener(mDisablePanelSliding);
        mSlidingPanel.collapsePanel();
        mSlidingPanelCollapsing.set(true);
      }
 else {
        mSlidingPanel.setSlidingEnabled(false);
        mSlidingPanelCollapsing.set(false);
      }
    }
  }
}

Fixed version (ground truth):
private void enableSlidingUpPanel(Drone drone){
  if (mSlidingPanel == null) {
    return;
  }
  final State droneState=drone.getState();
  final boolean isEnabled=drone.getMavClient().isConnected() && droneState.isArmed() && droneState.isFlying();
  if (isEnabled) {
    mSlidingPanel.setSlidingEnabled(true);
  }
 else {
    if (!mSlidingPanelCollapsing.get()) {
      if (mSlidingPanel.isPanelExpanded()) {
        mSlidingPanel.setPanelSlideListener(mDisablePanelSliding);
        mSlidingPanel.collapsePanel();
        mSlidingPanelCollapsing.set(true);
      }
 else {
        mSlidingPanel.setSlidingEnabled(false);
        mSlidingPanelCollapsing.set(false);
      }
    }
  }
}
Program: 95081
Project: 95081
Buggy source:
@Override public void onPanelCollapsed(View view){
  mSlidingPanel.setSlidingEnabled(false);
  mSlidingPanel.setPanelHeight(mFlightActionsView.getHeight());
  mSlidingPanelCollapsing.set(false);
}

Fixed version (ground truth):
@Override public void onPanelCollapsed(View view){
  mSlidingPanel.setSlidingEnabled(false);
  mSlidingPanel.setPanelHeight(mFlightActionsView.getHeight());
  mSlidingPanelCollapsing.set(false);
  mSlidingPanel.setPanelSlideListener(null);
}
Program: 95082
Project: 95082
Buggy source:
public void makeAndUploadDronie(){
  Coord2D currentPosition=myDrone.getGps().getPosition();
  if (currentPosition == null || myDrone.getGps().getSatCount() >= 5) {
    myDrone.notifyDroneEvent(DroneEventsType.WARNING_NO_GPS);
    return;
  }
  items.clear();
  items.addAll(createDronie(this,currentPosition,GeoTools.newCoordFromBearingAndDistance(currentPosition,180 + myDrone.getOrientation().getYaw(),50.0)));
  sendMissionToAPM();
  myDrone.notifyDroneEvent(DroneEventsType.MISSION_RECEIVED);
  notifyMissionUpdate();
}

Fixed version (ground truth):
public void makeAndUploadDronie(){
  Coord2D currentPosition=myDrone.getGps().getPosition();
  if (currentPosition == null || myDrone.getGps().getSatCount() <= 5) {
    myDrone.notifyDroneEvent(DroneEventsType.WARNING_NO_GPS);
    return;
  }
  items.clear();
  items.addAll(createDronie(this,currentPosition,GeoTools.newCoordFromBearingAndDistance(currentPosition,180 + myDrone.getOrientation().getYaw(),50.0)));
  sendMissionToAPM();
  myDrone.notifyDroneEvent(DroneEventsType.MISSION_RECEIVED);
  notifyMissionUpdate();
}
Program: 95083
Project: 95083
Buggy source:
public void makeAndUploadDronie(){
  Coord2D currentPosition=myDrone.getGps().getPosition();
  if (currentPosition == null || myDrone.getGps().getSatCount() >= 5) {
    myDrone.notifyDroneEvent(DroneEventsType.WARNING_NO_GPS);
    return;
  }
  items.clear();
  items.addAll(createDronie(this,currentPosition,GeoTools.newCoordFromBearingAndDistance(currentPosition,180 + myDrone.getOrientation().getYaw(),50.0)));
  sendMissionToAPM();
  myDrone.notifyDroneEvent(DroneEventsType.MISSION_RECEIVED);
  notifyMissionUpdate();
}

Fixed version (ground truth):
public void makeAndUploadDronie(){
  Coord2D currentPosition=myDrone.getGps().getPosition();
  if (currentPosition == null || myDrone.getGps().getSatCount() <= 5) {
    myDrone.notifyDroneEvent(DroneEventsType.WARNING_NO_GPS);
    return;
  }
  items.clear();
  items.addAll(createDronie(this,currentPosition,GeoTools.newCoordFromBearingAndDistance(currentPosition,180 + myDrone.getOrientation().getYaw(),50.0)));
  sendMissionToAPM();
  myDrone.notifyDroneEvent(DroneEventsType.MISSION_RECEIVED);
  notifyMissionUpdate();
}
Program: 95084
Project: 95084
Buggy source:
@Override public void onListVisibilityChanged(){
  updateMapPadding();
}

Fixed version (ground truth):
@Override public void onListVisibilityChanged(){
}
Program: 95088
Project: 95088
Buggy source:
private void setupMapUI(){
  mMap.setMyLocationEnabled(true);
  UiSettings mUiSettings=mMap.getUiSettings();
  mUiSettings.setMyLocationButtonEnabled(false);
  mUiSettings.setCompassEnabled(true);
  mUiSettings.setTiltGesturesEnabled(false);
  mUiSettings.setZoomControlsEnabled(false);
}

Fixed version (ground truth):
private void setupMapUI(){
  mMap.setMyLocationEnabled(true);
  UiSettings mUiSettings=mMap.getUiSettings();
  mUiSettings.setMyLocationButtonEnabled(false);
  mUiSettings.setCompassEnabled(false);
  mUiSettings.setTiltGesturesEnabled(false);
  mUiSettings.setZoomControlsEnabled(false);
}
Program: 95089
Project: 95089
Buggy source:
@Override public void onBeginReceivingParameters(){
  startProgress();
  mReceived=0;
  mTotal=0;
}

Fixed version (ground truth):
@Override public void onBeginReceivingParameters(){
  startProgress();
}
Program: 95090
Project: 95090
Buggy source:
private void updateProgress(int progress,int max){
  if (progressDialog != null) {
    if (progressDialog.isIndeterminate()) {
      progressDialog.setIndeterminate(false);
      mTotal=max;
      progressDialog.setMax(max);
    }
    progressDialog.setProgress(progress);
  }
  if (mLoadingProgress.isIndeterminate()) {
    mLoadingProgress.setIndeterminate(false);
    mTotal=max;
    mLoadingProgress.setMax(max);
  }
  mLoadingProgress.setProgress(progress);
}

Fixed version (ground truth):
private void updateProgress(int progress,int max){
  if (progressDialog == null) {
    startProgress();
  }
  if (progressDialog.isIndeterminate()) {
    progressDialog.setIndeterminate(false);
    progressDialog.setMax(max);
  }
  progressDialog.setProgress(progress);
  if (mLoadingProgress.isIndeterminate()) {
    mLoadingProgress.setIndeterminate(false);
    mLoadingProgress.setMax(max);
  }
  mLoadingProgress.setProgress(progress);
}
Program: 95091
Project: 95091
Buggy source:
@Override public void onParameterReceived(Parameter parameter,int index,int count){
  ++mReceived;
  updateProgress(mReceived,count);
}

Fixed version (ground truth):
@Override public void onParameterReceived(Parameter parameter,int index,int count){
  updateProgress(index,count);
}
Program: 95092
Project: 95092
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  mLoadingProgress=(ProgressBar)view.findViewById(R.id.reload_progress);
  mLoadingProgress.setVisibility(View.GONE);
  mParamsFilter=(SearchView)view.findViewById(R.id.parameter_filter);
  view.findViewById(android.R.id.empty).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      refreshParameters();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  mLoadingProgress=(ProgressBar)view.findViewById(R.id.reload_progress);
  mLoadingProgress.setVisibility(View.GONE);
  mParamsFilter=(SearchView)view.findViewById(R.id.parameter_filter);
  mParamsFilter.setOnQueryTextListener(this);
  mParamsFilter.setIconifiedByDefault(false);
  mParamsFilter.setSubmitButtonEnabled(false);
  mParamsFilter.setOnCloseListener(this);
  view.findViewById(android.R.id.empty).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      refreshParameters();
    }
  }
);
}
Program: 95093
Project: 95093
Buggy source:
@Override public void onStart(){
  super.onStart();
  drone=((DroidPlannerApp)getActivity().getApplication()).getDrone();
  drone.addDroneListener(this);
  drone.getParameters().setParameterListener(this);
}

Fixed version (ground truth):
@Override public void onStart(){
  super.onStart();
  drone.addDroneListener(this);
  drone.getParameters().setParameterListener(this);
}
Program: 95094
Project: 95094
Buggy source:
private void refreshParameters(){
  if (drone.getMavClient().isConnected()) {
    drone.getParameters().getAllParameters();
  }
 else {
    Toast.makeText(getActivity(),R.string.msg_connect_first,Toast.LENGTH_SHORT).show();
  }
}

Fixed version (ground truth):
private void refreshParameters(){
  if (drone.getMavClient().isConnected()) {
    drone.getParameters().refreshParameters();
  }
 else {
    Toast.makeText(getActivity(),R.string.msg_connect_first,Toast.LENGTH_SHORT).show();
  }
}
Program: 95095
Project: 95095
Buggy source:
@Override public void onEndReceivingParameters(List<Parameter> parameters){
  if (mReceived < mTotal) {
    Log.w(TAG,"String_Node_Str" + mTotal + "String_Node_Str"+ mReceived);
  }
  Collections.sort(parameters,new Comparator<Parameter>(){
    @Override public int compare(    Parameter p1,    Parameter p2){
      return p1.name.compareTo(p2.name);
    }
  }
);
  adapter.loadParameters(drone,parameters);
  stopProgress();
}

Fixed version (ground truth):
@Override public void onEndReceivingParameters(List<Parameter> parameters){
  Collections.sort(parameters,new Comparator<Parameter>(){
    @Override public int compare(    Parameter p1,    Parameter p2){
      return p1.name.compareTo(p2.name);
    }
  }
);
  adapter.loadParameters(drone,parameters);
  stopProgress();
}
Program: 95096
Project: 95096
Buggy source:
@Override public void onDroneEvent(DroneEventsType event,Drone drone){
switch (event) {
case HEARTBEAT_FIRST:
    if (drone.getState().isFlying() == false) {
      getAllParameters();
    }
  break;
case DISCONNECTED:
case HEARTBEAT_TIMEOUT:
killWatchdog();
break;
default :
break;
}
}

Fixed version (ground truth):
@Override public void onDroneEvent(DroneEventsType event,Drone drone){
switch (event) {
case HEARTBEAT_FIRST:
    if (!drone.getState().isFlying()) {
      refreshParameters();
    }
  break;
case DISCONNECTED:
case HEARTBEAT_TIMEOUT:
killWatchdog();
break;
default :
break;
}
}
Program: 95097
Project: 95097
Buggy source:
private void processReceivedParam(msg_param_value m_value){
  Parameter param=new Parameter(m_value);
  parameters.put((int)m_value.param_index,param);
  expectedParams=m_value.param_count;
  if (parameterListener != null)   parameterListener.onParameterReceived(param,m_value.param_index,m_value.param_count);
  if (parameters.size() >= m_value.param_count) {
    List<Parameter> parameterList=new ArrayList<Parameter>();
    for (    int key : parameters.keySet()) {
      parameterList.add(parameters.get(key));
    }
    killWatchdog();
    myDrone.notifyDroneEvent(DroneEventsType.PARAMETERS_DOWNLOADED);
    if (parameterListener != null) {
      parameterListener.onEndReceivingParameters(parameterList);
    }
  }
 else {
    resetWatchdog();
  }
  myDrone.notifyDroneEvent(DroneEventsType.PARAMETER);
}

Fixed version (ground truth):
private void processReceivedParam(msg_param_value m_value){
  Parameter param=new Parameter(m_value);
  parameters.put((int)m_value.param_index,param);
  expectedParams=m_value.param_count;
  if (parameterListener != null)   parameterListener.onParameterReceived(param,m_value.param_index,m_value.param_count);
  if (parameters.size() >= m_value.param_count) {
    parameterList.clear();
    for (    int key : parameters.keySet()) {
      parameterList.add(parameters.get(key));
    }
    killWatchdog();
    myDrone.notifyDroneEvent(DroneEventsType.PARAMETERS_DOWNLOADED);
    if (parameterListener != null) {
      parameterListener.onEndReceivingParameters(parameterList);
    }
  }
 else {
    resetWatchdog();
  }
  myDrone.notifyDroneEvent(DroneEventsType.PARAMETER);
}
Program: 95098
Project: 95098
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  adapter.clearFocus();
switch (item.getItemId()) {
case R.id.menu_load_parameters:
    refreshParameters();
  break;
case R.id.menu_write_parameters:
writeModifiedParametersToDrone();
break;
case R.id.menu_open_parameters:
openParametersFromFile();
break;
case R.id.menu_save_parameters:
saveParametersToFile();
break;
case R.id.menu_filter_params:
toggleParameterFilter();
break;
default :
return super.onOptionsItemSelected(item);
}
return true;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  adapter.clearFocus();
switch (item.getItemId()) {
case R.id.menu_load_parameters:
    refreshParameters();
  break;
case R.id.menu_write_parameters:
writeModifiedParametersToDrone();
break;
case R.id.menu_open_parameters:
openParametersFromFile();
break;
case R.id.menu_save_parameters:
saveParametersToFile();
break;
case R.id.menu_filter_params:
final boolean isEnabled=!isParameterFilterVisible();
toggleParameterFilter(isEnabled,isEnabled);
break;
default :
return super.onOptionsItemSelected(item);
}
return true;
}
Program: 95099
Project: 95099
Buggy source:
@Override public void onStart(){
  super.onStart();
  drone.addDroneListener(this);
  drone.getParameters().setParameterListener(this);
}

Fixed version (ground truth):
@Override public void onStart(){
  super.onStart();
  drone.addDroneListener(this);
  drone.getParameters().setParameterListener(this);
  toggleParameterFilter(isParameterFilterVisible(),false);
}
Program: 95100
Project: 95100
Buggy source:
private void loadAdapter(List<Parameter> parameters){
  if (parameters == null || parameters.isEmpty()) {
    return;
  }
  Set<Parameter> prunedParameters=new TreeSet<Parameter>(parameters);
  adapter.loadParameters(drone,prunedParameters);
}

Fixed version (ground truth):
private void loadAdapter(List<Parameter> parameters){
  if (parameters == null || parameters.isEmpty()) {
    return;
  }
  Set<Parameter> prunedParameters=new TreeSet<Parameter>(parameters);
  adapter.loadParameters(drone,prunedParameters);
  if (mParamsFilter != null && mParamsFilter.getVisibility() == View.VISIBLE) {
    mParamsFilter.setText("String_Node_Str");
  }
 else {
    filterInput(null);
  }
}
Program: 95101
Project: 95101
Buggy source:
private void toggleParameterFilter(){
  final boolean isEnabled=mPrefs.prefs.getBoolean(PREF_PARAMS_FILTER_ON,DEFAULT_PARAMS_FILTER_ON);
  if (isEnabled) {
    disableParameterFilter();
    mParamsFilter.setVisibility(View.GONE);
  }
 else {
    mParamsFilter.setVisibility(View.VISIBLE);
    enableParameterFilter();
  }
  mPrefs.prefs.edit().putBoolean(PREF_PARAMS_FILTER_ON,!isEnabled).apply();
}

Fixed version (ground truth):
private void toggleParameterFilter(boolean isVisible,boolean enableInput){
  if (isVisible) {
    mParamsFilter.setVisibility(View.VISIBLE);
    filterInput(mParamsFilter.getText());
    if (enableInput) {
      enableParameterFilter();
    }
 else {
      disableParameterFilter();
    }
  }
 else {
    disableParameterFilter();
    mParamsFilter.setVisibility(View.GONE);
    filterInput(null);
  }
  mPrefs.prefs.edit().putBoolean(PREF_PARAMS_FILTER_ON,isVisible).apply();
}
Program: 95102
Project: 95102
Buggy source:
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  final ArrayList<ParamsAdapterItem> pwms=new ArrayList<ParamsAdapterItem>();
  for (int i=0; i < adapter.getCount(); i++)   pwms.add(adapter.getItem(i));
  outState.putSerializable(ADAPTER_ITEMS,pwms);
}

Fixed version (ground truth):
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  final ArrayList<ParamsAdapterItem> pwms=new ArrayList<ParamsAdapterItem>(adapter.getOriginalValues());
  outState.putSerializable(ADAPTER_ITEMS,pwms);
}
Program: 95103
Project: 95103
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  final Context context=getActivity().getApplicationContext();
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.LOITERT));
  final LoiterTime item=(LoiterTime)this.itemRender.getMissionItem();
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(context,MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView cardAltitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  cardAltitudePicker.setViewAdapter(altitudeAdapter);
  cardAltitudePicker.setCurrentItem(altitudeAdapter.getItemIndex((int)item.getCoordinate().getAltitude().valueInMeters()));
  cardAltitudePicker.addChangingListener(this);
  final NumericWheelAdapter loiterTimeAdapter=new NumericWheelAdapter(context,0,600,"String_Node_Str");
  loiterTimeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView loiterTimePicker=(CardWheelHorizontalView)view.findViewById(R.id.loiterTimePicker);
  loiterTimePicker.setViewAdapter(loiterTimeAdapter);
  loiterTimePicker.setCurrentItem(loiterTimeAdapter.getItemIndex((int)item.getTime()));
  loiterTimePicker.addChangingListener(this);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  final Context context=getActivity().getApplicationContext();
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.LOITERT));
  final LoiterTime item=(LoiterTime)this.itemRender.getMissionItem();
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(context,MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView cardAltitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  cardAltitudePicker.setViewAdapter(altitudeAdapter);
  cardAltitudePicker.setCurrentValue((int)item.getCoordinate().getAltitude().valueInMeters());
  cardAltitudePicker.addChangingListener(this);
  final NumericWheelAdapter loiterTimeAdapter=new NumericWheelAdapter(context,0,600,"String_Node_Str");
  loiterTimeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView loiterTimePicker=(CardWheelHorizontalView)view.findViewById(R.id.loiterTimePicker);
  loiterTimePicker.setViewAdapter(loiterTimeAdapter);
  loiterTimePicker.setCurrentValue((int)item.getTime());
  loiterTimePicker.addChangingListener(this);
}
Program: 95104
Project: 95104
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  final Context context=getActivity().getApplicationContext();
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.SPLINE_WAYPOINT));
  SplineWaypoint item=(SplineWaypoint)this.itemRender.getMissionItem();
  final NumericWheelAdapter delayAdapter=new NumericWheelAdapter(context,0,60,"String_Node_Str");
  delayAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView delayPicker=(CardWheelHorizontalView)view.findViewById(R.id.waypointDelayPicker);
  delayPicker.setViewAdapter(delayAdapter);
  delayPicker.setCurrentItem(delayAdapter.getItemIndex((int)item.getDelay()));
  delayPicker.addChangingListener(this);
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(context,MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView altitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  altitudePicker.setViewAdapter(altitudeAdapter);
  altitudePicker.setCurrentItem(altitudeAdapter.getItemIndex((int)item.getCoordinate().getAltitude().valueInMeters()));
  altitudePicker.addChangingListener(this);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  final Context context=getActivity().getApplicationContext();
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.SPLINE_WAYPOINT));
  SplineWaypoint item=(SplineWaypoint)this.itemRender.getMissionItem();
  final NumericWheelAdapter delayAdapter=new NumericWheelAdapter(context,0,60,"String_Node_Str");
  delayAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView delayPicker=(CardWheelHorizontalView)view.findViewById(R.id.waypointDelayPicker);
  delayPicker.setViewAdapter(delayAdapter);
  delayPicker.setCurrentValue((int)item.getDelay());
  delayPicker.addChangingListener(this);
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(context,MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView altitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  altitudePicker.setViewAdapter(altitudeAdapter);
  altitudePicker.setCurrentValue((int)item.getCoordinate().getAltitude().valueInMeters());
  altitudePicker.addChangingListener(this);
}
Program: 95105
Project: 95105
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.TAKEOFF));
  Takeoff item=(Takeoff)this.itemRender.getMissionItem();
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(getActivity().getApplicationContext(),MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView cardAltitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  cardAltitudePicker.setViewAdapter(altitudeAdapter);
  cardAltitudePicker.setCurrentItem(altitudeAdapter.getItemIndex((int)item.getFinishedAlt().valueInMeters()));
  cardAltitudePicker.addChangingListener(this);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.TAKEOFF));
  Takeoff item=(Takeoff)this.itemRender.getMissionItem();
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(getActivity().getApplicationContext(),MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView cardAltitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  cardAltitudePicker.setViewAdapter(altitudeAdapter);
  cardAltitudePicker.setCurrentValue((int)item.getFinishedAlt().valueInMeters());
  cardAltitudePicker.addChangingListener(this);
}
Program: 95106
Project: 95106
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  final Context context=getActivity().getApplicationContext();
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.WAYPOINT));
  final Waypoint item=(Waypoint)this.itemRender.getMissionItem();
  final NumericWheelAdapter delayAdapter=new NumericWheelAdapter(context,0,60,"String_Node_Str");
  delayAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView delayPicker=(CardWheelHorizontalView)view.findViewById(R.id.waypointDelayPicker);
  delayPicker.setViewAdapter(delayAdapter);
  delayPicker.setCurrentItem(delayAdapter.getItemIndex((int)item.getDelay()));
  delayPicker.addChangingListener(this);
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(context,MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView altitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  altitudePicker.setViewAdapter(altitudeAdapter);
  altitudePicker.setCurrentItem(altitudeAdapter.getItemIndex((int)item.getCoordinate().getAltitude().valueInMeters()));
  altitudePicker.addChangingListener(this);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  final Context context=getActivity().getApplicationContext();
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.WAYPOINT));
  final Waypoint item=(Waypoint)this.itemRender.getMissionItem();
  final NumericWheelAdapter delayAdapter=new NumericWheelAdapter(context,0,60,"String_Node_Str");
  delayAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView delayPicker=(CardWheelHorizontalView)view.findViewById(R.id.waypointDelayPicker);
  delayPicker.setViewAdapter(delayAdapter);
  delayPicker.setCurrentValue((int)item.getDelay());
  delayPicker.addChangingListener(this);
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(context,MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView altitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  altitudePicker.setViewAdapter(altitudeAdapter);
  altitudePicker.setCurrentValue((int)item.getCoordinate().getAltitude().valueInMeters());
  altitudePicker.addChangingListener(this);
}
Program: 95107
Project: 95107
Buggy source:
@Override public void onChanged(AbstractWheel wheel,int oldValue,int newValue){
  for (  OnCardWheelChangedListener listener : mChangingListeners) {
    listener.onChanged(this,oldValue,newValue);
  }
}

Fixed version (ground truth):
@Override public void onChanged(AbstractWheel wheel,int oldIndex,int newIndex){
  final int oldValue=getValue(oldIndex);
  final int newValue=getValue(newIndex);
  for (  OnCardWheelChangedListener listener : mChangingListeners) {
    listener.onChanged(this,oldValue,newValue);
  }
}
Program: 95108
Project: 95108
Buggy source:
@Override public boolean onEditorAction(TextView v,int actionId,KeyEvent event){
  if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL) {
    hideSoftInput();
    final CharSequence input=v.getText();
    if (input != null) {
      final int update=Integer.parseInt(input.toString());
      final int updateIndex=mSpinnerWheel.getViewAdapter().getItemIndex(update);
      if (updateIndex == -1) {
        Toast.makeText(context,"String_Node_Str" + "String_Node_Str",Toast.LENGTH_LONG).show();
      }
 else {
        setCurrentItem(updateIndex,true);
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onEditorAction(TextView v,int actionId,KeyEvent event){
  if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL) {
    hideSoftInput();
    final CharSequence input=v.getText();
    if (input != null) {
      final int update=Integer.parseInt(input.toString());
      final int updateIndex=mSpinnerWheel.getViewAdapter().getItemIndex(update);
      if (updateIndex == -1) {
        Toast.makeText(context,"String_Node_Str" + "String_Node_Str",Toast.LENGTH_LONG).show();
      }
 else {
        setCurrentItemIndex(updateIndex,true);
      }
    }
    return true;
  }
  return false;
}
Program: 95109
Project: 95109
Buggy source:
@Override public void onItemClicked(AbstractWheel wheel,int itemIndex,boolean isCurrentItem){
  if (isCurrentItem) {
    final String currentValue=String.valueOf(mSpinnerWheel.getViewAdapter().getItem(itemIndex));
    showSoftInput(currentValue);
  }
 else {
    hideSoftInput();
    setCurrentItem(itemIndex,true);
  }
}

Fixed version (ground truth):
@Override public void onItemClicked(AbstractWheel wheel,int itemIndex,boolean isCurrentItem){
  if (isCurrentItem) {
    final String currentValue=String.valueOf(mSpinnerWheel.getViewAdapter().getItem(itemIndex));
    showSoftInput(currentValue);
  }
 else {
    hideSoftInput();
    setCurrentItemIndex(itemIndex,true);
  }
}
Program: 95111
Project: 95111
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  final Context context=getActivity().getApplicationContext();
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.LOITERT));
  final LoiterTime item=(LoiterTime)this.itemRender.getMissionItem();
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(context,MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView cardAltitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  cardAltitudePicker.setViewAdapter(altitudeAdapter);
  cardAltitudePicker.setCurrentItem(altitudeAdapter.getItemIndex((int)item.getCoordinate().getAltitude().valueInMeters()));
  cardAltitudePicker.addChangingListener(this);
  final NumericWheelAdapter loiterTimeAdapter=new NumericWheelAdapter(context,0,600,"String_Node_Str");
  loiterTimeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView loiterTimePicker=(CardWheelHorizontalView)view.findViewById(R.id.loiterTimePicker);
  loiterTimePicker.setViewAdapter(loiterTimeAdapter);
  loiterTimePicker.setCurrentItem(loiterTimeAdapter.getItemIndex((int)item.getTime()));
  loiterTimePicker.addChangingListener(this);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  final Context context=getActivity().getApplicationContext();
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.LOITERT));
  final LoiterTime item=(LoiterTime)this.itemRender.getMissionItem();
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(context,MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView cardAltitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  cardAltitudePicker.setViewAdapter(altitudeAdapter);
  cardAltitudePicker.setCurrentValue((int)item.getCoordinate().getAltitude().valueInMeters());
  cardAltitudePicker.addChangingListener(this);
  final NumericWheelAdapter loiterTimeAdapter=new NumericWheelAdapter(context,0,600,"String_Node_Str");
  loiterTimeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView loiterTimePicker=(CardWheelHorizontalView)view.findViewById(R.id.loiterTimePicker);
  loiterTimePicker.setViewAdapter(loiterTimeAdapter);
  loiterTimePicker.setCurrentValue((int)item.getTime());
  loiterTimePicker.addChangingListener(this);
}
Program: 95112
Project: 95112
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  final Context context=getActivity().getApplicationContext();
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.SPLINE_WAYPOINT));
  SplineWaypoint item=(SplineWaypoint)this.itemRender.getMissionItem();
  final NumericWheelAdapter delayAdapter=new NumericWheelAdapter(context,0,60,"String_Node_Str");
  delayAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView delayPicker=(CardWheelHorizontalView)view.findViewById(R.id.waypointDelayPicker);
  delayPicker.setViewAdapter(delayAdapter);
  delayPicker.setCurrentItem(delayAdapter.getItemIndex((int)item.getDelay()));
  delayPicker.addChangingListener(this);
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(context,MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView altitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  altitudePicker.setViewAdapter(altitudeAdapter);
  altitudePicker.setCurrentItem(altitudeAdapter.getItemIndex((int)item.getCoordinate().getAltitude().valueInMeters()));
  altitudePicker.addChangingListener(this);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  final Context context=getActivity().getApplicationContext();
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.SPLINE_WAYPOINT));
  SplineWaypoint item=(SplineWaypoint)this.itemRender.getMissionItem();
  final NumericWheelAdapter delayAdapter=new NumericWheelAdapter(context,0,60,"String_Node_Str");
  delayAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView delayPicker=(CardWheelHorizontalView)view.findViewById(R.id.waypointDelayPicker);
  delayPicker.setViewAdapter(delayAdapter);
  delayPicker.setCurrentValue((int)item.getDelay());
  delayPicker.addChangingListener(this);
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(context,MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView altitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  altitudePicker.setViewAdapter(altitudeAdapter);
  altitudePicker.setCurrentValue((int)item.getCoordinate().getAltitude().valueInMeters());
  altitudePicker.addChangingListener(this);
}
Program: 95113
Project: 95113
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.TAKEOFF));
  Takeoff item=(Takeoff)this.itemRender.getMissionItem();
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(getActivity().getApplicationContext(),MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView cardAltitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  cardAltitudePicker.setViewAdapter(altitudeAdapter);
  cardAltitudePicker.setCurrentItem(altitudeAdapter.getItemIndex((int)item.getFinishedAlt().valueInMeters()));
  cardAltitudePicker.addChangingListener(this);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.TAKEOFF));
  Takeoff item=(Takeoff)this.itemRender.getMissionItem();
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(getActivity().getApplicationContext(),MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView cardAltitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  cardAltitudePicker.setViewAdapter(altitudeAdapter);
  cardAltitudePicker.setCurrentValue((int)item.getFinishedAlt().valueInMeters());
  cardAltitudePicker.addChangingListener(this);
}
Program: 95114
Project: 95114
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  final Context context=getActivity().getApplicationContext();
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.WAYPOINT));
  final Waypoint item=(Waypoint)this.itemRender.getMissionItem();
  final NumericWheelAdapter delayAdapter=new NumericWheelAdapter(context,0,60,"String_Node_Str");
  delayAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView delayPicker=(CardWheelHorizontalView)view.findViewById(R.id.waypointDelayPicker);
  delayPicker.setViewAdapter(delayAdapter);
  delayPicker.setCurrentItem(delayAdapter.getItemIndex((int)item.getDelay()));
  delayPicker.addChangingListener(this);
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(context,MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView altitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  altitudePicker.setViewAdapter(altitudeAdapter);
  altitudePicker.setCurrentItem(altitudeAdapter.getItemIndex((int)item.getCoordinate().getAltitude().valueInMeters()));
  altitudePicker.addChangingListener(this);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  final Context context=getActivity().getApplicationContext();
  typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.WAYPOINT));
  final Waypoint item=(Waypoint)this.itemRender.getMissionItem();
  final NumericWheelAdapter delayAdapter=new NumericWheelAdapter(context,0,60,"String_Node_Str");
  delayAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView delayPicker=(CardWheelHorizontalView)view.findViewById(R.id.waypointDelayPicker);
  delayPicker.setViewAdapter(delayAdapter);
  delayPicker.setCurrentValue((int)item.getDelay());
  delayPicker.addChangingListener(this);
  final NumericWheelAdapter altitudeAdapter=new NumericWheelAdapter(context,MIN_ALTITUDE,MAX_ALTITUDE,"String_Node_Str");
  altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
  final CardWheelHorizontalView altitudePicker=(CardWheelHorizontalView)view.findViewById(R.id.altitudePicker);
  altitudePicker.setViewAdapter(altitudeAdapter);
  altitudePicker.setCurrentValue((int)item.getCoordinate().getAltitude().valueInMeters());
  altitudePicker.addChangingListener(this);
}
Program: 95115
Project: 95115
Buggy source:
@Override public void onChanged(AbstractWheel wheel,int oldValue,int newValue){
  for (  OnCardWheelChangedListener listener : mChangingListeners) {
    listener.onChanged(this,oldValue,newValue);
  }
}

Fixed version (ground truth):
@Override public void onChanged(AbstractWheel wheel,int oldIndex,int newIndex){
  final int oldValue=getValue(oldIndex);
  final int newValue=getValue(newIndex);
  for (  OnCardWheelChangedListener listener : mChangingListeners) {
    listener.onChanged(this,oldValue,newValue);
  }
}
Program: 95116
Project: 95116
Buggy source:
@Override public boolean onEditorAction(TextView v,int actionId,KeyEvent event){
  if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL) {
    hideSoftInput();
    final CharSequence input=v.getText();
    if (input != null) {
      final int update=Integer.parseInt(input.toString());
      final int updateIndex=mSpinnerWheel.getViewAdapter().getItemIndex(update);
      if (updateIndex == -1) {
        Toast.makeText(context,"String_Node_Str" + "String_Node_Str",Toast.LENGTH_LONG).show();
      }
 else {
        setCurrentItem(updateIndex,true);
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onEditorAction(TextView v,int actionId,KeyEvent event){
  if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL) {
    hideSoftInput();
    final CharSequence input=v.getText();
    if (input != null) {
      final int update=Integer.parseInt(input.toString());
      final int updateIndex=mSpinnerWheel.getViewAdapter().getItemIndex(update);
      if (updateIndex == -1) {
        Toast.makeText(context,"String_Node_Str" + "String_Node_Str",Toast.LENGTH_LONG).show();
      }
 else {
        setCurrentItemIndex(updateIndex,true);
      }
    }
    return true;
  }
  return false;
}
Program: 95117
Project: 95117
Buggy source:
@Override public void onItemClicked(AbstractWheel wheel,int itemIndex,boolean isCurrentItem){
  if (isCurrentItem) {
    final String currentValue=String.valueOf(mSpinnerWheel.getViewAdapter().getItem(itemIndex));
    showSoftInput(currentValue);
  }
 else {
    hideSoftInput();
    setCurrentItem(itemIndex,true);
  }
}

Fixed version (ground truth):
@Override public void onItemClicked(AbstractWheel wheel,int itemIndex,boolean isCurrentItem){
  if (isCurrentItem) {
    final String currentValue=String.valueOf(mSpinnerWheel.getViewAdapter().getItem(itemIndex));
    showSoftInput(currentValue);
  }
 else {
    hideSoftInput();
    setCurrentItemIndex(itemIndex,true);
  }
}
Program: 95120
Project: 95120
Buggy source:
@Override public void onDrawerClosed(){
  updateMapPadding();
  GAUtils.sendTiming(new HitBuilders.TimingBuilder().setCategory(GAUtils.Category.FLIGHT_DATA_DETAILS_PANEL.toString()).setVariable(getString(R.string.ga_mode_details_close_panel)).setValue(System.currentTimeMillis()));
}

Fixed version (ground truth):
@Override public void onDrawerClosed(){
  updateMapPadding();
  GAUtils.sendTiming(new HitBuilders.TimingBuilder().setCategory(GAUtils.Category.FLIGHT_DATA_DETAILS_PANEL).setVariable(getString(R.string.ga_mode_details_close_panel)).setValue(System.currentTimeMillis()));
}
Program: 95121
Project: 95121
Buggy source:
@Override public void onDrawerOpened(){
  updateMapPadding();
  GAUtils.sendTiming(new HitBuilders.TimingBuilder().setCategory(GAUtils.Category.FLIGHT_DATA_DETAILS_PANEL.toString()).setVariable(getString(R.string.ga_mode_details_open_panel)).setValue(System.currentTimeMillis()));
}

Fixed version (ground truth):
@Override public void onDrawerOpened(){
  updateMapPadding();
  GAUtils.sendTiming(new HitBuilders.TimingBuilder().setCategory(GAUtils.Category.FLIGHT_DATA_DETAILS_PANEL).setVariable(getString(R.string.ga_mode_details_open_panel)).setValue(System.currentTimeMillis()));
}
Program: 95122
Project: 95122
Buggy source:
/** 
 * Toggle the current state of the MAVlink connection. Starting and closing the as needed. May throw a onConnect or onDisconnect callback
 */
private void connectMAVConnection(){
  String connectionType=mAppPrefs.getMavLinkConnectionType();
  Utils.ConnectionType connType=Utils.ConnectionType.valueOf(connectionType);
  if (mavConnection == null || mavConnection.getConnectionType() != connType.getConnectionType()) {
    mavConnection=connType.getConnection(this);
  }
  if (mavConnection.getConnectionStatus() == MavLinkConnection.MAVLINK_DISCONNECTED) {
    mavConnection.connect();
  }
  GAUtils.sendEvent(new HitBuilders.EventBuilder().setCategory(GAUtils.Category.MAVLINK_CONNECTION.toString()).setAction("String_Node_Str" + connectionType + "String_Node_Str"+ mavConnection.toString()+ "String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Toggle the current state of the MAVlink connection. Starting and closing the as needed. May throw a onConnect or onDisconnect callback
 */
private void connectMAVConnection(){
  String connectionType=mAppPrefs.getMavLinkConnectionType();
  Utils.ConnectionType connType=Utils.ConnectionType.valueOf(connectionType);
  if (mavConnection == null || mavConnection.getConnectionType() != connType.getConnectionType()) {
    mavConnection=connType.getConnection(this);
  }
  if (mavConnection.getConnectionStatus() == MavLinkConnection.MAVLINK_DISCONNECTED) {
    mavConnection.connect();
  }
  GAUtils.sendEvent(new HitBuilders.EventBuilder().setCategory(GAUtils.Category.MAVLINK_CONNECTION).setAction("String_Node_Str").setLabel(connectionType + "String_Node_Str" + mavConnection.toString()+ "String_Node_Str"));
}
Program: 95123
Project: 95123
Buggy source:
private void disconnectMAVConnection(){
  Log.d(LOG_TAG,"String_Node_Str");
  if (mavConnection != null && mavConnection.getConnectionStatus() != MavLinkConnection.MAVLINK_DISCONNECTED) {
    mavConnection.disconnect();
  }
  GAUtils.sendEvent(new HitBuilders.EventBuilder().setCategory(GAUtils.Category.MAVLINK_CONNECTION.toString()).setAction("String_Node_Str"));
}

Fixed version (ground truth):
private void disconnectMAVConnection(){
  Log.d(LOG_TAG,"String_Node_Str");
  if (mavConnection != null && mavConnection.getConnectionStatus() != MavLinkConnection.MAVLINK_DISCONNECTED) {
    mavConnection.disconnect();
  }
  GAUtils.sendEvent(new HitBuilders.EventBuilder().setCategory(GAUtils.Category.MAVLINK_CONNECTION).setAction("String_Node_Str"));
}
Program: 95124
Project: 95124
Buggy source:
@Override public void onPause(){
  super.onPause();
  drone.removeDroneListener(this);
  mMapFragment.saveCameraPosition();
}

Fixed version (ground truth):
@Override public void onPause(){
  super.onPause();
  drone.removeDroneListener(this);
  mHandler.removeCallbacksAndMessages(null);
  mMapFragment.saveCameraPosition();
}
Program: 95126
Project: 95126
Buggy source:
public static void startNewSession(Context context){
  final DroidPlannerPrefs prefs=new DroidPlannerPrefs(context);
  final String connectionType=prefs.getMavLinkConnectionType();
  final String login=prefs.getDroneshareLogin();
  final String password=prefs.getDronesharePassword();
  final boolean isDroneShareUser=prefs.getLiveUploadEnabled() && !login.isEmpty() && !password.isEmpty();
  sendHit(new HitBuilders.AppViewBuilder().setNewSession().setCustomDimension(CustomDimension.MAVLINK_CONNECTION_TYPE.getIndex(),connectionType).setCustomDimension(CustomDimension.DRONESHARE_ACTIVE.getIndex(),String.valueOf(isDroneShareUser)).build());
}

Fixed version (ground truth):
public static void startNewSession(Context context){
  final DroidPlannerPrefs prefs=new DroidPlannerPrefs(context);
  final String connectionType=prefs.getMavLinkConnectionType();
  final String login=prefs.getDroneshareLogin();
  final String password=prefs.getDronesharePassword();
  final boolean isDroneShareUser=prefs.getLiveUploadEnabled() && !login.isEmpty() && !password.isEmpty();
  sendHit(new HitBuilders.AppViewBuilder().setNewSession().setCustomDimension(CustomDimension.MAVLINK_CONNECTION_TYPE,connectionType).setCustomDimension(CustomDimension.DRONESHARE_ACTIVE,String.valueOf(isDroneShareUser)).build());
}