eclipse-ee4j / jaxb-fi

Apache License 2.0
8 stars 10 forks source link

Setting the initialVocabulary in the SerializerVocabulary class never sets the _readOnlyVocabulary member variable #52

Open Tomas-Kraus opened 11 years ago

Tomas-Kraus commented 11 years ago

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.

Tomas-Kraus commented 5 years ago
Tomas-Kraus commented 11 years ago

@glassfishrobot Commented Reported by khiggins

Tomas-Kraus commented 11 years ago

@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 }

Tomas-Kraus commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA FI-52