It is better to fail early here. If you incorrectly override e.g. getDocIDSet instead of getDocIdSet(), you will never find the error, only get NPEs at unrelated positions. Throwing the UOE shows exactly where to look for the error. For a similar case see the new DocIdSetIterator.