Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6321

Make oal.index.Term more defensive

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • None
    • None
    • New

    Description

      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.

      Attachments

        1. LUCENE-6321.patch
          23 kB
          Adrien Grand
        2. LUCENE-6321.patch
          22 kB
          Adrien Grand

        Issue Links

          Activity

            People

              jpountz Adrien Grand
              jpountz Adrien Grand
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: