Update ObjectPool.java
This commit is contained in:
parent
073d06c0ae
commit
798aee47b3
@ -40,7 +40,7 @@ public abstract class ObjectPool<T> {
|
|||||||
* Checkout object from pool
|
* Checkout object from pool
|
||||||
*/
|
*/
|
||||||
public synchronized T checkOut() {
|
public synchronized T checkOut() {
|
||||||
if (available.size() <= 0) {
|
if (available.isEmpty()) {
|
||||||
available.add(create());
|
available.add(create());
|
||||||
}
|
}
|
||||||
T instance = available.iterator().next();
|
T instance = available.iterator().next();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user