First of all, writer.getReader()
is only available in 3.6 release but absent in all v4 (4.0, 4.1, ...) releases. So you shouldn't be using it if you care about maintainability.
Now, to answer your question. writer.getReader()
flushes all pending writes and unconditionally opens a new reader (plus there are some other limitations - see method javadoc). IndexReader.openIfChanged(oldReader)
only opens a new reader if there were any changes made, otherwise returns old reader.
To my taste, opening a reader from writer is also conceptually wrong (there used to be other cases in Lucene having this problem, e.g. it used to be possible to delete documents using reader).
If you are choosing between the two, I think there's no doubt which method to use.