What happened?
Calling next() on a deploy strategy whose available array is empty produces a different exception per strategy:
OneOnEach: IndexOutOfBoundsException
RoundRobinDeployment: ArithmeticException (divide-by-zero on index = (index + 1) % length)
RandomDeployment: IllegalArgumentException (Random.nextInt(0) rejects bound 0)
The shared DeployStrategy trait gives no contract for the empty-array case, but a unified failure mode would make callers easier to write.
How to reproduce?
For each strategy, init with Array.empty[Address] and call next():
OneOnEach().tap(_.initialize(Array.empty)).next() // IndexOutOfBoundsException
RoundRobinDeployment().tap(_.initialize(Array.empty)).next() // ArithmeticException
RandomDeployment().tap(_.initialize(Array.empty)).next() // IllegalArgumentException
Version
1.1.0-incubating (Pre-release/Master)
What happened?
Calling
next()on a deploy strategy whoseavailablearray is empty produces a different exception per strategy:OneOnEach:IndexOutOfBoundsExceptionRoundRobinDeployment:ArithmeticException(divide-by-zero onindex = (index + 1) % length)RandomDeployment:IllegalArgumentException(Random.nextInt(0)rejects bound 0)The shared
DeployStrategytrait gives no contract for the empty-array case, but a unified failure mode would make callers easier to write.How to reproduce?
For each strategy,
initwithArray.empty[Address]and callnext():Version
1.1.0-incubating (Pre-release/Master)