Buggy code:
private TextField tFEmp ; private TextField tFUN ; private TextField tFMSISDN ; private TextField tFBAcc ; private TextField tFAccEmail ; private TextField tFClrNo ; private TextField tFSecAns ; private TextField tFPMNo ; private TextField tFPANo ; private TextField tFPEmail ; private TextField tFPostalCode ; private TextField tFStreet ; private TextField tFCity ; private TextField tFProv ; private TextField tFSMNo ; private TextField tFSANo ; private TextField tFSEmail ; private TextField tFIssuer ; private TextField tFIDNo ; private CheckBox chcTAndC ; private ComboBox comboPref ; private ComboBox comboSuff ; private ComboBox comboState ; private ComboBox comboLG ; private ComboBox comboCountry ; private ComboBox comboLang ; private ComboBox comboBDomain ; private ComboBox comboBID ; private ComboBox comboCur ; private ComboBox comboSecQn ; private ComboBox comboProfile ; private ComboBox comboIDType ; private PopupDateField dFDoB ; private PopupDateField dFDoI ; private PopupDateField dFDoE ; private OptionGroup optSex ; private boolean isValidatorAdded = false ; private boolean isCSelected = false ; private Calendar cal = null ; private List < Object > arrLAllFormFields ; private List < Object > arrLAllEditableFields ; private ArrayList < String > arrLTfEditableVals ; private boolean boolEditStatus = false ; private HorizontalLayout cBtnEditCancel ; private UserDetailsBackEnd bee ; private Map < String , String > hm ; private Window cpop ; private String curUser = null ; private HorizontalLayout cPlaceholder = new HorizontalLayout ( ) ; private IndexedContainer container = new IndexedContainer ( ) ; private Button btnLink ; private Table tb ; private IndexedContainer xcontainer ; private Object xrid ; private TextField tFU ; public UserDetailsModule ( ) { } private HorizontalLayout setDetailsForm ( String strUID , String strAction ) { } private void resetForm ( List < Object > lAllEditableFields , ArrayList < String > arrLEV ) { } private void enableEditableFormFields ( List < Object > arrLAllEditableFields ) { } public VerticalLayout getUserDetailsContainer ( String strUID , String strAction , Window pop , Object xrid , IndexedContainer xcontainer ) { } private VerticalLayout getManageUserMenu ( ) { } private HorizontalLayout getAddUserSubMenu ( final BtnTabLike btnAddUser , final BtnTabLike btnPersonal , final BtnTabLike btnAccount , final BtnTabLike btnLinks ) { } private HorizontalLayout getAccLog ( ) { } private HorizontalLayout getActLog ( ) { } private void setData ( String strUID , String strAction ) { } private VerticalLayout getUDContainer ( String strUID ) { } private HorizontalLayout getADC ( ) { } private VerticalLayout getEUDContainer ( ) { } private HashMap < Integer , String > getCountries ( ) { } private void addValidators ( ) { } private void validate ( ) { } private class NoNull implements Validator { private static final long serialVersionUID = - 5634103226093178664L ; @ Override public void validate ( Object value ) throws InvalidValueException { } } private HashMap < Integer , String > getLGs ( int sid ) { } private HashMap < Integer , String > getStates ( int cid ) { } private void addDatum ( String cap , String val , Object container ) { } private void validateAndSave ( ) { } private void errorHandler ( Exception e ) { } private HorizontalLayout getLC ( ) { } @ SuppressWarnings ( "unchecked" ) private IndexedContainer getLinksTable ( ) { container . addContainerProperty ( "S//N" , Integer . class , 0 ) ; container . addContainerProperty ( "Username" , String . class , null ) ; container . addContainerProperty ( "MSISDN" , String . class , null ) ; container . addContainerProperty ( "Email" , String . class , null ) ; container . addContainerProperty ( "Action" , Button . class , null ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "<seq2seq4repair_space>SELECT<seq2seq4repair_space>concat(ahd.firstname,'<seq2seq4repair_space>',ahd.lastname)<seq2seq4repair_space>as<seq2seq4repair_space>Name,<seq2seq4repair_space>ah.username<seq2seq4repair_space>as<seq2seq4repair_space>'username',<seq2seq4repair_space>ah.msisdn<seq2seq4repair_space>as<seq2seq4repair_space>msisdn,<seq2seq4repair_space>ah.email<seq2seq4repair_space>as<seq2seq4repair_space>email<seq2seq4repair_space>" ) ; sb . append ( "<seq2seq4repair_space>FROM<seq2seq4repair_space>psadatasourcetest.linkaccountrelations<seq2seq4repair_space>pl,<seq2seq4repair_space>accountholders<seq2seq4repair_space>ah,<seq2seq4repair_space>accountholderdetails<seq2seq4repair_space>ahd<seq2seq4repair_space>" ) ; sb . append ( "<seq2seq4repair_space>where<seq2seq4repair_space>linkstatus<seq2seq4repair_space>=<seq2seq4repair_space>'LINKED'<seq2seq4repair_space>" ) ; sb . append ( "<seq2seq4repair_space>and<seq2seq4repair_space>ah.accountholderdetailid<seq2seq4repair_space>=<seq2seq4repair_space>ahd.accountdetailsid<seq2seq4repair_space>" ) ; sb . append ( "<seq2seq4repair_space>and<seq2seq4repair_space>pl.childuserresourceid<seq2seq4repair_space>=<seq2seq4repair_space>ah.accountholderid<seq2seq4repair_space>" ) ; sb . append ( "<seq2seq4repair_space>and<seq2seq4repair_space>parentuserresourceid<seq2seq4repair_space>in<seq2seq4repair_space>(select<seq2seq4repair_space>accountholderid<seq2seq4repair_space>from<seq2seq4repair_space>accountholders<seq2seq4repair_space>" ) ; <START_BUG> sb . append ( "<seq2seq4repair_space>where<seq2seq4repair_space>(username<seq2seq4repair_space>=<seq2seq4repair_space>'166735'))" ) ; <END_BUG> String drivers = "com.mysql.jdbc.Driver" ; try { Class < ? > driver_class = Class . forName ( drivers ) ; Driver driver = ( ( Driver ) ( driver_class . newInstance ( ) ) ) ; DriverManager . registerDriver ( driver ) ; Connection conn = DriverManager . getConnection ( DB , UN , PW ) ; Statement stmt = conn . createStatement ( ) ; ResultSet rs = stmt . executeQuery ( sb . toString ( ) ) ; int x = 0 ; Property < String > pUn ; Property < String > pMsisdn ; Property < String > pEmail ; Property < Integer > pSn ; Property < Button > pBtn ; String un ; String msisdn ; String email ; Object rid ; Button btnLink ; Item r ; while ( rs . next ( ) ) { x ++ ; un = rs . getString ( "username" ) ; msisdn = rs . getString ( "msisdn" ) ; email = rs . getString ( "email" ) ; rid = container . addItem ( ) ; r = container . getItem ( rid ) ; pSn = r . getItemProperty ( "S//N" ) ; pUn = r . getItemProperty ( "Username" ) ; pMsisdn = r . getItemProperty ( "MSISDN" ) ; pEmail = r . getItemProperty ( "Email" ) ; pBtn = r . getItemProperty ( "Action" ) ; btnLink = new Button ( ) ; btnLink . setIcon ( UNLINK ) ; btnLink . setStyleName ( "btn_link" ) ; btnLink . setDescription ( "Unlink<seq2seq4repair_space>this<seq2seq4repair_space>account." ) ; btnLink . addClickListener ( new UserDetailsModule . UNLinkClickHandler ( ) ) ; btnLink . setId ( un ) ; btnLink . setData ( rid ) ; pSn . setValue ( x ) ; pUn . setValue ( un ) ; pMsisdn . setValue ( msisdn ) ; pEmail . setValue ( email ) ; pBtn . setValue ( btnLink ) ; } } catch ( SQLException | ClassNotFoundException | InstantiationException | IllegalAccessException e ) { errorHandler ( e ) ; }

Fix:
sb . append ( ( ( "<seq2seq4repair_space>where<seq2seq4repair_space>(username<seq2seq4repair_space>=<seq2seq4repair_space>'" + ( curUser ) ) + "'))" ) ) ;