lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrien Grand (JIRA)" <>
Subject [jira] [Created] (LUCENE-6321) Make oal.index.Term more defensive
Date Mon, 02 Mar 2015 08:08:04 GMT
Adrien Grand created LUCENE-6321:

             Summary: Make oal.index.Term more defensive
                 Key: LUCENE-6321
             Project: Lucene - Core
          Issue Type: Bug
            Reporter: Adrien Grand
            Assignee: Adrien Grand
            Priority: Minor

oal.index.Term has a Term(String field, BytesRef termBytes) constructor. Even though it warns
that the term bytes should not be reused, I'm wondering that we should make it more defensive.

   * <p>WARNING: the provided BytesRef is not copied, but used directly.
   * Therefore the bytes should not be modified after construction, for
   * example, you should clone a copy by {@link BytesRef#deepCopyOf}
   * rather than pass reused bytes from a TermsEnum.

For example if you have term queries in your query cache and they are modified in-place, it
would have very bad consequences and would be hard to diagnose.

This message was sent by Atlassian JIRA

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

View raw message