Buggy code:
public class MapActivity extends BaseActivity { private static final int MIN_TIME_INTERVAL_MS = 1000 ; private static final int MIN_DISTANCE_INTERVAL_M = 3 ; private static final int DELAY = 60000 ; private static final String DISTANCE_UNIT_DISTANCE = "<seq2seq4repair_space>km" ; private static final String DISTANCE_UNIT_DIFF = "<seq2seq4repair_space>km" ; private static final String HOUR_UNIT = "<seq2seq4repair_space>h" ; private static final String MINUTE_UNIT = "<seq2seq4repair_space>min" ; private static final String SPEED_UNIT = "<seq2seq4repair_space>km//h" ; private static final float CONVERT_SPEED_UNIT_TO_KMH = 3600 ; public static final String EXTRA_HIKE = "hike" ; private static final int REQUEST_CODE_FINISH_HIKE = 1 ; private Map map ; private LocationManager locManager ; private Hike newHike ; private TextView distanceTextView ; private TextView speedTextView ; private TextView durationTextView ; private TextView positiveAltitudeTextView ; private TextView negativeAltitudeTextView ; private ImageView slidingIcon ; private MapActivity . FollowHikeLocationListener locListener ; private ViewStub mapContainer ; private AlertDialog alert = null ; private Context context ; private long startTime = 0 ; private Handler timerHandler = new Handler ( ) ; private Runnable timerRunnable = new Runnable ( ) { float speed = 0 ; @ Override public void run ( ) { } } ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onDestroy ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onResume ( ) { } @ Override public void onBackPressed ( ) { } private void showAlertMessageNoGps ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } public class FollowHikeLocationListener implements LocationListener { double currentAltitude = 0 ; double previousAltitude = Double . NEGATIVE_INFINITY ; double positiveHeightDifference = 0 ; double negativeHeightDifference = 0 ; @ Override public void onLocationChanged ( Location location ) { <START_BUG> if ( ( location . getSpeed ( ) ) >= 0 ) { <END_BUG> map . followingHike ( new com . google . android . gms . maps . model . LatLng ( location . getLatitude ( ) , location . getLongitude ( ) ) ) ; newHike . extendHike ( new com . google . android . gms . maps . model . LatLng ( location . getLatitude ( ) , location . getLongitude ( ) ) ) ; distanceTextView . setText ( ( ( String . format ( "%.2f" , newHike . getDistance ( ) ) ) + ( MapActivity . DISTANCE_UNIT_DISTANCE ) ) ) ; currentAltitude = location . getAltitude ( ) ; if ( ( ( currentAltitude ) > ( previousAltitude ) ) && ( ( previousAltitude ) != ( Double . NEGATIVE_INFINITY ) ) ) { positiveHeightDifference += ( currentAltitude ) - ( previousAltitude ) ; positiveAltitudeTextView . setText ( ( ( String . format ( "%.2f" , positiveHeightDifference ) ) + ( MapActivity . DISTANCE_UNIT_DIFF ) ) ) ; newHike . setPositiveDiffHeight ( ( ( float ) ( positiveHeightDifference ) ) ) ; } else if ( ( ( currentAltitude ) < ( previousAltitude ) ) && ( ( previousAltitude ) != ( Double . NEGATIVE_INFINITY ) ) ) { negativeHeightDifference += ( currentAltitude ) - ( previousAltitude ) ; negativeAltitudeTextView . setText ( ( ( String . format ( "%.2f" , negativeHeightDifference ) ) + ( MapActivity . DISTANCE_UNIT_DIFF ) ) ) ; newHike . setNegativeDiffHeight ( ( ( float ) ( negativeHeightDifference ) ) ) ; } previousAltitude = currentAltitude ; } } @ Override public void onProviderDisabled ( String provider ) { } @ Override public void onProviderEnabled ( String provider ) { } @ Override public void onStatusChanged ( String provider , int status , Bundle extras ) { } } private class SlidingUpPanelListener implements PanelSlideListener { private ImageView imageView ; public SlidingUpPanelListener ( ImageView imageView ) { } @ Override public void onPanelSlide ( View panel , float slideOffset ) { } @ Override public void onPanelCollapsed ( View panel ) { } @ Override public void onPanelExpanded ( View panel ) { } @ Override public void onPanelAnchored ( View panel ) { } @ Override public void onPanelHidden ( View panel ) { } } }

Fix:
if ( ( location . getSpeed ( ) ) > 0 ) {