Buggy code:
else { } mDbOpenHelper . close ( ) ; flowclass flowget = null ; ArrayList < flowclass > mflow = selectflowStation ( cx , count_srl ) ; if ( ( ( mflow . size ( ) ) > 0 ) && ( mflow != null ) ) flowget = mflow . get ( 0 ) ; ArrayList < InfoClass > stations = null ; int station_left = 0 ; String stationListString = null ; if ( ( mflow . size ( ) ) > 0 ) stations = getStations ( flowget . country_srl , flowget . route_srl , flowget . way_srl ) ; if ( ( ( mflow . size ( ) ) > 0 ) && ( ( stations . size ( ) ) > 0 ) ) { for ( int i = 0 ; i < ( stations . size ( ) ) ; i ++ ) { if ( ( ( stations . get ( i ) . id ) == goal_id ) && ( goal_id != 0 ) ) station_left = ( stations . get ( i ) . station_srl ) - ( flowget . station_srl ) ; if ( ( flowget . station_srl ) <= ( stations . get ( i ) . station_srl ) ) stationListString = ( stationListString == null ) ? ( ( getString ( currunt ) ) + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( stations . get ( i ) . station_name ) : ( stationListString + "\n\n" ) + ( stations . get ( i ) . station_name ) ; } } if ( ( ( ic . size ( ) ) > 0 ) && ( ( last_nearby_sration_id ) != ( ic . get ( 0 ) . id ) ) ) { last_nearby_sration_id = ic . get ( 0 ) . id ; same_place = false ; } else { same_place = true ; } global . log ( ( "same_place<seq2seq4repair_space>:<seq2seq4repair_space>" + ( same_place_count ) ) ) ; global . log ( ( "getlolevel<seq2seq4repair_space>:<seq2seq4repair_space>" + near_level ) ) ; if ( ( ( ( mflow . size ( ) ) > 0 ) && ( ( stations . size ( ) ) > 0 ) ) && ( ( last_station_id ) != ( flowget . id_srl ) ) ) { last_station_id = flowget . id_srl ; String next_name = ( ( mflow . get ( 0 ) . station_srl ) < ( stations . size ( ) ) ) ? "▶<seq2seq4repair_space>" + ( stations . get ( mflow . get ( 0 ) . station_srl ) . station_name ) : "<seq2seq4repair_space>:<seq2seq4repair_space>" + ( getString ( terminal ) ) ; String direction_name = stations . get ( ( ( stations . size ( ) ) - 1 ) ) . station_name ; if ( ( global . getGoalID ( cx ) ) == 0 ) { <START_BUG> if ( ( waitingbus ) && ( ( ( ( action_count ) < 5 ) && ( ( same_place_count ) != 0 ) ) || ( ( ( action_count ) <= 1 ) && ( ( same_place_count ) == 0 ) ) ) ) { <END_BUG> sendNoti ( WAITING_BUS_NOTI , 1 , getString ( nearby_bus_routes ) , global . arraylistStringtoString ( routes ) ) ; } else { if ( ( ( mflow . size ( ) ) > 0 ) && ( next_name != null ) ) sendBusNoti ( DEFUALT_NOTI , 1 , stations . get ( ( ( flowget . station_srl ) - 1 ) ) . station_name , next_name , direction_name , stationListString , flowget . country_srl , flowget . route_srl , flowget . way_srl , ( ( flowget . station_srl ) - 1 ) ) ; } } else { if ( ( ( ( mflow . size ( ) ) > 0 ) && ( next_name != null ) ) && ( station_left > 1 ) ) { sendBusNoti ( DEFUALT_NOTI , 1 , ( station_left + ( getString ( _stations_left ) ) ) , ( ( ( stations . get ( ( ( flowget . station_srl ) - 1 ) ) . station_name ) + "\n" ) + next_name ) , direction_name , stationListString , flowget . country_srl , flowget . route_srl , flowget . way_srl , ( ( flowget . station_srl ) - 1 ) ) ; } else { if ( station_left < 0 ) { sendBusNoti ( 1 , 1 , getString ( missed_the_stop ) , ( ( ( stations . get ( ( ( flowget . station_srl ) - 1 ) ) . station_name ) + "\n" ) + next_name ) , direction_name , stationListString , flowget . country_srl , flowget . route_srl , flowget . way_srl , ( ( flowget . station_srl ) - 1 ) ) ; } else { if ( station_left != 0 ) sendBusNoti ( 2 , 1 , getString ( almost_arrived ) , ( ( ( ( ( station_left + ( getString ( _stations_left ) ) ) + "\n\n" ) + ( stations . get ( ( ( flowget . station_srl ) - 1 ) ) . station_name ) ) + "\n" ) + next_name ) , direction_name , stationListString , flowget . country_srl , flowget . route_srl , flowget . way_srl , ( ( flowget . station_srl ) - 1 ) ) ; if ( ( station_left == 0 ) && ( ( global . getGoalID ( cx ) ) == ( flowget . id_srl ) ) ) { arrivedAction ( cx , getString ( destinaton_arrived ) , stations . get ( ( ( flowget . station_srl ) - 1 ) ) . station_name ) ; }

Fix:
if ( ( waitingbus ) && ( ( ( ( action_count ) < 2 ) && ( ( location_mode ) < ( globalv . ACTIVE_MODE ) ) ) || ( ( ( action_count ) <= 1 ) && ( ( same_place_count ) == 0 ) ) ) ) {