Buggy code:
public class DBObjectToVariantSourceEntryConverter implements ComplexTypeConverter < VariantSourceEntry , DBObject > { public static final String FILEID_FIELD = "fid" ; public static final String STUDYID_FIELD = "sid" ; public static final String ALTERNATES_FIELD = "alts" ; public static final String ATTRIBUTES_FIELD = "attrs" ; public static final String FORMAT_FIELD = "fm" ; public static final String SAMPLES_FIELD = "samp" ; public static final String STATS_FIELD = "st" ; private boolean includeSamples ; private boolean includeSrc ; private List < String > samples ; private DBObjectToSamplesConverter samplesConverter ; private DBObjectToVariantStatsConverter statsConverter ; public DBObjectToVariantSourceEntryConverter ( ) { } public DBObjectToVariantSourceEntryConverter ( boolean compressSamples , boolean defaultValue , List < String > samples , DBObjectToVariantStatsConverter statsConverter ) { } public DBObjectToVariantSourceEntryConverter ( boolean includeSamples , DBObjectToVariantStatsConverter statsConverter , List < String > samples ) { } public DBObjectToVariantSourceEntryConverter ( boolean includeSamples , DBObjectToVariantStatsConverter statsConverter , MongoCredentials credentials , String collectionName ) { } public void setIncludeSrc ( boolean includeSrc ) { } @ Override public VariantSourceEntry convertToDataModelType ( DBObject object ) { String fileId = ( ( String ) ( object . get ( DBObjectToVariantSourceEntryConverter . FILEID_FIELD ) ) ) ; String studyId = ( ( String ) ( object . get ( DBObjectToVariantSourceEntryConverter . STUDYID_FIELD ) ) ) ; VariantSourceEntry file = new VariantSourceEntry ( fileId , studyId ) ; if ( object . containsField ( DBObjectToVariantSourceEntryConverter . ALTERNATES_FIELD ) ) { List list = ( ( List ) ( object . get ( DBObjectToVariantSourceEntryConverter . ALTERNATES_FIELD ) ) ) ; String [ ] alternatives = new String [ list . size ( ) ] ; int i = 0 ; for ( Object o : list ) { alternatives [ i ] = o . toString ( ) ; i ++ ; } file . setSecondaryAlternates ( alternatives ) ; } if ( object . containsField ( DBObjectToVariantSourceEntryConverter . ATTRIBUTES_FIELD ) ) { file . setAttributes ( ( ( DBObject ) ( object . get ( DBObjectToVariantSourceEntryConverter . ATTRIBUTES_FIELD ) ) ) . toMap ( ) ) ; <START_BUG> if ( ( includeSrc ) && ( ( ( DBObject ) ( object . get ( DBObjectToVariantSourceEntryConverter . ATTRIBUTES_FIELD ) ) ) . containsField ( "src" ) ) ) { <END_BUG> byte [ ] o = ( ( byte [ ] ) ( ( ( DBObject ) ( object . get ( DBObjectToVariantSourceEntryConverter . ATTRIBUTES_FIELD ) ) ) . get ( "src" ) ) ) ; try { file . addAttribute ( "src" , StringUtils . gunzip ( o ) ) ; } catch ( IOException ex ) { Logger . getLogger ( DBObjectToVariantSourceEntryConverter . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } } if ( object . containsField ( DBObjectToVariantSourceEntryConverter . FORMAT_FIELD ) ) { file . setFormat ( ( ( String ) ( object . get ( DBObjectToVariantSourceEntryConverter . FORMAT_FIELD ) ) ) ) ; } if ( ( includeSamples ) && ( object . containsField ( DBObjectToVariantSourceEntryConverter . SAMPLES_FIELD ) ) ) { VariantSourceEntry fileWithSamplesData = samplesConverter . convertToDataModelType ( object ) ; for ( Map . Entry < String , Map < String , String > > sampleData : fileWithSamplesData . getSamplesData ( ) . entrySet ( ) ) { file . addSampleData ( sampleData . getKey ( ) , sampleData . getValue ( ) ) ; } } if ( ( ( statsConverter ) != null ) && ( object . containsField ( DBObjectToVariantSourceEntryConverter . STATS_FIELD ) ) ) { file . setStats ( statsConverter . convertToDataModelType ( ( ( DBObject ) ( object . get ( DBObjectToVariantSourceEntryConverter . STATS_FIELD ) ) ) ) ) ; } return file ; } @ Override public DBObject convertToStorageType ( VariantSourceEntry object ) { } }

Fix:
if ( ( ( DBObject ) ( object . get ( DBObjectToVariantSourceEntryConverter . ATTRIBUTES_FIELD ) ) ) . containsField ( "src" ) ) {