Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2
-
None
Description
This test throws exception:
GenericObjectPoolConfig config = new GenericObjectPoolConfig (); config.setMaxTotal ( 2 ); GenericObjectPool<Set> setsPool = new GenericObjectPool<> ( new BasePooledObjectFactory<Set> () { @Override public Set create () throws Exception { return new HashSet(); } @Override public PooledObject<Set> wrap ( Set o ) { return new DefaultPooledObject<> ( o ); } @Override public void passivateObject ( PooledObject<Set> p ) throws Exception { p.getObject ().clear (); super.passivateObject ( p ); } }, config ); final Set set1 = setsPool.borrowObject (); final Set set2 = setsPool.borrowObject (); setsPool.returnObject ( set1 ); setsPool.returnObject ( set2 ); // this throws java.lang.IllegalStateException: Object has already been retured to this pool or is invalid