You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by mswintermeyer <gi...@git.apache.org> on 2018/11/19 04:24:33 UTC

[GitHub] commons-pool issue #17: POOL-359: prevent NPE closing multiple GenericObject...

Github user mswintermeyer commented on the issue:

    https://github.com/apache/commons-pool/pull/17
  
    If `cancel` should not be called more than once, then I believe that would require a greater re-architecture. `GenericObjectPool`'s would need to keep track of whether another object pool called `cancel`: to rely on something other than non-static state (`closed` variable on `BaseGenericObjectPool`) to call a static method. To me, it seems cleanest for static methods to be designed defensively. So I'm not aware of a reason to not allow this, but I acknowledge I'm new to the codebase.
    
    Side note that the risk of an NPE in `cancel` seems somewhat new. [This commit](https://github.com/apache/commons-pool/commit/867614829ba6b041ca6becbad0f43cb180003404#diff-38e254894b87bdf9a1758778c7ffd50fL96) refactored `EvictionTimer` to depend on the executor's queue rather than an integer `usageCount`.


---

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