Buggy code:
public abstract class AbstractMzTabConverter extends ConvertProvider < DataAccessController , Void > { protected static final Logger logger = Logger . getLogger ( AbstractMzTabConverter . class ) ; protected Metadata metadata ; protected MZTabColumnFactory proteinColumnFactory ; protected MZTabColumnFactory psmColumnFactory ; protected Map < String , Integer > proteinScoreToScoreIndex ; protected Map < String , Integer > psmScoreToScoreIndex ; private static final Integer THRESHOLD_LOOP_FOR_SCORE = 200 ; public AbstractMzTabConverter ( DataAccessController controller ) { } @ Override protected void init ( ) { } @ Override protected Metadata convertMetadata ( ) { } protected abstract void loadSoftware ( ) { } protected void loadReferences ( ) { } protected void loadContacts ( ) { } protected abstract void loadExperimentParams ( ) { } protected abstract void loadSampleProcessing ( ) { } protected abstract void loadInstrument ( ) { } protected void loadSearchEngineScores ( ) { Map < SearchEngineScoreParam , Integer > psmScores = new HashMap < SearchEngineScoreParam , Integer > ( ) ; Map < SearchEngineScoreParam , Integer > proteinScores = new HashMap < SearchEngineScoreParam , Integer > ( ) ; proteinScoreToScoreIndex = new HashMap < String , Integer > ( ) ; psmScoreToScoreIndex = new HashMap < String , Integer > ( ) ; String searchEngineName = null ; Collection < Comparable > proteinHypothesisIds = source . getProteinIds ( ) ; List < Peptide > peptides = new ArrayList < Peptide > ( ) ; Iterator < Comparable > idProtein = proteinHypothesisIds . iterator ( ) ; int iProtein = 0 ; while ( ( idProtein . hasNext ( ) ) && ( iProtein < ( AbstractMzTabConverter . THRESHOLD_LOOP_FOR_SCORE ) ) ) { Comparable proteinId = idProtein . next ( ) ; Protein protein = source . getProteinById ( proteinId ) ; List < SearchEngineScoreParam > proteinParams = MzTabUtils . getSearchEngineScoreTerm ( protein . getScore ( ) ) ; <START_BUG> searchEngineName = protein . getScore ( ) . getDefaultSearchEngine ( ) . name ( ) ; <END_BUG> for ( SearchEngineScoreParam scoreCv : proteinParams ) { proteinScores . put ( scoreCv , iProtein ) ; } iProtein ++ ; peptides . addAll ( protein . getPeptides ( ) ) ; } Iterator < Peptide > idPeptide = peptides . iterator ( ) ; int iPeptide = 1 ; while ( idPeptide . hasNext ( ) ) { SpectrumIdentification psmId = idPeptide . next ( ) . getSpectrumIdentification ( ) ; List < SearchEngineScoreParam > psmParams = MzTabUtils . getSearchEngineScoreTerm ( psmId . getScore ( ) ) ; for ( SearchEngineScoreParam scoreCv : psmParams ) { psmScores . put ( scoreCv , iPeptide ) ; } iPeptide ++ ; } for ( SearchEngineScoreParam param : psmScores . keySet ( ) ) { int idCount = ( metadata . getPsmSearchEngineScoreMap ( ) . size ( ) ) + 1 ; metadata . addPsmSearchEngineScoreParam ( idCount , param . getParam ( null ) ) ; psmScoreToScoreIndex . put ( param . getParam ( null ) . getAccession ( ) , idCount ) ; } for ( SearchEngineScoreParam param : proteinScores . keySet ( ) ) { int idCount = ( metadata . getProteinSearchEngineScoreMap ( ) . size ( ) ) + 1 ; metadata . addProteinSearchEngineScoreParam ( idCount , param . getParam ( null ) ) ; proteinScoreToScoreIndex . put ( param . getParam ( null ) . getAccession ( ) , idCount ) ; } if ( metadata . getProteinSearchEngineScoreMap ( ) . isEmpty ( ) ) { metadata . addProteinSearchEngineScoreParam ( 1 , MS_SEARCH_ENGINE_SPECIFIC_SCORE . getParam ( searchEngineName ) ) ; } if ( metadata . getPsmSearchEngineScoreMap ( ) . isEmpty ( ) ) { metadata . addPsmSearchEngineScoreParam ( 1 , MS_SEARCH_ENGINE_SPECIFIC_SCORE . getParam ( searchEngineName ) ) ; } } protected abstract void loadMsRun ( ) { } protected abstract void loadSamples ( ) { } protected abstract void loadGelData ( ) { } private void loadURI ( String expAccession ) { } @ Override protected abstract MZTabColumnFactory convertProteinColumnFactory ( ) { } @ Override protected MZTabColumnFactory convertPSMColumnFactory ( ) { } @ Override protected abstract void fillData ( ) { } protected boolean isIdentification ( ) { } protected static boolean isSupported ( DataAccessController controller ) { } private String getFileNameWithoutExtension ( String fileName ) { } }

Fix:
searchEngineName = ( ( ( ( protein . getScore ( ) ) != null ) && ( ( protein . getScore ( ) . getAllScoreValues ( ) . size ( ) ) > 0 ) ) && ( ( protein . getScore ( ) . getDefaultSearchEngine ( ) ) != null ) ) ? protein . getScore ( ) . getDefaultSearchEngine ( ) . name ( ) : null ;