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 Summary: StackObjectPool needs to ensure available objects in pool are unique Product: Commons Version: 1.0.1 Final Platform: All OS/Version: All Status: NEW Severity: Normal Priority: Other Component: Pool AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] java.util.Stack is not a Set and thus does not guarantee a unique set of objects to be available in the pool. In the unfortunate circumstance that returnObject is called twice on the same object, this will make two references to the same resource available in the pool. My simple work-around is shown in the diff below. --- StackObjectPool.java Wed May 1 02:02:34 2002 +++ /home/edecosta/work/komodo/src/org/apache/commons/pool/impl/StackObjectPool.java Thu Dec 12 17:50:17 2002 @@ -191,6 +191,8 @@ if(_pool.size() >= _maxSleeping) { shouldDestroy = true; } else if(success) { + if (_pool.contains(obj)) + throw new IllegalStateException("Pool already contains this object!"); _pool.push(obj); } notifyAll(); // _numActive has changed -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>