[
https://issues.apache.org/jira/browse/LUCENE-8610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16723263#comment-16723263
]
Michael Gibney commented on LUCENE-8610:
----------------------------------------
"'Must' implies a requirement" – yes, that's definitely how I initially read
it. I guess any potential confusion would depend on how one reads the preceding
"To make sure that filters and consumers know which attributes are available":
1. if read as an _explanation_, then "must" implies a requirement
2. if read as a _condition_, then "must" is a qualified requirement (or
suggestion/warning)
Thanks for the clarification, and I'll see if I can take a stab at bringing
{{PreAnalyzedTokenizer}} into line with the requirement.
> NPE in TermsHashPerField.add() for TokenStreams with lazily instantiated
> token Attributes
> -----------------------------------------------------------------------------------------
>
> Key: LUCENE-8610
> URL: https://issues.apache.org/jira/browse/LUCENE-8610
> Project: Lucene - Core
> Issue Type: Wish
> Components: core/index
> Affects Versions: 7.4, master (8.0)
> Reporter: Michael Gibney
> Priority: Minor
> Attachments: LUCENE-8610.patch
>
>
> {{DefaultIndexingChain.invert(...)}} calls
> {{invertState.setAttributeSource(stream)}} before {{stream.incrementToken()}}
> is called.
> For instances of {{stream}} that lazily instantiate token attributes (e.g.,
> as {{solr.PreAnalyzedField$PreAnalyzedTokenizer}} does upon the first call to
> {{incrementToken()}} that returns {{true}}), this can result in caching a
> {{null}} value in {{invertState.termAttribute}} for a given {{stream}}
> instance.
> Subsequent calls that reuse the same {{stream}} instance (reusing
> {{TokenStreamComponents}}) for field values with at least 1 token will call
> {{termHashPerField.start(...)}} which sets {{termsHashPerField.termAtt}} from
> the {{null}} value cached in the {{FieldInvertState.termAttribute}}. An NPE
> would be thrown when {{termsHashPerField.add()}} reasonably but incorrectly
> assumes a non-null value for {{termAtt}}.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]