Entities - missing final modifiers; thread-safety issues
--------------------------------------------------------
Key: LANG-506
URL: https://issues.apache.org/jira/browse/LANG-506
Project: Commons Lang
Issue Type: Bug
Reporter: Sebb
Some fields in Entities are used as constants but they are not final, so can be
changed accidentally or maliciously:
ISO8859_1_ARRAY_LENGTH
HTML40_ARRAY_LENGTH
Entities.map should also be final
Entities.LookupEntityMap.LOOKUP_TABLE_SIZE should be final
Entities.MapIntMap.mapValueToName and mapNameToValue would benefit from being
made final.
This would require a constructor to be added that can initialise the Maps.
LookupEntityMap is not thread-safe - it creates the lookup table without
synchronisation, and mutates it after initial creation.
Entities.ArrayEntityMap.growBy should be final
As far as possible, all instance fields to be made final.
Patch to follow
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.