cbuescher opened a new pull request, #16983:
URL: https://github.com/apache/lucene/pull/16983
`Builder#withFlags` stores the given flags in the highlighter builder, but
they are never used.
`evaluateFlags(Builder)` only checks the highlighter's own flags field,
which is still null while
the constructor runs, and then derives the flags from the four boolean
options alone.
Those booleans are separate builder fields that withFlags does not update,
so they never reflect
what withFlags was called with.
Now, instead, evaluateFlags(Builder) reads the builder's flags and passes
them through the
existing `evaluateFlags` method, so they get the same consistency checks as
the other boolean
options (e.g. WEIGHT_MATCHES is only kept if the other three flags are
present).
It also no longer assigns the highlighter's `flags` field itself, since the
constructor already does that.
The withFlags javadoc now describes this, and two new tests cover it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]