Issue #206 Throw an exception if the bag is closed, this will cause addConnection() to cleanly close the opened connection and correctly decrement the pool count.

pull/201/merge
Brett Wooldridge 10 years ago
parent 396ecf4008
commit 527c8ce59c

@ -179,7 +179,7 @@ public final class ConcurrentBag<T extends BagEntry>
public void add(final T bagEntry) public void add(final T bagEntry)
{ {
if (closed) { if (closed) {
LOGGER.warn("ConcurrentBag has been closed, ignoring add()"); throw new IllegalStateException("ConcurrentBag has been closed, ignoring add()");
} }
else { else {
sharedList.add(bagEntry); sharedList.add(bagEntry);

@ -178,7 +178,7 @@ public final class ConcurrentBag<T extends BagEntry>
public void add(final T bagEntry) public void add(final T bagEntry)
{ {
if (closed) { if (closed) {
LOGGER.warn("ConcurrentBag has been closed, ignoring add()"); throw new IllegalStateException("ConcurrentBag has been closed, ignoring add()");
} }
else { else {
sharedList.add(bagEntry); sharedList.add(bagEntry);

Loading…
Cancel
Save