lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Smiley (JIRA)" <>
Subject [jira] [Updated] (LUCENE-6976) BytesTermAttributeImpl.copyTo NPEs when the BytesRef is null
Date Thu, 14 Jan 2016 07:07:39 GMT


David Smiley updated LUCENE-6976:
    Attachment: LUCENE_6976.patch

See patch with fix and 2 tests (one from SOLR-8541 which is basically this same issue but
the cause was not known at the time the bug was reported).  

Anyone have an opinion if BytesRef.deepCopyOf should handle null?

> BytesTermAttributeImpl.copyTo NPEs when the BytesRef is null
> ------------------------------------------------------------
>                 Key: LUCENE-6976
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: David Smiley
>            Assignee: David Smiley
>            Priority: Minor
>         Attachments: LUCENE_6976.patch
> The BytesTermAttributeImpl class, not used much I think, has a problem in its copyTo
method in which it assumes "bytes" isn't null since it calls BytesRef.deepCopyOf on it.  Perhaps
deepCopyOf should support null?  And also, toString(), equals() and hashCode() aren't implemented
but we can do so.
> This was discovered in SOLR-8541; the spatial PrefixTreeStrategy uses this attribute
and the CachingTokenFilter when used on the analysis chain will call clearAttributes() in
it's end() method and then capture the state so it can be replayed later.  BytesTermAttributeImpl.clear()
nulls out the bytes reference.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message