Buggy code:
public class InMemoryQuery { public InMemoryQuery ( ) { } public static void main ( String [ ] args ) throws IOException , ClassNotFoundException { System . out . println ( "Loading<seq2seq4repair_space>file..." ) ; Stopwatch sw = new Stopwatch ( UNIT . SECONDS ) ; <START_BUG> FileInputStream fileInputStream = new FileInputStream ( "inMemoryDataContainer_fromH2.bin" ) ; <END_BUG> ObjectInputStream objectReader = new ObjectInputStream ( fileInputStream ) ; InMemoryDataContainer container = ( ( InMemoryDataContainer ) ( objectReader . readObject ( ) ) ) ; objectReader . close ( ) ; System . out . println ( ( ( "File<seq2seq4repair_space>loaded<seq2seq4repair_space>in<seq2seq4repair_space>" + ( sw . stop ( ) ) ) + "<seq2seq4repair_space>seconds" ) ) ; String line = "x" ; Scanner sc = new Scanner ( System . in ) ; while ( ! ( line . equals ( "exit" ) ) ) { System . out . println ( "Query<seq2seq4repair_space>what:<seq2seq4repair_space>" ) ; line = sc . nextLine ( ) ; Integer entityID = - 1 ; Integer anchorID = - 1 ; try { anchorID = entityID = Integer . parseInt ( line ) ; } catch ( Exception e ) { } if ( entityID == ( - 1 ) ) { entityID = container . entityToID . get ( line ) ; if ( entityID == null ) { System . out . println ( "No<seq2seq4repair_space>entity<seq2seq4repair_space>found" ) ; entityID = - 1 ; } else { System . out . println ( ( "Found<seq2seq4repair_space>entity<seq2seq4repair_space>ID:<seq2seq4repair_space>" + entityID ) ) ; } anchorID = container . anchorID . get ( line ) ; if ( anchorID == null ) { System . out . println ( "No<seq2seq4repair_space>anchor<seq2seq4repair_space>found" ) ; anchorID = - 1 ; } else { System . out . println ( ( "Found<seq2seq4repair_space>anchor<seq2seq4repair_space>ID:<seq2seq4repair_space>" + anchorID ) ) ; } } if ( entityID != ( - 1 ) ) { if ( entityID < ( container . idToEntity . length ) ) System . out . println ( ( "Entity:<seq2seq4repair_space>" + ( container . idToEntity [ entityID ] ) ) ) ; else System . out . println ( ( ( ( "Entity<seq2seq4repair_space>ID<seq2seq4repair_space>larger<seq2seq4repair_space>than<seq2seq4repair_space>entity<seq2seq4repair_space>array<seq2seq4repair_space>lenght:<seq2seq4repair_space>" + entityID ) + "<seq2seq4repair_space>>=<seq2seq4repair_space>" ) + ( container . idToEntity . length ) ) ) ; } System . out . println ( "" ) ; if ( anchorID != ( - 1 ) ) { if ( anchorID < ( container . anchorToCandidates . length ) ) { System . out . println ( "candidates<seq2seq4repair_space>for<seq2seq4repair_space>anchor:" ) ; for ( int j = 0 ; j < ( container . anchorToCandidates [ anchorID ] . length ) ; j ++ ) { int tmpEntityID = container . anchorToCandidates [ anchorID ] [ j ] ; System . out . println ( ( ( ( ( tmpEntityID + "<seq2seq4repair_space>==<seq2seq4repair_space>" ) + ( container . idToEntity [ tmpEntityID ] ) ) + "<seq2seq4repair_space>count:<seq2seq4repair_space>" ) + ( container . anchorToCandidatesCount [ anchorID ] [ j ] ) ) ) ; } } else System . out . println ( ( ( ( "Anchor<seq2seq4repair_space>ID<seq2seq4repair_space>larger<seq2seq4repair_space>than<seq2seq4repair_space>anchor<seq2seq4repair_space>array<seq2seq4repair_space>lenght:<seq2seq4repair_space>" + anchorID ) + "<seq2seq4repair_space>>=<seq2seq4repair_space>" ) + ( container . anchorToCandidates . length ) ) ) ; } } } }

Fix:
FileInputStream fileInputStream = new FileInputStream ( "inMemoryDB.bin" ) ;