well maxDoc is an integer so maxTermFreq * maxDoc <= Integer.MAX_VALUE and therefore the ceil is also <= Integer.MAX_VALUE