You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/10/04 07:57:14 UTC

DO NOT REPLY [Bug 36904] New: - [pool] GenericKeyedObjectPool is a LIFO, not a FIFO implementation

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36904>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36904

           Summary: [pool] GenericKeyedObjectPool is a LIFO, not a FIFO
                    implementation
           Product: Commons
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: PatchAvailable
          Severity: normal
          Priority: P2
         Component: Pool
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: Sandy@McArthur.org


Like GenericObjetPool is a LIFO as described in Bug #33264 ,
GenericKeyedObjectPool has the same discrepancy between documentation and
implementation. Soon to be attached is a patch which brings the implementation
of GenericKeyedObjectPool into line with the documentation and provides a unit
test to verify this.

This patch has the side effect of breaking the
TestKeyedObjectPool.testBaseBorrowReturn() test which is broken for a FIFO. If
you look at lines 90 to 94, copied below, you'll see that it clearly tests a
LIFO behavior.

_pool.returnObject(keya,obj0);
_pool.returnObject(keya,obj2);
obj2 = _pool.borrowObject(keya);
obj0 = _pool.borrowObject(keya);

It's my opinion that those last lines of
TestKeyedObjectPool.testBaseBorrowReturn() should be removed as they are shared
between the GenericKeyedObjectPool and the StackKeyedObjectPool and if one is to
be a FIFO and the other a LIFO those lines of cannot be correct for both at the
same time.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org