Buggy code:
public class BillableImpl implements BillableDao { private SessionFactory sessionFactory ; private Transaction transaction ; private static final String BillQuery = "from<seq2seq4repair_space>Billable<seq2seq4repair_space>B<seq2seq4repair_space>where<seq2seq4repair_space>B.master.referenceNo<seq2seq4repair_space>=:refno<seq2seq4repair_space>and<seq2seq4repair_space>B.master.MBookingstatus.id<seq2seq4repair_space>!=<seq2seq4repair_space>3" ; private static final String QUERY_AIRTICKET = "from<seq2seq4repair_space>AirticketAirline<seq2seq4repair_space>AA<seq2seq4repair_space>where<seq2seq4repair_space>AA.id<seq2seq4repair_space>in<seq2seq4repair_space>" ; private static final String QUERY_OTHERS = "from<seq2seq4repair_space>OtherBooking<seq2seq4repair_space>ot<seq2seq4repair_space>where<seq2seq4repair_space>ot.id<seq2seq4repair_space>=<seq2seq4repair_space>:refitemid" ; private static final String QUERY_LAND = "from<seq2seq4repair_space>LandBooking<seq2seq4repair_space>lb<seq2seq4repair_space>where<seq2seq4repair_space>lb.id<seq2seq4repair_space>=<seq2seq4repair_space>:refitemid" ; private static final String QUERY_HOTEL = "from<seq2seq4repair_space>HotelBooking<seq2seq4repair_space>hb<seq2seq4repair_space>where<seq2seq4repair_space>hb.id<seq2seq4repair_space>=<seq2seq4repair_space>:refitemid" ; private static final String QUERY_DAYTOUR = "from<seq2seq4repair_space>DaytourBooking<seq2seq4repair_space>db<seq2seq4repair_space>where<seq2seq4repair_space>db.id<seq2seq4repair_space>=<seq2seq4repair_space>:refitemid" ; private static final String SEARCH_MBILL_NAME = "from<seq2seq4repair_space>MBilltype<seq2seq4repair_space>mb<seq2seq4repair_space>where<seq2seq4repair_space>mb.id<seq2seq4repair_space>=:typeId<seq2seq4repair_space>" ; private static final String OtherBookingUpdate = "UPDATE<seq2seq4repair_space>OtherBooking<seq2seq4repair_space>other<seq2seq4repair_space>set<seq2seq4repair_space>other.isBill<seq2seq4repair_space>=<seq2seq4repair_space>1<seq2seq4repair_space>" + "WHERE<seq2seq4repair_space>other.id<seq2seq4repair_space>=<seq2seq4repair_space>:Keyid" ; private static final String LandBookingUpdate = "UPDATE<seq2seq4repair_space>LandBooking<seq2seq4repair_space>land<seq2seq4repair_space>set<seq2seq4repair_space>land.isBill<seq2seq4repair_space>=<seq2seq4repair_space>1<seq2seq4repair_space>" + "WHERE<seq2seq4repair_space>land.id<seq2seq4repair_space>=<seq2seq4repair_space>:Keyid" ; private static final String AirBookingUpdate = "UPDATE<seq2seq4repair_space>AirticketFlight<seq2seq4repair_space>air<seq2seq4repair_space>set<seq2seq4repair_space>air.isBill<seq2seq4repair_space>=<seq2seq4repair_space>1<seq2seq4repair_space>" + "WHERE<seq2seq4repair_space>air.airticketAirline.id<seq2seq4repair_space>in<seq2seq4repair_space>" ; private static final String SelectAirLineId = "FROM<seq2seq4repair_space>AirticketFlight<seq2seq4repair_space>F<seq2seq4repair_space>where<seq2seq4repair_space>F.airticketAirline.airticketPnr.airticketBooking.master.id<seq2seq4repair_space>=<seq2seq4repair_space>:Keyid<seq2seq4repair_space>and<seq2seq4repair_space>F.isBill<seq2seq4repair_space>=<seq2seq4repair_space>0" ; private static final String HotelBookingUpdate = "UPDATE<seq2seq4repair_space>HotelBooking<seq2seq4repair_space>hotel<seq2seq4repair_space>set<seq2seq4repair_space>hotel.isBill<seq2seq4repair_space>=<seq2seq4repair_space>1<seq2seq4repair_space>" + "WHERE<seq2seq4repair_space>hotel.id<seq2seq4repair_space>=<seq2seq4repair_space>:Keyid" ; private static final String AirBookingDescUpdate = "UPDATE<seq2seq4repair_space>AirticketDesc<seq2seq4repair_space>AD<seq2seq4repair_space>set<seq2seq4repair_space>AD.isBill<seq2seq4repair_space>=<seq2seq4repair_space>1<seq2seq4repair_space>" + "WHERE<seq2seq4repair_space>AD.id<seq2seq4repair_space>=<seq2seq4repair_space>:Keyid<seq2seq4repair_space>" ; private static final String SelectAirBookId = "FROM<seq2seq4repair_space>AirticketBooking<seq2seq4repair_space>AB<seq2seq4repair_space>where<seq2seq4repair_space>AB.master.id<seq2seq4repair_space>=<seq2seq4repair_space>:masterid<seq2seq4repair_space>)" ; private static final String DaytourBookingUpdate = "UPDATE<seq2seq4repair_space>DaytourBooking<seq2seq4repair_space>DB<seq2seq4repair_space>set<seq2seq4repair_space>DB.isBill<seq2seq4repair_space>=<seq2seq4repair_space>1<seq2seq4repair_space>" + "WHERE<seq2seq4repair_space>DB.id<seq2seq4repair_space>=<seq2seq4repair_space>:Keyid" ; private static final String QUERY_AIRADDITIONAL = "from<seq2seq4repair_space>AirticketDesc<seq2seq4repair_space>aird<seq2seq4repair_space>where<seq2seq4repair_space>aird.id<seq2seq4repair_space>=<seq2seq4repair_space>:refitemid" ; UtilityFunction utility = new UtilityFunction ( ) ; @ Override public Billable getBillableBooking ( String refno ) { } @ Override public Billable getBillableBookingForTaxInvoice ( String refNo ) { } @ Override public Invoice getInvoiceForTaxInvoice ( Billable bill ) { } @ Override public int updateBillStatusBooking ( String refno , Billable bill ) { } @ Override public int insertBillableBooking ( Billable bill ) { } public boolean IsLapAirline ( String data , String airlineid ) { } public void updateBillDesc ( Session session , BillableDesc bill ) { } public SessionFactory getSessionFactory ( ) { } public void setSessionFactory ( SessionFactory sessionFactory ) { } @ Override public int updateBillableBooking ( Billable bill ) { } @ Override public String getMBillTypeName ( String typeId ) { } @ Override public String getDescriptionInvoiceAirTicket ( String refno , int format ) { } @ Override public String getDescriptionInvoiceOthers ( String refno , int format ) { } @ Override public String getDescriptionInvoiceLand ( String refno , int format ) { } @ Override public String getDescriptionInvoiceHotel ( String refno , int format ) { } @ Override public String getDescriptionInvoiceDayTour ( String refno , int format ) { } private String changeMonth ( String monthInt ) { } private int getDifferenceDays ( Date d1 , Date d2 ) { } @ Override public String getDescriptionInvoiceAirAdditional ( String refno , int format ) { } @ Override public String getDescriptionInvoiceOthersFromRefId ( String refId ) { } @ Override public String getDescriptionInvoiceDayTourFromRefId ( String refId ) { } @ Override public String printTicketOrder ( String refNo ) { } @ Override public String DeleteBillableDesc ( String billdescId ) { } @ Override public BillableDesc getBillableDescFromBillDescId ( String billDescId ) { } @ Override public String searchBillableType ( Master master ) { String type = "" ; boolean check = true ; Session session = this . sessionFactory . openSession ( ) ; try { <START_BUG> if ( master . getAgent ( ) . getCode ( ) . equalsIgnoreCase ( "WLK" ) ) { <END_BUG> type = "A" ; check = false ; } List < Customer > customerList = session . createQuery ( "from<seq2seq4repair_space>Customer<seq2seq4repair_space>c<seq2seq4repair_space>where<seq2seq4repair_space>c.code<seq2seq4repair_space>=<seq2seq4repair_space>:code<seq2seq4repair_space>and<seq2seq4repair_space>c.lastName<seq2seq4repair_space>=<seq2seq4repair_space>:lastName<seq2seq4repair_space>" ) . setParameter ( "code" , master . getCustomer ( ) . getCode ( ) ) . setParameter ( "lastName" , master . getCustomer ( ) . getLastName ( ) ) . list ( ) ; if ( ( ! ( customerList . isEmpty ( ) ) ) && check ) { type = "C" ; check = false ; } if ( check ) { type = "S" ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { session . close ( ) ; } return type ; } }

Fix:
if ( ! ( master . getAgent ( ) . getCode ( ) . equalsIgnoreCase ( "WLK" ) ) ) {