Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
tjake committed Oct 6, 2023
1 parent cd6786e commit 243ebdf
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public Pooled<T> get() {
if (t != null)
return new Pooled<>(this, t);

if (created.incrementAndGet() >= limit) {
if (created.incrementAndGet() > limit) {
created.decrementAndGet();
throw new IllegalStateException("Number of outstanding pooled objects has gone beyond the limit of " + limit);
}
Expand All @@ -130,7 +130,6 @@ public Stream<T> stream() {
}

protected void onClosed(T value) {
//Do we are if offer fails?
queue.offer(value);
}
}
Expand Down

0 comments on commit 243ebdf

Please sign in to comment.