commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] Created: (LANG-506) Entities - missing final modifiers; thread-safety issues
Date Mon, 18 May 2009 12:13:45 GMT
Entities - missing final modifiers; thread-safety issues

                 Key: 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:

HTML40_ARRAY_LENGTH 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.

View raw message