Buggy code:
@ Repository public class DomainSearchByNsNameStrategy extends AbstractDomainSearchStrategy { protected static final Logger LOGGER = LoggerFactory . getLogger ( DomainSearchByNsNameStrategy . class ) ; @ Override public boolean support ( QueryParam queryParam ) { } @ Override public Long searchCount ( QueryParam queryParam , JdbcTemplate jdbcTemplate ) { } @ Override public List < Domain > search ( QueryParam queryParam , JdbcTemplate jdbcTemplate ) { DomainSearchParam domainQueryParam = ( ( DomainSearchParam ) ( queryParam ) ) ; final String punyName = domainQueryParam . getPunyName ( ) ; final String punyNameLikeClause = generateLikeClause ( punyName ) ; <START_BUG> final String sql = "select<seq2seq4repair_space>distinct<seq2seq4repair_space>domain.*,status.*<seq2seq4repair_space>from<seq2seq4repair_space>RDAP_DOMAIN<seq2seq4repair_space>domain<seq2seq4repair_space>inner<seq2seq4repair_space>join<seq2seq4repair_space>" + ( ( ( ( "<seq2seq4repair_space>REL_DOMAIN_NAMESERVER<seq2seq4repair_space>rel<seq2seq4repair_space>on<seq2seq4repair_space>domain.DOMAIN_ID<seq2seq4repair_space>=<seq2seq4repair_space>rel.DOMAIN_ID<seq2seq4repair_space>" + "<seq2seq4repair_space>inner<seq2seq4repair_space>join<seq2seq4repair_space>RDAP_NAMESERVER<seq2seq4repair_space>ns<seq2seq4repair_space>" ) + "<seq2seq4repair_space>on<seq2seq4repair_space>rel.NAMESERVER_ID<seq2seq4repair_space>=<seq2seq4repair_space>ns.NAMESERVER_ID<seq2seq4repair_space>" ) + "<seq2seq4repair_space>where<seq2seq4repair_space>ns.LDH_NAME<seq2seq4repair_space>LIKE<seq2seq4repair_space>?<seq2seq4repair_space>" ) + "<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>domain.LDH_NAME<seq2seq4repair_space>limit<seq2seq4repair_space>?,?<seq2seq4repair_space>" ) ; <END_BUG> final PageBean page = queryParam . getPageBean ( ) ; int startPage = ( page . getCurrentPage ( ) ) - 1 ; startPage = ( startPage >= 0 ) ? startPage : 0 ; final long startRow = startPage * ( page . getMaxRecords ( ) ) ; DomainQueryDaoImpl domainDao = new DomainQueryDaoImpl ( ) ; List < Domain > result = jdbcTemplate . query ( new PreparedStatementCreator ( ) { @ Override public PreparedStatement createPreparedStatement ( Connection connection ) throws SQLException { PreparedStatement ps = connection . prepareStatement ( sql ) ; ps . setString ( 1 , punyNameLikeClause ) ; ps . setLong ( 2 , startRow ) ; ps . setLong ( 3 , page . getMaxRecords ( ) ) ; return ps ; } } , domainDao . new DomainWithStatusResultSetExtractor ( ) ) ; for ( Domain domain : result ) { domainDao . queryDomainStatus ( domain , jdbcTemplate ) ; } return result ; } }

Fix:
final String sql = "select<seq2seq4repair_space>distinct<seq2seq4repair_space>domain.*<seq2seq4repair_space>from<seq2seq4repair_space>RDAP_DOMAIN<seq2seq4repair_space>domain<seq2seq4repair_space>inner<seq2seq4repair_space>join<seq2seq4repair_space>" + ( ( ( ( "<seq2seq4repair_space>REL_DOMAIN_NAMESERVER<seq2seq4repair_space>rel<seq2seq4repair_space>on<seq2seq4repair_space>domain.DOMAIN_ID<seq2seq4repair_space>=<seq2seq4repair_space>rel.DOMAIN_ID<seq2seq4repair_space>" + "<seq2seq4repair_space>inner<seq2seq4repair_space>join<seq2seq4repair_space>RDAP_NAMESERVER<seq2seq4repair_space>ns<seq2seq4repair_space>" ) + "<seq2seq4repair_space>on<seq2seq4repair_space>rel.NAMESERVER_ID<seq2seq4repair_space>=<seq2seq4repair_space>ns.NAMESERVER_ID<seq2seq4repair_space>" ) + "<seq2seq4repair_space>where<seq2seq4repair_space>ns.LDH_NAME<seq2seq4repair_space>LIKE<seq2seq4repair_space>?<seq2seq4repair_space>" ) + "<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>domain.LDH_NAME<seq2seq4repair_space>limit<seq2seq4repair_space>?,?<seq2seq4repair_space>" ) ;