commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 15339] - StackObjectPool needs to ensure available objects in pool are unique
Date Thu, 12 Dec 2002 23:53:18 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15339>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15339

StackObjectPool needs to ensure available objects in pool are unique

rwaldhoff@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|Normal                      |Enhancement



------- Additional Comments From rwaldhoff@apache.org  2002-12-12 23:53 -------
This patch assumes that the pooled objects define a meaningful equals method, 
which may not always be the case (although it's probably generally the case).

This is probably more accurately considered a documentation lack.  The implict 
contract is that each object is only returned once.  As you suggest, it is 
possible to confirm/enforce this contract by checking the objects already in 
the pool, at some cost (perhaps small).  I'm not sure we always need/want to 
validate this assertion, or whether we want to make this validation 
configurable (e.g., we could make it an actual JDK 1.4 assertion, or 
have "strict" mode that checks it, etc.).

Also, the same defect could be reported against all of the current pool 
implementations.

I'm gonna flag this as an enhancement for now.  We should probably at least 
clarify the contract w.r.t. this because you're right, returning the same 
object multiple times will likely lead to problems in the client code.

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


Mime
View raw message