Buggy code:
public class BlockJoinQuery extends Query { public static enum ScoreMode { None , Avg , Max , Total ; } private final Filter parentsFilter ; private final Query childQuery ; private final Query origChildQuery ; private final BlockJoinQuery . ScoreMode scoreMode ; public BlockJoinQuery ( Query childQuery , Filter parentsFilter , BlockJoinQuery . ScoreMode scoreMode ) { } private BlockJoinQuery ( Query origChildQuery , Query childQuery , Filter parentsFilter , BlockJoinQuery . ScoreMode scoreMode ) { } @ Override public Weight createWeight ( IndexSearcher searcher ) throws IOException { } private static class BlockJoinWeight extends Weight { private final Query joinQuery ; private final Weight childWeight ; private final Filter parentsFilter ; private final BlockJoinQuery . ScoreMode scoreMode ; public BlockJoinWeight ( Query joinQuery , Weight childWeight , Filter parentsFilter , BlockJoinQuery . ScoreMode scoreMode ) { } @ Override public Query getQuery ( ) { } @ Override public float getValueForNormalization ( ) throws IOException { } @ Override public void normalize ( float norm , float topLevelBoost ) { } @ Override public Scorer scorer ( AtomicReaderContext readerContext , boolean scoreDocsInOrder , boolean topScorer , Bits acceptDocs ) throws IOException { final Scorer childScorer = childWeight . scorer ( readerContext , true , false , acceptDocs ) ; if ( childScorer == null ) { return null ; } final int firstChildDoc = childScorer . nextDoc ( ) ; if ( firstChildDoc == ( DocIdSetIterator . NO_MORE_DOCS ) ) { return null ; } <START_BUG> final DocIdSet parents = parentsFilter . getDocIdSet ( readerContext ) ; <END_BUG> if ( parents == null ) { return null ; } if ( ! ( parents instanceof FixedBitSet ) ) { throw new IllegalStateException ( ( "parentFilter<seq2seq4repair_space>must<seq2seq4repair_space>return<seq2seq4repair_space>FixedBitSet;<seq2seq4repair_space>got<seq2seq4repair_space>" + parents ) ) ; } return new BlockJoinQuery . BlockJoinScorer ( this , childScorer , ( ( FixedBitSet ) ( parents ) ) , firstChildDoc , scoreMode ) ; } @ Override public Explanation explain ( AtomicReaderContext reader , int doc ) throws IOException { } @ Override public boolean scoresDocsOutOfOrder ( ) { } } static class BlockJoinScorer extends Scorer { private final Scorer childScorer ; private final FixedBitSet parentBits ; private final BlockJoinQuery . ScoreMode scoreMode ; private int parentDoc ; private float parentScore ; private int nextChildDoc ; private int [ ] pendingChildDocs = new int [ 5 ] ; private float [ ] pendingChildScores ; private int childDocUpto ; public BlockJoinScorer ( Weight weight , Scorer childScorer , FixedBitSet parentBits , int firstChildDoc , BlockJoinQuery . ScoreMode scoreMode ) { } @ Override public Collection < ChildScorer > getChildren ( ) { } int getChildCount ( ) { } int [ ] swapChildDocs ( int [ ] other ) { } float [ ] swapChildScores ( float [ ] other ) { } @ Override public int nextDoc ( ) throws IOException { } @ Override public int docID ( ) { } @ Override public float score ( ) throws IOException { } @ Override public int advance ( int parentTarget ) throws IOException { } } @ Override public void extractTerms ( Set < Term > terms ) { } @ Override public Query rewrite ( IndexReader reader ) throws IOException { } @ Override public String toString ( String field ) { } @ Override public boolean equals ( Object _other ) { } @ Override public int hashCode ( ) { } @ Override public Object clone ( ) { } }

Fix:
final DocIdSet parents = parentsFilter . getDocIdSet ( readerContext , readerContext . reader . getLiveDocs ( ) ) ;