Buggy code:
public class ModelController { @ FXML private TabPane tabPane ; @ FXML private Tab depResultTab ; @ FXML private Tab retResultTab ; @ FXML private BookingTab bookingTab ; @ FXML private ComboBox < Airport > depAirp ; @ FXML private ComboBox < Airport > arrAirp ; @ FXML private DatePicker depDate ; @ FXML private DatePicker returnDate ; @ FXML private CheckBox oneWayCheckbox ; @ FXML private CheckBox flexDatesCheckbox ; @ FXML private CheckBox layoversCheckbox ; @ FXML private Button searchButton ; @ FXML private FlightTable departureTable ; @ FXML private TreeTableColumn < FlightResult , String > flightNumbCol ; @ FXML private TreeTableColumn < FlightResult , String > depAirpCol ; @ FXML private TreeTableColumn < FlightResult , String > arrAirpCol ; @ FXML private TreeTableColumn < FlightResult , String > depTimeCol ; @ FXML private TreeTableColumn < FlightResult , String > arrTimeCol ; @ FXML private TreeTableColumn < FlightResult , Number > layoversCol ; @ FXML private TreeTableColumn < FlightResult , String > priceCol ; @ FXML private TreeTableColumn < FlightResult , String > layoverTimeCol ; @ FXML private FlightTable returnTable ; @ FXML private TreeTableColumn < FlightResult , String > retFlightNumbCol ; @ FXML private TreeTableColumn < FlightResult , String > retDepAirpCol ; @ FXML private TreeTableColumn < FlightResult , String > retArrAirpCol ; @ FXML private TreeTableColumn < FlightResult , String > retDepTimeCol ; @ FXML private TreeTableColumn < FlightResult , String > retArrTimeCol ; @ FXML private TreeTableColumn < FlightResult , Number > retLayoversCol ; @ FXML private TreeTableColumn < FlightResult , String > retPriceCol ; @ FXML private TreeTableColumn < FlightResult , String > retLayoverTimeCol ; @ FXML private Slider priceRange ; @ FXML private Slider layoverTime ; @ FXML private Label priceLabel ; @ FXML private Label layoverLabel ; private MainView mainView ; public ModelController ( ) { } @ FXML private void initialize ( ) { } private void setupTabs ( ) { } public void setMainView ( MainView mainView ) { } private void initializeTableColumns ( ) { } private void search ( ) { String depCode = depAirp . getSelectionModel ( ) . getSelectedItem ( ) . getCode ( ) ; String arrCode = arrAirp . getSelectionModel ( ) . getSelectedItem ( ) . getCode ( ) ; LocalDate departDate = depDate . getValue ( ) ; LocalDate retDate = returnDate . getValue ( ) ; Boolean oneWay = oneWayCheckbox . isSelected ( ) ; Boolean flexDates = flexDatesCheckbox . isSelected ( ) ; Boolean layovers = layoversCheckbox . isSelected ( ) ; BigDecimal price = new BigDecimal ( priceRange . getValue ( ) ) ; long layoTime = ( ( long ) ( layoverTime . getValue ( ) ) ) ; try { ArrayList < FlightResult > depResults = FlightSearch . search ( departDate , depCode , arrCode , price , layoTime , flexDates , layovers ) ; Collections . sort ( depResults ) ; departureTable . updateResults ( depResults ) ; if ( ( depResults != null ) && ( ( depResults . size ( ) ) != 0 ) ) { depResultTab . setDisable ( false ) ; tabPane . getSelectionModel ( ) . select ( depResultTab ) ; } else { depResultTab . setDisable ( true ) ; } ArrayList < FlightResult > retResults = null ; if ( ! oneWay ) { retResults = FlightSearch . search ( retDate , arrCode , depCode , price , layoTime , flexDates , layovers ) ; Collections . sort ( retResults ) ; returnTable . updateResults ( retResults ) ; if ( ( retResults != null ) && ( ( retResults . size ( ) ) != 0 ) ) { retResultTab . setDisable ( false ) ; <START_BUG> if ( ( depResults == null ) || ( ( depResults . size ( ) ) != 0 ) ) { <END_BUG> tabPane . getSelectionModel ( ) . select ( retResultTab ) ; } } else { retResultTab . setDisable ( true ) ; } } if ( ( ( depResults == null ) && ( ( retResults == null ) || oneWay ) ) || ( ( ( ( depResults . size ( ) ) == 0 ) && ( ( retResults . size ( ) ) == 0 ) ) || oneWay ) ) { Stage dialogStage = new Stage ( ) ; dialogStage . initModality ( Modality . WINDOW_MODAL ) ; dialogStage . setTitle ( "No<seq2seq4repair_space>results" ) ; Alert alert = new Alert ( Alert . AlertType . ERROR ) ; alert . setTitle ( "No<seq2seq4repair_space>results" ) ; alert . setContentText ( "No<seq2seq4repair_space>results<seq2seq4repair_space>for<seq2seq4repair_space>these<seq2seq4repair_space>search<seq2seq4repair_space>parameters,<seq2seq4repair_space>please<seq2seq4repair_space>try<seq2seq4repair_space>different<seq2seq4repair_space>parameters" ) ; alert . show ( ) ; } } catch ( SQLException e ) { e . printStackTrace ( ) ; Stage dialogStage = new Stage ( ) ; dialogStage . initModality ( Modality . WINDOW_MODAL ) ; dialogStage . setTitle ( "Database<seq2seq4repair_space>error" ) ; Alert alert = new Alert ( Alert . AlertType . ERROR ) ; alert . setTitle ( "Database<seq2seq4repair_space>error" ) ; alert . setContentText ( e . getMessage ( ) ) ; alert . show ( ) ; } } private void setupCheckboxes ( ) { } private void setupDatePickers ( ) { } private void setDateTimeFormat ( DatePicker datePicker ) { } private void setupSliders ( ) { } private void setPriceRangeValue ( double value ) { } private void setLayoverTimeValue ( double value ) { } private void setupAirportLists ( ) { } }

Fix:
if ( ( depResults == null ) || ( ( depResults . size ( ) ) == 0 ) ) {