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

Wrong timeout handling in expiration policies of PassiveExpiringMap

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0-alpha1
    • Fix Version/s: 4.0
    • Component/s: None
    • Labels:
      None

      Description

      The timeunit parameter in the ctor of ConstantTimeToLiveExpirationPolicy is not used.

      Additionally, the validateAndConvertToMillis method is wrong, it should be changed like this:

          private static long validateAndConvertToMillis(final long timeToLive,
                                                         final TimeUnit timeUnit) {
        if (timeUnit == null) {
          throw new IllegalArgumentException("Time unit must not be null");
        }
        return TimeUnit.MILLISECONDS.convert(timeToLive, timeUnit);
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tn Thomas Neidhart
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: