Throw IllegalArgumentException with human-readable message in VanillaChronicleMap.Segment.alloc() method on attempt of allocation of more than 64 blocks

This commit is contained in:
leventov
2014-10-05 06:06:53 +04:00
parent d09353cb2e
commit 6ce22f02f7
@@ -897,6 +897,9 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, KI>,
}
int alloc(int blocks) {
if (blocks > MAX_ENTRY_OVERSIZE_FACTOR)
throw new IllegalArgumentException("Entry is too large: requires " + blocks +
" entry size chucks, " + MAX_ENTRY_OVERSIZE_FACTOR + " is maximum.");
int ret = (int) freeList.setNextNContinuousClearBits(nextPosToSearchFrom,
blocks);
if (ret == DirectBitSet.NOT_FOUND) {