Commons Pool
  1. Commons Pool
  2. POOL-197

PooledObject: risky init of lastBorrowTime & lastReturnTime

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Labels:
      None

      Description

      PooledObject inits lastBorrowTime & lastReturnTime (and createTime) using System.currentTimeMillis().

      As well as being wasteful to call the System method 3 times, it's possible that the clock will change between invocations.
      This could result in getActiveTimeMillis() returning non-zero active time even though the object has never been used.

      Should probably init lastBorrowTime & lastReturnTime from createTime.

        Activity

        Sebb created issue -
        Mark Thomas made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0 [ 12311985 ]
        Resolution Fixed [ 1 ]
        Phil Steitz made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Sebb
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development