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

LRUMap constructor javadoc and behavior are inconsistent (maxSize cannot be less than 0)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1
    • 4.0-alpha1, 4.0
    • Map
    • None
    • n/a

    Description

      The LRUMap constructor specifies "@param maxSize the maximum size of the map, -1 for no limit"

      The first line is then:

      if (maxSize < 1)

      { throw new IllegalArgumentException("LRUMap max size must be greater than 0"); }

      There is nothing wrong with allowing a negative maxSize. This way the map can be used to order elements relative to access time. I think the above code should be remove and the javadoc should stay the same.

      Attachments

        Activity

          People

            Unassigned Unassigned
            os111 ori
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1m
                1m
                Remaining:
                Remaining Estimate - 1m
                1m
                Logged:
                Time Spent - Not Specified
                Not Specified