Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-786

PassiveExpiringMap documentation - methods that involve accessing the entire map

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.4
    • 4.5.0-M1
    • Map
    • None

    Description

      The documentation for PassiveExpiringMap says:

      When invoking methods that involve accessing the entire map contents (i.e containsKey(Object)entrySet(), etc.) this decorator removes all expired entries prior to actually completing the invocation.

       

      Checked the code for containsKey and it doesn't seem to access the entire map, only the element of the key. If not sure about this, please check the attached show_effect_of_containsKey_containsValue_on_expiration.diff as a proof.

      Suggestion is to replace the example with containsValue(Object) or size() or something that does remove all expired entries prior to actually completing the invocation:

      When invoking methods that involve accessing the entire map contents (i.e containsValue(Object)entrySet(), etc.) this decorator removes all expired entries prior to actually completing the invocation.

      Potential fix patch: fix_doc.diff

      Attachments

        1. show_effect_of_containsKey_containsValue_on_expiration.diff
          2 kB
          Marko Pohajač
        2. fix_doc.diff
          0.7 kB
          Marko Pohajač

        Activity

          People

            kinow Bruno P. Kinoshita
            vandrewskis Marko Pohajač
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m