LUCENE-6196: committing Karl's latest patch https://reviews.apache.org/r/33353/ (diff #9) https://reviews.apache.org/r/33353/diff/raw/