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

[EMAIL PROTECTED] changed:

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



------- Additional Comments From [EMAIL PROTECTED]  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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to