Setting the initialVocabulary in the SerializerVocabulary class never sets the _readOnlyVocabulary member variable
Tomas-Kraus opened this issue · comments
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.
- Issue Imported From: https://github.com/javaee/metro-fi/issues/52
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @glassfishrobot
@glassfishrobot Commented
Reported by khiggins
@glassfishrobot Commented
khiggins said:
Here's one way to fix it, with the added line of code in the setReadOnlyVocabulary method of the SerializerVocabulary class:
protected void setReadOnlyVocabulary(SerializerVocabulary readOnlyVocabulary,
boolean clear) {
for (int i = 0; i < tables.length; i++)
{ tables[i].setReadOnlyMap(readOnlyVocabulary.tables[i], clear); }
_readOnlyVocabulary = readOnlyVocabulary; //added line of code
}
@glassfishrobot Commented
This issue was imported from java.net JIRA FI-52