osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: dev-help@xxxxxxxxxxxxxxxxxx