Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Operating System: All
Platform: All
-
36904
Description
Like GenericObjetPool is a LIFO as described in COM-1866 ,
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.