Buggy code:
public class SolrBruteForceSearch extends Search { private static final Logger logger = LoggerFactory . getLogger ( SolrBruteForceSearch . class . getName ( ) ) ; private LocationIndexService locationIndexService ; public void setLocationIndexService ( LocationIndexService locationIndexService ) { } @ Override public List < Location > search ( String search , Position position , SearchType type , Owner owner , boolean children ) { if ( SolrBruteForceSearch . logger . isDebugEnabled ( ) ) { StringBuilder builder = new StringBuilder ( "Exporter<seq2seq4repair_space>search<seq2seq4repair_space>-<seq2seq4repair_space>search<seq2seq4repair_space>string<seq2seq4repair_space>:<seq2seq4repair_space>\"" ) ; builder . append ( search ) . append ( "\",<seq2seq4repair_space>type<seq2seq4repair_space>:<seq2seq4repair_space>\"" ) . append ( type ) ; builder . append ( "\",<seq2seq4repair_space>owner<seq2seq4repair_space>:<seq2seq4repair_space>\"" ) . append ( owner . getCode ( ) ) ; <START_BUG> builder . append ( "\",<seq2seq4repair_space>position<seq2seq4repair_space>:<seq2seq4repair_space>" ) . append ( position . toString ( ) ) ; <END_BUG> builder . append ( "\",<seq2seq4repair_space>children<seq2seq4repair_space>:<seq2seq4repair_space>" ) . append ( children ) ; SolrBruteForceSearch . logger . debug ( builder . toString ( ) ) ; } List < Location > results ; if ( type == ( SearchType . ALL ) ) { results = ( ( List ) ( this . dbService . getAllLocations ( owner . getCode ( ) ) ) ) ; SolrBruteForceSearch . logger . debug ( "Found<seq2seq4repair_space>{}<seq2seq4repair_space>locations<seq2seq4repair_space>matching<seq2seq4repair_space>the<seq2seq4repair_space>conditions." , results . size ( ) ) ; return results ; } Pattern pattern = Pattern . compile ( "([\\\\*+\\[\\](){}\\$.?\\^|])" ) ; search = escapeRegex ( search , pattern ) ; SolrBruteForceSearch . logger . debug ( "Search<seq2seq4repair_space>string<seq2seq4repair_space>after<seq2seq4repair_space>escaping<seq2seq4repair_space>regex<seq2seq4repair_space>special<seq2seq4repair_space>characters:<seq2seq4repair_space>\"{}\"" , search ) ; List < LocationDocument > locations = ( ( List ) ( this . locationIndexService . getAllLocations ( owner . getCode ( ) ) ) ) ; List tempResults = new ArrayList < LocationDocument > ( ) ; SolrBruteForceSearch . logger . debug ( "Fetched<seq2seq4repair_space>{}<seq2seq4repair_space>LocationDocuments<seq2seq4repair_space>from<seq2seq4repair_space>Solr.<seq2seq4repair_space>Start<seq2seq4repair_space>searching." , locations . size ( ) ) ; if ( type == ( SearchType . CALLNO ) ) { tempResults = getResultsByCallNo ( locations , buildSearchStr ( search , position ) ) ; } else if ( type == ( SearchType . CODE ) ) { tempResults = getResultsByLocationCode ( locations , buildSearchStr ( search , position ) ) ; } else if ( type == ( SearchType . ID ) ) { tempResults = getResultsByLocationId ( locations , search ) ; } else if ( type == ( SearchType . DESC ) ) { tempResults = getResultsByDesc ( locations , buildSearchStr ( search , position ) ) ; } else if ( type == ( SearchType . NOTE ) ) { tempResults = getResultsByNote ( locations , buildSearchStr ( search , position ) ) ; } else if ( type == ( SearchType . SUBJECT ) ) { tempResults = getResultsBySubjectMatter ( locations , buildSearchStr ( search , position ) ) ; } else if ( type == ( SearchType . STAFFNOTE1 ) ) { tempResults = getResultsByStaffNotePri ( locations , buildSearchStr ( search , position ) ) ; } else if ( type == ( SearchType . STAFFNOTE2 ) ) { tempResults = getResultsByStaffNoteSec ( locations , buildSearchStr ( search , position ) ) ; } else if ( type == ( SearchType . FLOOR ) ) { tempResults = getResultsByFloor ( locations , buildSearchStr ( search , position ) ) ; } else if ( type == ( SearchType . SHELF ) ) { tempResults = getResultsByShelfNumber ( locations , buildSearchStr ( search , position ) ) ; } SolrBruteForceSearch . logger . debug ( "Search<seq2seq4repair_space>completed.<seq2seq4repair_space>Found<seq2seq4repair_space>{}<seq2seq4repair_space>LocationDocuments<seq2seq4repair_space>matching<seq2seq4repair_space>the<seq2seq4repair_space>conditions." , tempResults . size ( ) ) ; SolrBruteForceSearch . logger . debug ( "Fetch<seq2seq4repair_space>full<seq2seq4repair_space>Location<seq2seq4repair_space>objects<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>database." ) ; List < Integer > libraryIds = this . getIds ( tempResults , LIBRARY ) ; List < Integer > collectionIds = this . getIds ( tempResults , COLLECTION ) ; List < Integer > schelfIds = this . getIds ( tempResults , SHELF ) ; results = this . dbService . getLocations ( libraryIds , collectionIds , schelfIds , children ) ; SolrBruteForceSearch . logger . debug ( "Fetched<seq2seq4repair_space>{}<seq2seq4repair_space>full<seq2seq4repair_space>Location<seq2seq4repair_space>objects<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>database." , results . size ( ) ) ; return results ; } private List getResultsByCallNo ( List < LocationDocument > locations , String searchStr ) { } private List getResultsByLocationCode ( List < LocationDocument > locations , String searchStr ) { } private List getResultsByDesc ( List < LocationDocument > locations , String searchStr ) { } private List getResultsByNote ( List < LocationDocument > locations , String searchStr ) { } private List getResultsBySubjectMatter ( List < LocationDocument > locations , String searchStr ) { } private List getResultsByStaffNotePri ( List < LocationDocument > locations , String searchStr ) { } private List getResultsByStaffNoteSec ( List < LocationDocument > locations , String searchStr ) { } private List getResultsByLocationId ( List < LocationDocument > locations , String searchStr ) { } private List getResultsByFloor ( List < LocationDocument > locations , String searchStr ) { } private List getResultsByShelfNumber ( List < LocationDocument > locations , String searchStr ) { } private List < Integer > getIds ( List < LocationDocument > documents , LocationType type ) { } }

Fix:
builder . append ( "\",<seq2seq4repair_space>position<seq2seq4repair_space>:<seq2seq4repair_space>\"" ) . append ( position . toString ( ) ) ;