Apache Commons Pool 2.8.0 发布

Apache Commons Pool 提供了一个对象池 API 和一系列对象池实现。

与 1.x 系列相比,Apache Commons Pool 2.x 包含完全重写的池实现。除了性能和可扩展性改进之外,2.x 还包括强大的实例跟踪和池监控,要求 JDK 1.6 及以上。

Apache Commons Pool 2.8.0 更新内容:

新特性

  • POOL-378:弃用 PoolUtils.prefill(ObjectPool,int),而推荐使用 ObjectPool.addObjects(int)
  • POOL-379:弃用 PoolUtils.prefill(KeyedObjectPool,K,int),而推荐使用 KeyedObjectPool.addObjects(K,int)
  • POOL-380:建议使用 KeyedObjectPool.addObjects(Collection,int),弃用 PoolUtils.prefill(KeyedObjectPool,Collection,int)

Bug 修复

  • POOL-374:当在池映射中找不到键时,org.apache.commons.pool2.impl.GenericKeyedObjectPool.returnObject(K,T)应该抛出 IllegalStateException 而不是 NullPointerException
  • POOL-376:修复了 POOL-356 原始修复的回归问题,该问题可能会在销毁对象时导致 NPE
  • POOL-326:由于过早删除了密钥池,因此消除了 NPE/ISE 异常
  • 在对基础 BufferedOutputStream 调用 toString 之前,先在测试中关闭 BufferedOutputStream
  • [Javadoc] 在 SoftReferenceObjectPool 中添加缺少的 @throws 注释

详情见更新说明

猜你喜欢

转载自www.oschina.net/news/112088/commons-pool-2-8-0-released
今日推荐