Description
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