Index: lucene/core/src/java/org/apache/lucene/util/MathUtil.java =================================================================== --- lucene/core/src/java/org/apache/lucene/util/MathUtil.java (revision 1352563) +++ lucene/core/src/java/org/apache/lucene/util/MathUtil.java (working copy) @@ -27,9 +27,14 @@ private MathUtil() { } - /** returns x == 0 ? 0 : Math.floor(Math.log(x) / Math.log(base)) */ + /** + * Returns {@code x <= 0 ? 0 : Math.floor(Math.log(x) / Math.log(base))} + * @param base must be {@code > 1} + */ public static int log(long x, int base) { - assert base > 1; + if (base <= 1) { + throw new IllegalArgumentException("base must be > 1"); + } int ret = 0; while (x >= base) { x /= base;