Buggy code:
public class ClusterWriter implements IClusterWriteDao { private static final Logger logger = LoggerFactory . getLogger ( ClusterWriter . class ) ; public static final int MAX_INCREMENT = 1000 ; private final JdbcTemplate template ; private final DataFieldMaxValueIncrementer spectrumPrimaryKeyIncrementer ; private final DataFieldMaxValueIncrementer psmPrimaryKeyIncrementer ; public ClusterWriter ( DataSource dataSource ) { } @ Override public void saveClusters ( final List < ClusterDetail > clusters ) { } @ Override public void saveCluster ( final ClusterDetail cluster ) { } private void updateMaxRatio ( final ClusterSummary cluster , final float maxRatio ) { } private float getMaxRatio ( List < ClusteredPSMDetail > clusteredPSMSummaries ) { } private void saveClusterSummary ( final ClusterDetail cluster ) { } private void updateSpectrumIdForClusteredSpectra ( final ClusterDetail cluster ) { } private void validateClusterMappings ( final ClusterDetail cluster ) { } private List < String > concatenateSpectrumIdForQuery ( final List < ClusteredSpectrumDetail > clusteredSpectra , int limit ) { } private void saveClusteredSpectra ( final List < ClusteredSpectrumDetail > clusteredSpectra ) { } private void saveClusteredPSMs ( final List < ClusteredPSMDetail > clusteredPSMSummaries ) { } @ Override public void saveAssay ( final AssayDetail assay ) { } @ Override public void deleteAssayByProjectAccession ( final String projectAccession ) { } @ Override public void saveSpectra ( final List < SpectrumDetail > spectra ) { } private void saveBatchOfSpectra ( final List < SpectrumDetail > spectra ) { } private void saveSpectraWithPrimaryKey ( final List < SpectrumDetail > spectra ) { } @ Override public void saveSpectrum ( final SpectrumDetail spectrum ) { } @ Override public void savePSMs ( final List < PSMDetail > psms ) { } private void saveBatchOfPSMs ( final List < PSMDetail > psms ) { } private void savePSMsWithPrimaryKey ( final List < PSMDetail > psms ) { <START_BUG> String INSERT_QUERY = "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>psm<seq2seq4repair_space>(psm_pk,<seq2seq4repair_space>spectrum_fk,<seq2seq4repair_space>assay_fk,<seq2seq4repair_space>archive_psm_id,<seq2seq4repair_space>sequence,<seq2seq4repair_space>modifications,<seq2seq4repair_space>modifications_standardised,<seq2seq4repair_space>search_engine,<seq2seq4repair_space>" + ( ( "search_engine_scores,<seq2seq4repair_space>search_database,<seq2seq4repair_space>protein_accession,<seq2seq4repair_space>protein_group,<seq2seq4repair_space>protein_name,<seq2seq4repair_space>start_position,<seq2seq4repair_space>" + "stop_position,<seq2seq4repair_space>pre_amino_acid,<seq2seq4repair_space>post_amino_acid,<seq2seq4repair_space>delta_mz,<seq2seq4repair_space>quantification_label)<seq2seq4repair_space>VALUES<seq2seq4repair_space>" ) + "(?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?)" ) ; <END_BUG> template . batchUpdate ( INSERT_QUERY , new BatchPreparedStatementSetter ( ) { @ Override public void setValues ( PreparedStatement ps , int i ) throws SQLException { PSMDetail psm = psms . get ( i ) ; ps . setLong ( 1 , psm . getId ( ) ) ; ps . setLong ( 2 , psm . getSpectrumId ( ) ) ; ps . setLong ( 3 , psm . getAssayId ( ) ) ; ps . setString ( 4 , psm . getArchivePSMId ( ) ) ; ps . setString ( 5 , psm . getSequence ( ) ) ; ps . setString ( 6 , psm . getModifications ( ) ) ; ps . setString ( 7 , psm . getStandardisedModifications ( ) ) ; ps . setString ( 8 , psm . getSearchEngine ( ) ) ; ps . setString ( 9 , psm . getSearchEngineScores ( ) ) ; ps . setString ( 10 , psm . getSearchDatabase ( ) ) ; ps . setString ( 11 , psm . getProteinAccession ( ) ) ; ps . setString ( 12 , psm . getProteinGroup ( ) ) ; ps . setString ( 13 , psm . getProteinName ( ) ) ; ps . setInt ( 14 , psm . getStartPosition ( ) ) ; ps . setInt ( 15 , psm . getStopPosition ( ) ) ; ps . setString ( 16 , psm . getPreAminoAcid ( ) ) ; ps . setString ( 17 , psm . getPostAminoAcid ( ) ) ; ps . setFloat ( 18 , psm . getDeltaMZ ( ) ) ; ps . setString ( 19 , psm . getQuantificationLabel ( ) ) ; } @ Override public int getBatchSize ( ) { return psms . size ( ) ; } } ) ; } @ Override public void savePSM ( final PSMDetail psm ) { } }

Fix:
String INSERT_QUERY = "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>psm<seq2seq4repair_space>(psm_pk,<seq2seq4repair_space>spectrum_fk,<seq2seq4repair_space>assay_fk,<seq2seq4repair_space>archive_psm_id,<seq2seq4repair_space>sequence,<seq2seq4repair_space>modifications,<seq2seq4repair_space>modifications_standardised,<seq2seq4repair_space>search_engine,<seq2seq4repair_space>" + ( ( "search_engine_scores,<seq2seq4repair_space>search_database,<seq2seq4repair_space>protein_accession,<seq2seq4repair_space>protein_group,<seq2seq4repair_space>protein_name,<seq2seq4repair_space>start_position,<seq2seq4repair_space>" + "stop_position,<seq2seq4repair_space>pre_amino_acid,<seq2seq4repair_space>post_amino_acid,<seq2seq4repair_space>delta_mz,<seq2seq4repair_space>quantification_label)<seq2seq4repair_space>VALUES<seq2seq4repair_space>" ) + "(?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?)" ) ;