Buggy code:
class UI { private int num_uis ; private SQLHandler sql_handler ; private Scanner scan ; private Console con ; public String pub_email ; public String pub_role ; UI ( SQLHandler sql_handler , Console con ) { } public void GenerateViews ( ) throws SQLException { } public void WelcomeScreen ( ) throws SQLException { } public void Register ( ) throws SQLException { } private void Login ( ) throws SQLException { System . out . println ( "Login." ) ; String email = "" ; String pword = "" ; String role = "" ; while ( true ) { email = con . readLine ( "Email:<seq2seq4repair_space>" ) ; char [ ] pwordA = con . readPassword ( "Password:" ) ; pword = String . valueOf ( pwordA ) ; if ( ! ( validEmail ( email ) ) ) { System . out . println ( "Invalid<seq2seq4repair_space>email." ) ; return ; } if ( ! ( validPassword ( pword ) ) ) { System . out . println ( "Invalid<seq2seq4repair_space>password." ) ; return ; } <START_BUG> String query = ( "select<seq2seq4repair_space>email,<seq2seq4repair_space>password<seq2seq4repair_space>from<seq2seq4repair_space>users<seq2seq4repair_space>where<seq2seq4repair_space>email='" + email ) + "'" ; <END_BUG> ResultSet rs = sql_handler . runSQLQuery ( query ) ; if ( ! ( rs . next ( ) ) ) { System . out . println ( "Invalid<seq2seq4repair_space>email//password<seq2seq4repair_space>combination." ) ; return ; } query = ( "select<seq2seq4repair_space>*<seq2seq4repair_space>from<seq2seq4repair_space>airline_agents<seq2seq4repair_space>where<seq2seq4repair_space>email='" + email ) + "'" ; rs = sql_handler . runSQLQuery ( query ) ; if ( rs . next ( ) ) { role = "poweruser" ; String airline_email = rs . getString ( "EMAIL" ) ; String airline_name = rs . getString ( "NAME" ) ; System . out . println ( ( "Airline<seq2seq4repair_space>Agent:<seq2seq4repair_space>" + airline_name ) ) ; } else { role = "user" ; System . out . println ( "Standard<seq2seq4repair_space>User." ) ; } String statement = ( ( "update<seq2seq4repair_space>users<seq2seq4repair_space>" + ( "set<seq2seq4repair_space>last_login=sysdate<seq2seq4repair_space>" + "where<seq2seq4repair_space>email='" ) ) + ( pub_email ) ) + "'" ; sql_handler . runSQLStatement ( statement ) ; System . out . println ( "Login<seq2seq4repair_space>Successful.<seq2seq4repair_space>" ) ; pub_email = email ; pub_role = role ; MainHub ( ) ; } } public void MainHub ( ) throws SQLException { } public void SearchForFlights ( ) throws SQLException { } private int printFlightPlans ( ResultSet rs , int planId , ArrayList < String > flightnolist , ArrayList < String > flightnolist2 ) throws SQLException { } public void MakeABooking ( String flightno1 , String flightno2 ) throws SQLException { } public void ExistingBookings ( ) throws SQLException { } public void BookingDetail ( String tno ) throws SQLException { } public void CancelBooking ( String tno ) throws SQLException { } public void Logout ( ) throws SQLException { } public void RecordDeparture ( ) throws SQLException { } public void RecordArrival ( ) throws SQLException { } public void RoundTrips ( ) throws SQLException { } private boolean validEmail ( String e ) { } private boolean validPassword ( String pword ) { } public static boolean isInteger ( String s , int radix ) { } public static boolean isValidDate ( String input ) { } private boolean validAcode ( String ac ) throws SQLException { } }

Fix:
String query = ( "select<seq2seq4repair_space>email,<seq2seq4repair_space>pass<seq2seq4repair_space>from<seq2seq4repair_space>users<seq2seq4repair_space>where<seq2seq4repair_space>email='" + email ) + "'" ;