You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a range of ports 9000 to 9005, if ports 9000 through 9003 are in use while ports 9004 and 9005 are available, IncrementingPortFinder should find ports 9004 and 9005.
The initial implementation limited the IntStream.iterate to ports below the max port (9005 in the above example), which means it stops checking at 9004 and throws an exception. The iteration should be limited to below or equal to the max port, so that it properly handles the situation when only the last two ports in the allowable range are available.
A classic off by one error!
The text was updated successfully, but these errors were encountered:
Given a range of ports 9000 to 9005, if ports 9000 through 9003 are in use while ports 9004 and 9005 are available,
IncrementingPortFinder
should find ports 9004 and 9005.The initial implementation limited the
IntStream.iterate
to ports below the max port (9005 in the above example), which means it stops checking at 9004 and throws an exception. The iteration should be limited to below or equal to the max port, so that it properly handles the situation when only the last two ports in the allowable range are available.A classic off by one error!
The text was updated successfully, but these errors were encountered: