Buggy code:
public class Dao { public boolean loginUser ( LoginStudentBean lsb ) { } public void newUser ( LoginStudentBean lsb ) { } public int newStudent ( StudentBean sb ) { Connection conn = DatabaseManager . getConnection ( ) ; try { PreparedStatement ps = conn . prepareStatement ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>student<seq2seq4repair_space>(firstname,lastname,leasenumber,parkingnumber,dob,phone,alternatephone,nationality,address,city,state,country,zip,year,specialneeds,comments,sex,smoker,guest)<seq2seq4repair_space>VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" , Statement . RETURN_GENERATED_KEYS ) ; ps . setString ( 0 , sb . firstname ) ; ps . setString ( 1 , sb . lastname ) ; ps . setLong ( 2 , sb . leasenumber ) ; ps . setLong ( 3 , sb . parkingnumber ) ; ps . setString ( 4 , sb . dob ) ; ps . setString ( 5 , sb . phone ) ; ps . setString ( 6 , sb . alternatephone ) ; ps . setString ( 7 , sb . nationality ) ; ps . setString ( 8 , sb . address ) ; ps . setString ( 9 , sb . city ) ; ps . setString ( 10 , sb . state ) ; ps . setString ( 11 , sb . country ) ; ps . setString ( 12 , sb . zip ) ; <START_BUG> String year = sb . year . toLowerCase ( ) ; <END_BUG> if ( year . equals ( "freshman" ) ) { ps . setInt ( 13 , 0 ) ; } else if ( year . equals ( "sophomore" ) ) { ps . setInt ( 13 , 1 ) ; } else if ( year . equals ( "junior" ) ) { ps . setInt ( 13 , 2 ) ; } else if ( year . equals ( "senior" ) ) { ps . setInt ( 13 , 3 ) ; } else if ( year . equals ( "graduate" ) ) { ps . setInt ( 13 , 4 ) ; } else { ps . setInt ( 13 , ( - 1 ) ) ; } ps . setString ( 14 , sb . specialneeds ) ; ps . setString ( 15 , sb . comments ) ; ps . setString ( 16 , sb . sex ) ; ps . setString ( 17 , sb . smoker ) ; if ( sb . guest ) { ps . setInt ( 18 , 1 ) ; } else { ps . setInt ( 18 , 0 ) ; } ps . executeUpdate ( ) ; ResultSet rs = ps . getGeneratedKeys ( ) ; if ( ( rs != null ) && ( rs . next ( ) ) ) { return rs . getInt ( 1 ) ; } } catch ( SQLException e ) { e . printStackTrace ( ) ; } finally { try { conn . close ( ) ; } catch ( SQLException e ) { System . err . println ( "Error<seq2seq4repair_space>closing<seq2seq4repair_space>connections" ) ; e . printStackTrace ( ) ; } } return - 1 ; } public int newStaff ( StaffBean sb ) { } public List < AvailableHousingBean > getAvailableResidence ( ) { } public List < AvailableHousingBean > getAvailableApartment ( ) { } public List < InvoiceBean > viewInvoices ( long snumber ) { } public long addInvoice ( InvoiceBean ib ) { } public List < InvoiceBean > getInvoice ( Long invoicenumber ) throws SQLException { } public ResultSet getLineItems ( long invoicenumber ) { } public void addLineItem ( long invoicenumber , int fee , String itemtype ) { } public ResultSet viewLeases ( long uid ) { } public List < Long > getNearbyLots ( long placenumber ) { } public List < ParkingSpaceBean > getAvailibleParking ( long housingLocation , boolean remoteAllowed ) { } public long getAvailableSpot ( long parkingnumber , String classification ) { } public List < Long > getAvailableParking ( ) { } public void AddHousingDetail ( ) { } public List < ApartmentBean > getAllAvailableApartments ( ) throws SQLException { } public void addAppartments ( long rent , long deposit , String apttype , int housingDetailsLocation , int aptnum , int family ) { } public float getParkingClassCosts ( String classification ) { } public void addParkingClassCosts ( String classification , float cost ) { } public List < String > getParkingLotsNear ( int nearLotNumber ) { } public void addParkingLotsNear ( Long lotNumber , Long near ) { } public List < Long > getParkingSpotsForStudent ( int snumber ) { } public List < ParkingSpotsBean > getAllParkingSpots ( ) throws SQLException { } public void addParkingSpot ( Long lotNumber , String classification , Long sNumber ) { } public List < StudentHallInspectionBean > getStudentHallInspection ( int inspectionID ) throws SQLException { } public void addStudentHallInspectionInformation ( Long staffNumber , Long leaseNumber , String inspectionDate , String propertyCondition , String comments ) { } public List < StaffBean > getStaffByStaffNumber ( long staffNumber ) throws SQLException { } public List < StaffBean > getAllStaff ( ) throws SQLException { } public List < MaintenanceTicketBean > getMaintenanceTicketsByLeaseNumber ( long leaseNumber ) throws SQLException { } public List < MaintenanceTicketBean > getAllMaintenanceTickets ( ) throws SQLException { } }

Fix:
String year = sb . year . toString ( ) ;