If you set the initialVocabulary of an instance of the SerializerVocabulary class, the initialVocabulary method calls the setReadOnlyVocabulary() method, and the setReadOnlyVocabulary() method never sets the _readOnlyVocabulary member variable. The _readOnlyVocabulary member variable is later returned if somebody uses the getReadOnlyVocabulary() method, which is called by the Encoder class inside of the encodeInitialVocabulary() method. To fix this, the _readOnlyVocabulary member variable should be initialized inside of the setReadOnlyVocabulary() method of the SerializerVocabulary class.
If you set the initialVocabulary of an instance of the SerializerVocabulary class, the initialVocabulary method calls the setReadOnlyVocabulary() method, and the setReadOnlyVocabulary() method never sets the _readOnlyVocabulary member variable. The _readOnlyVocabulary member variable is later returned if somebody uses the getReadOnlyVocabulary() method, which is called by the Encoder class inside of the encodeInitialVocabulary() method. To fix this, the _readOnlyVocabulary member variable should be initialized inside of the setReadOnlyVocabulary() method of the SerializerVocabulary class.