I hit NPE in DocInvertedPerField in the following scenario:
1) Create IndexWriter w/ a null Analyzer.
2) Add two fields to a Document, w/ a TokenStream (or one as not analyzed and one as TokenStream, or two not analyzed).
3) Add the document to the IndexWriter.
The NPE comes from processFields (line 79), when it tries to read the position increment gap.

I think I'm using it right, but want to verify. If I always add fields as TokenStream, or untokenized, I don't really need the Analyzer on IndexWriter. Also, in case of a TokenStream field, DocInverterPerField just uses the TokenStream and not the Analyzer. So maybe it should read the posIncrGap only if analyzer is not null?

Is this a bug or a misuse of IndexWriter by me?