Skip to content

Commit

Permalink
HIVE-25446: Wrong exception thrown if capacity<=0 (Ashish Sharma, rev…
Browse files Browse the repository at this point in the history
…iewed by Nikhil Gupta, Adesh Rao)

Signed-off-by: Sankar Hariappan <sankarh@apache.org>
Closes (#3092)
  • Loading branch information
ashish-kumar-sharma committed Mar 23, 2022
1 parent 09a272c commit 1a6212e
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -63,12 +63,12 @@ public void throwExpandError(int limit, String dataTypeName) {
}

private static void validateCapacity(long capacity) {
if (Long.bitCount(capacity) != 1) {
throw new AssertionError("Capacity must be a power of two " + capacity);
}
if (capacity <= 0) {
throw new AssertionError("Invalid capacity " + capacity);
}
if (Long.bitCount(capacity) != 1) {
throw new AssertionError("Capacity must be a power of two " + capacity);
}
}

private static int nextHighestPowerOfTwo(int v) {
Expand Down

0 comments on commit 1a6212e

Please sign in to comment.