diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-08-03 11:37:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-03 11:37:14 +0200 |
commit | a6e2c134d346986e5a85c8fe605d062ae0bcc270 (patch) | |
tree | ee5db00799eaede23bf8ae03c57f591db6a8d392 /vdslib | |
parent | 4b5d8b701e0fe125008b4249057697614d2bab54 (diff) | |
parent | 43e0cadfb2b3c126813f4ea6cef9c9b145162a6c (diff) |
Merge pull request #10185 from vespa-engine/revert-10184-revert-10183-balder/add-maxredundancy-to-exception
Revert "Revert "Add maxRedundancy to exception message.""
Diffstat (limited to 'vdslib')
-rw-r--r-- | vdslib/src/main/java/com/yahoo/vdslib/distribution/Group.java | 4 | ||||
-rw-r--r-- | vdslib/src/test/java/com/yahoo/vdslib/distribution/GroupTestCase.java | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/vdslib/src/main/java/com/yahoo/vdslib/distribution/Group.java b/vdslib/src/main/java/com/yahoo/vdslib/distribution/Group.java index e3caaeb455c..680021893f7 100644 --- a/vdslib/src/main/java/com/yahoo/vdslib/distribution/Group.java +++ b/vdslib/src/main/java/com/yahoo/vdslib/distribution/Group.java @@ -237,7 +237,9 @@ public class Group implements Comparable<Group> { } this.distributionSpec = distributionSpec; // Create the pre calculated results - if (maxRedundancy <= 0 || maxRedundancy > 255) throw new IllegalArgumentException("The max redundancy must be a positive number in the range 1-255."); + if (maxRedundancy <= 0 || maxRedundancy > 255) { + throw new IllegalArgumentException("The max redundancy (" + maxRedundancy + ") must be a positive number in the range 1-255."); + } int asterixCount = distributionSpec.length - firstAsterix; int[][] preCalculations = new int[maxRedundancy + 1][]; for (int i=1; i<=maxRedundancy; ++i) { diff --git a/vdslib/src/test/java/com/yahoo/vdslib/distribution/GroupTestCase.java b/vdslib/src/test/java/com/yahoo/vdslib/distribution/GroupTestCase.java index c71216b192d..2d6a85182d5 100644 --- a/vdslib/src/test/java/com/yahoo/vdslib/distribution/GroupTestCase.java +++ b/vdslib/src/test/java/com/yahoo/vdslib/distribution/GroupTestCase.java @@ -48,7 +48,7 @@ public class GroupTestCase { assertDistribution("*|*|*", 5, "2,2,1"); assertDistribution("*|*|*|*", 5, "2,1,1,1"); - assertDistributionFailure("2|*", 0, "The max redundancy must be a positive number in the range 1-255."); + assertDistributionFailure("2|*", 0, "The max redundancy (0)must be a positive number in the range 1-255."); assertDistributionFailure("*|2", 3, "Illegal distribution spec \"*|2\". Asterix specification must be tailing the specification."); assertDistributionFailure("*|2|*", 3, "Illegal distribution spec \"*|2|*\". Asterix specification must be tailing the specification."); assertDistributionFailure("0|*", 3, "Illegal distribution spec \"0|*\". Copy counts must be in the range 1-255."); |