Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-673

CachedSubEntries::getSubEntries returns the actual reference to the cache entry

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Express8, Snapshot9, Snapshot9.5, Snapshot9.5.1, Snapshot9.5.2_RC1, Snapshot9.5.2, 9.5.3_RC1
    • Fix Version/s: 10.0.0-EA
    • Component/s: sms
    • Labels:
      None
    • Rank:
      1|hzn7pz:
    • Sprint:
      Sprint 3

      Description

      In the CachedSubEntries::getSubEntries method the code does this:

      if (SMSEntry.cacheSMSEntries)

      { // Add to cache Set answer = new LinkedHashSet(subEntries); ssoTokenToSubEntries.put(tokenID, answer); subEntries = answer; lastUpdated = System.currentTimeMillis(); }

      so we actually return a reference to the cache. If we change anything in this set, we will effect the cache entry. Another hit to the cache will return the same object which could of been corrupted. We should return a copy so the cache entry is not effected.

      so we should do something like this:

      if (SMSEntry.cacheSMSEntries)

      { // Add to cache Set answer = new LinkedHashSet(subEntries); ssoTokenToSubEntries.put(tokenID, answer); subEntries = new LinkedHashSet(answer); lastUpdated = System.currentTimeMillis(); }

        Attachments

          Activity

            People

            • Assignee:
              steve Steve Ferris
              Reporter:
              steve Steve Ferris
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: