fix LUCENE-5840 bug