Uploaded image for project: 'Commons Pool'
  1. Commons Pool
  2. POOL-188

Confusing PoolUtils.ErodingKeyedObjectPool.numIdle(K key) method; bug in ErodingKeyedObjectPool.returnObject(K key, V obj) ?

    XMLWordPrintableJSON

    Details

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

      Description

      numIdle(key) is equivalent to PoolUtils.ErodingKeyedObjectPool.getNumIdle() - unless the method getKeyedPool() is overridden.

      It's confusing that the key parameter is not used - this may be the cause of a bug, as the method is used internally by ErodingKeyedObjectPool.returnObject(K key, V obj).

      It looks like returnObject() should probably call getNumIdle(key) rather than numIdle(key).
      In which case the confusing numIdle method can be deleted.

        Attachments

        1. POOL-188.patch
          1 kB
          Sebb

          Activity

            People

            • Assignee:
              markt Mark Thomas
              Reporter:
              sebb Sebb
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: