Buggy code:
public class WekaModelJdbcRepository implements CrudRepository < RegressionModel , Long > { private static final Logger log = LoggerFactory . getLogger ( WekaModelJdbcRepository . class ) ; @ Autowired private JdbcTemplate jdbcTemplate ; static final String CREATE_TABLE = "create<seq2seq4repair_space>table<seq2seq4repair_space>if<seq2seq4repair_space>not<seq2seq4repair_space>exists<seq2seq4repair_space>RD_MODEL_SNAPSHOT<seq2seq4repair_space>(" + ( ( ( "CREATED_TS<seq2seq4repair_space>TIMESTAMP," + "MODEL<seq2seq4repair_space>MEDIUMTEXT," ) + "GEN_ID<seq2seq4repair_space>BIGINT(20)<seq2seq4repair_space>PRIMARY<seq2seq4repair_space>KEY" ) + ")" ) ; static final String INSERT_MODEL = "insert<seq2seq4repair_space>into<seq2seq4repair_space>RD_MODEL_SNAPSHOT<seq2seq4repair_space>(CREATED_TS,MODEL,GEN_ID)<seq2seq4repair_space>values<seq2seq4repair_space>(now(),?,?)<seq2seq4repair_space>" ; static final String EXISTS_MODEL = "select<seq2seq4repair_space>count(*)<seq2seq4repair_space>from<seq2seq4repair_space>RD_MODEL_SNAPSHOT<seq2seq4repair_space>where<seq2seq4repair_space>GEN_ID<seq2seq4repair_space>=<seq2seq4repair_space>" ; static final String COUNT_MODELS = "select<seq2seq4repair_space>count(*)<seq2seq4repair_space>from<seq2seq4repair_space>RD_MODEL_SNAPSHOT<seq2seq4repair_space>" ; static final String DELETE_MODEL = "delete<seq2seq4repair_space>from<seq2seq4repair_space>RD_MODEL_SNAPSHOT<seq2seq4repair_space>where<seq2seq4repair_space>GEN_ID<seq2seq4repair_space>=<seq2seq4repair_space>" ; static final String SELECT_MODEL = "select<seq2seq4repair_space>MODEL,<seq2seq4repair_space>GEN_ID,<seq2seq4repair_space>CREATED_TS<seq2seq4repair_space>from<seq2seq4repair_space>RD_MODEL_SNAPSHOT<seq2seq4repair_space>where<seq2seq4repair_space>GEN_ID<seq2seq4repair_space>=<seq2seq4repair_space>" ; @ PostConstruct void init ( ) { } @ Override public < S extends RegressionModel > S save ( S entity ) { } @ Override public < S extends RegressionModel > Iterable < S > save ( Iterable < S > entities ) { } @ Override public RegressionModel findOne ( Long id ) { final List < RegressionModel > models = new ArrayList < > ( ) ; jdbcTemplate . query ( ( ( WekaModelJdbcRepository . SELECT_MODEL ) + id ) , new RowCallbackHandler ( ) { @ Override public void processRow ( ResultSet rs ) throws SQLException { RegressionModel m = new RegressionModel ( ) ; try { m . deserializeClassifierFromJson ( rs . getString ( 1 ) ) ; m . setLongId ( rs . getLong ( 2 ) ) ; m . setGeneratedOn ( rs . getDate ( 3 ) ) ; models . add ( m ) ; } catch ( IOException e ) { throw new SQLException ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>deserialze<seq2seq4repair_space>model<seq2seq4repair_space>from<seq2seq4repair_space>string" , e ) ; } } } ) ; <START_BUG> return models . get ( 0 ) ; <END_BUG> } @ Override public boolean exists ( Long id ) { } @ Override public Iterable < RegressionModel > findAll ( ) { } @ Override public Iterable < RegressionModel > findAll ( Iterable < Long > ids ) { } @ Override public long count ( ) { } @ Override public void delete ( Long id ) { } @ Override public void delete ( RegressionModel entity ) { } @ Override public void delete ( Iterable < ? extends RegressionModel > entities ) { } @ Override public void deleteAll ( ) { } }

Fix:
return models . isEmpty ( ) ? null : models . get ( 0 ) ;