Buggy code:
@ Singleton public class DomainDao { private static final String DOMAIN_FIELDS = "domain_name,<seq2seq4repair_space>domain_id,<seq2seq4repair_space>domain_uuid,<seq2seq4repair_space>domain_label,<seq2seq4repair_space>domain_alias,<seq2seq4repair_space>domain_global" ; private static final Logger logger = LoggerFactory . getLogger ( DomainDao . class ) ; private final DatabaseConnectionProvider dbcp ; @ Inject private DomainDao ( DatabaseConnectionProvider dbcp ) { } public ObmDomain findDomainByName ( String domainName ) { } public ObmDomain findDomainByUuid ( ObmDomainUuid uuid ) throws DaoException , DomainNotFoundException { } public ObmDomain create ( ObmDomain domain ) { } public List < ObmDomain > list ( ) throws DaoException { } private Iterable < String > aliasToIterable ( String aliases ) { } private ObmDomain domainFromCursor ( ResultSet rs ) throws SQLException { } private Builder fetchDomainHosts ( Integer domainId , ObmDomain . Builder domainBuilder ) throws SQLException { Connection con = null ; PreparedStatement ps = null ; ResultSet rs = null ; try { con = dbcp . getConnection ( ) ; <START_BUG> ps = con . prepareStatement ( ( "SELECT<seq2seq4repair_space>serviceproperty_service,<seq2seq4repair_space>serviceproperty_property,<seq2seq4repair_space>host_id,<seq2seq4repair_space>host_name,<seq2seq4repair_space>host_ip,<seq2seq4repair_space>host_fqdn,<seq2seq4repair_space>host_domain_id<seq2seq4repair_space>" + ( ( ( ( ( "FROM<seq2seq4repair_space>Domain<seq2seq4repair_space>" + "INNER<seq2seq4repair_space>JOIN<seq2seq4repair_space>DomainEntity<seq2seq4repair_space>ON<seq2seq4repair_space>domainentity_domain_id<seq2seq4repair_space>=<seq2seq4repair_space>domain_id<seq2seq4repair_space>" ) + "LEFT<seq2seq4repair_space>JOIN<seq2seq4repair_space>ServiceProperty<seq2seq4repair_space>ON<seq2seq4repair_space>serviceproperty_entity_id<seq2seq4repair_space>=<seq2seq4repair_space>domainentity_entity_id<seq2seq4repair_space>" ) + "LEFT<seq2seq4repair_space>JOIN<seq2seq4repair_space>Host<seq2seq4repair_space>ON<seq2seq4repair_space>CAST(host_id<seq2seq4repair_space>AS<seq2seq4repair_space>CHAR)<seq2seq4repair_space>=<seq2seq4repair_space>serviceproperty_value<seq2seq4repair_space>" ) + "WHERE<seq2seq4repair_space>domain_id<seq2seq4repair_space>=<seq2seq4repair_space>?<seq2seq4repair_space>AND<seq2seq4repair_space>host_id<seq2seq4repair_space>IS<seq2seq4repair_space>NOT<seq2seq4repair_space>NULL<seq2seq4repair_space>" ) + "GROUP<seq2seq4repair_space>BY<seq2seq4repair_space>serviceproperty_service,<seq2seq4repair_space>serviceproperty_property,<seq2seq4repair_space>host_id,<seq2seq4repair_space>host_name,<seq2seq4repair_space>host_ip,<seq2seq4repair_space>host_fqdn,<seq2seq4repair_space>host_domain_id" ) ) ) ; <END_BUG> ps . setInt ( 1 , domainId ) ; rs = ps . executeQuery ( ) ; while ( rs . next ( ) ) { ServiceProperty serviceProperty = ServiceProperty . builder ( ) . service ( rs . getString ( "serviceproperty_service" ) ) . property ( rs . getString ( "serviceproperty_property" ) ) . build ( ) ; ObmHost host = ObmHost . builder ( ) . id ( rs . getInt ( "host_id" ) ) . name ( rs . getString ( "host_name" ) ) . ip ( rs . getString ( "host_ip" ) ) . domainId ( rs . getInt ( "host_domain_id" ) ) . fqdn ( rs . getString ( "host_fqdn" ) ) . build ( ) ; domainBuilder . host ( serviceProperty , host ) ; } } finally { DBUtils . cleanup ( con , ps , rs ) ; } return domainBuilder ; } }

Fix:
ps = con . prepareStatement ( ( "SELECT<seq2seq4repair_space>serviceproperty_service,<seq2seq4repair_space>serviceproperty_property,<seq2seq4repair_space>host_id,<seq2seq4repair_space>host_name,<seq2seq4repair_space>host_ip,<seq2seq4repair_space>host_fqdn,<seq2seq4repair_space>host_domain_id<seq2seq4repair_space>" + ( ( ( ( ( "FROM<seq2seq4repair_space>Domain<seq2seq4repair_space>" + "INNER<seq2seq4repair_space>JOIN<seq2seq4repair_space>DomainEntity<seq2seq4repair_space>ON<seq2seq4repair_space>domainentity_domain_id<seq2seq4repair_space>=<seq2seq4repair_space>domain_id<seq2seq4repair_space>" ) + "LEFT<seq2seq4repair_space>JOIN<seq2seq4repair_space>ServiceProperty<seq2seq4repair_space>ON<seq2seq4repair_space>serviceproperty_entity_id<seq2seq4repair_space>=<seq2seq4repair_space>domainentity_entity_id<seq2seq4repair_space>" ) + "LEFT<seq2seq4repair_space>JOIN<seq2seq4repair_space>Host<seq2seq4repair_space>ON<seq2seq4repair_space>CAST(host_id<seq2seq4repair_space>AS<seq2seq4repair_space>CHAR(9))<seq2seq4repair_space>=<seq2seq4repair_space>serviceproperty_value<seq2seq4repair_space>" ) + "WHERE<seq2seq4repair_space>domain_id<seq2seq4repair_space>=<seq2seq4repair_space>?<seq2seq4repair_space>AND<seq2seq4repair_space>host_id<seq2seq4repair_space>IS<seq2seq4repair_space>NOT<seq2seq4repair_space>NULL<seq2seq4repair_space>" ) + "GROUP<seq2seq4repair_space>BY<seq2seq4repair_space>serviceproperty_service,<seq2seq4repair_space>serviceproperty_property,<seq2seq4repair_space>host_id,<seq2seq4repair_space>host_name,<seq2seq4repair_space>host_ip,<seq2seq4repair_space>host_fqdn,<seq2seq4repair_space>host_domain_id" ) ) ) ;