We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cd54cf5 + 798aee4 commit 31f4b15Copy full SHA for 31f4b15
object-pool/src/main/java/com/iluwatar/object/pool/ObjectPool.java
@@ -40,7 +40,7 @@ public abstract class ObjectPool<T> {
40
* Checkout object from pool
41
*/
42
public synchronized T checkOut() {
43
- if (available.size() <= 0) {
+ if (available.isEmpty()) {
44
available.add(create());
45
}
46
T instance = available.iterator().next();
0 commit comments