Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,20 @@ public ReservedThreadExecutor(Executor executor, int capacity, int minSize, int
_minSize = minSize < 0 ? Math.min(1, _threads.capacity()) : minSize;
if (_minSize > _threads.capacity())
throw new IllegalArgumentException("minSize larger than capacity");
_maxPending = maxPending;
if (_maxPending == 0)
throw new IllegalArgumentException("maxPending cannot be 0");

if (maxPending < 0)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the braces for these one-line if/else statements.

_maxPending = -1;
}
else if (maxPending == 0)
{
_maxPending = reservedThreads(executor, capacity);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_maxPending = reservedThreads(executor, capacity);
_maxPending = _threads.capacity();

}
else
{
_maxPending = maxPending;
}

if (LOG.isDebugEnabled())
LOG.debug("{}", this);
installBean(_executor);
Expand Down