Buggy code:
private StandardTableModel stm ; private JFrame frame = new JFrame ( ) ; private JPanel content = new JPanel ( ) ; private JLabel userLabel = new JLabel ( "Name:" ) ; private JTextField userField = new JTextField ( ) ; private JButton userButton = new JButton ( "Select" ) ; private JLabel dateLabel = new JLabel ( "Period:" ) ; private JLabel dateToLabel = new JLabel ( "to" ) ; private JTextField dateFromField = new JTextField ( ) ; private JTextField dateToField = new JTextField ( ) ; private JButton dateFromButton = new JButton ( ) ; private JButton dateToButton = new JButton ( ) ; private boolean dateFromValid = false ; private boolean dateToValid = false ; private JLabel vehicleTypeLabel = new JLabel ( "Vehicle<seq2seq4repair_space>type:" ) ; private JComboBox < String > vehicleTypeComboBox = new JComboBox < String > ( ) ; private JLabel gearTypeLabel = new JLabel ( "Gear<seq2seq4repair_space>type:" ) ; private JComboBox < String > gearTypeComboBox = new JComboBox < String > ( ) ; private JLabel vehicleText = new JLabel ( "(no<seq2seq4repair_space>vehicle)" ) ; private int existingResID ; private String vehicleID ; private int userID = - 1 ; private int vehicleType = - 1 ; private boolean aut ; private String fromDate ; private String toDate ; private JButton cancelButton = new JButton ( "Cancel" ) ; private JButton findButton = new JButton ( "Find<seq2seq4repair_space>vehicle" ) ; private JButton okButton = new JButton ( "OK" ) ; public ReservationView ( StandardTableModel stm ) { } public JFrame showCreateWindow ( ) { } public JFrame showExistingWindow ( int resID ) { existingResID = resID ; frame . setTitle ( ( "Edit<seq2seq4repair_space>Reservation<seq2seq4repair_space>" + resID ) ) ; Reservation res = Controller . getReservation ( resID ) ; Customer cust = Controller . getCustomer ( res . getUserID ( ) ) ; Vehicle veh = Controller . getVehicle ( res . getVehicleID ( ) ) ; userField . setText ( ( ( ( ( ( ( cust . getFirstName ( ) ) + "<seq2seq4repair_space>" ) + ( cust . getLastName ( ) ) ) + "<seq2seq4repair_space>(" ) + ( res . getUserID ( ) ) ) + ")" ) ) ; dateFromField . setText ( res . getFromDate ( ) ) ; dateToField . setText ( res . getToDate ( ) ) ; vehicleTypeComboBox . setSelectedIndex ( ( ( veh . getTypeID ( ) ) - 1 ) ) ; boolean automatic = veh . isAutomatic ( ) ; if ( ! automatic ) gearTypeComboBox . setSelectedIndex ( 0 ) ; else gearTypeComboBox . setSelectedIndex ( 1 ) ; vehicleText . setText ( ( ( ( ( ( ( ( ( ( ( veh . getMake ( ) ) + "<seq2seq4repair_space>" ) + ( veh . getModel ( ) ) ) + "<seq2seq4repair_space>(" ) + ( veh . getID ( ) ) ) + ")" ) + "<seq2seq4repair_space>Fuel:<seq2seq4repair_space>" ) + ( veh . getFuelName ( ) ) ) + "<seq2seq4repair_space>Automatic:<seq2seq4repair_space>" ) + ( veh . isAutomatic ( ) ) ) ) ; userButton . setEnabled ( false ) ; vehicleID = res . getVehicleID ( ) ; userID = cust . getUserID ( ) ; vehicleType = res . getTypeID ( ) ; aut = veh . isAutomatic ( ) ; fromDate = res . getFromDate ( ) ; toDate = res . getToDate ( ) ; final int oldResID = resID ; final String oldFromDate = res . getFromDate ( ) ; final String oldToDate = res . getToDate ( ) ; final String oldVehicleID = veh . getID ( ) ; final int oldVehicleType = res . getTypeID ( ) ; findButton . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { <START_BUG> if ( ( ( ( ( ( vehicleTypeComboBox . getSelectedIndex ( ) ) != ( - 1 ) ) || ( ( gearTypeComboBox . getSelectedIndex ( ) ) != ( - 1 ) ) ) || ( ( dateFromValid ) == false ) ) || ( ( dateToValid ) == false ) ) || ( ( userID ) != ( - 1 ) ) ) { <END_BUG> Controller . removeReservation ( existingResID ) ; if ( ( Controller . findAvailableVehicle ( vehicleType , aut , fromDate , toDate ) ) != null ) { Vehicle v = Controller . findAvailableVehicle ( vehicleType , aut , fromDate , toDate ) ; vehicleText . setText ( ( ( ( ( ( ( ( ( ( ( v . getMake ( ) ) + "<seq2seq4repair_space>" ) + ( v . getModel ( ) ) ) + "<seq2seq4repair_space>(" ) + ( v . getID ( ) ) ) + ")" ) + "<seq2seq4repair_space>Fuel:<seq2seq4repair_space>" ) + ( v . getFuelName ( ) ) ) + "<seq2seq4repair_space>Automatic:<seq2seq4repair_space>" ) + ( v . isAutomatic ( ) ) ) ) ; vehicleID = v . getID ( ) ; vehicleType = v . getTypeID ( ) ; okButton . setEnabled ( true ) ; Controller . newReservationByID ( oldResID , userID , 0 , oldVehicleType , oldVehicleID , oldFromDate , oldToDate , 0 ) ; } else { vehicleText . setText ( "(no<seq2seq4repair_space>vehicle<seq2seq4repair_space>available<seq2seq4repair_space>with<seq2seq4repair_space>specified<seq2seq4repair_space>parameters)" ) ; okButton . setEnabled ( false ) ; Controller . newReservation ( userID , 0 , vehicleType , vehicleID , fromDate , toDate , 0 ) ; } } else { vehicleText . setText ( "(please<seq2seq4repair_space>set<seq2seq4repair_space>all<seq2seq4repair_space>parameters)" ) ; okButton . setEnabled ( false ) ; } } } ) ; okButton . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { Controller . removeReservation ( oldResID ) ; Controller . newReservationByID ( oldResID , userID , 0 , vehicleType , vehicleID , fromDate , toDate , 0 ) ; stm . setData ( Controller . getReservationList ( ) ) ; frame . dispose ( ) ; } } ) ; frame . setVisible ( true ) ; return frame ;

Fix:
if ( ( ( ( ( ( vehicleTypeComboBox . getSelectedIndex ( ) ) != ( - 1 ) ) || ( ( gearTypeComboBox . getSelectedIndex ( ) ) != ( - 1 ) ) ) || ( ( dateFromValid ) == false ) ) || ( ( dateToValid ) == false ) ) || ( ( userID ) > ( - 1 ) ) ) {