Uploaded image for project: 'Apache Roller'
  1. Apache Roller
  2. ROL-2101

Thread unsafe use of HashMap for cached mappings exist

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 5.1.2
    • 5.2.0
    • None

    Description

      There are two singleton classes that have a instance field type of HashMap for cache.

      In JPAUserManagerImpl:

      // cached mapping of userNames -> userIds
      private Map<String, String> userNameToIdMap = new HashMap<String, String>();
      

      In JPAWeblogEntryManagerImpl:

      // cached mapping of entryAnchors -> entryIds
      private Map<String, String> entryAnchorToIdMap = new HashMap<String, String>();
      

      HashMap s should not be used as the above because it's not thread safe.

      Attachments

        1. ROL-2101.patch
          2 kB
          Kohei Nozaki

        Issue Links

          Activity

            People

              roller_unassigned Roller Unassigned
              xkylex Kohei Nozaki
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: