Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 4.0-ALPHA
    • modules/analysis
    • None
    • New, Patch Available

    Description

      I needed CharArraySet.clear() for something I was working on in Solr in a tokenstream.

      instead I ended up using CharArrayMap<Boolean> because it supported .clear()

      it would be better to use a set though, currently it will throw UOE for .clear() because AbstractSet will call iterator.remove() which throws UOE.

      In Solr, the very similar CharArrayMap.clear() looks like this:

        @Override
        public void clear() {
          count = 0;
          Arrays.fill(keys,null);
          Arrays.fill(values,null);
        }
      

      I think we can do a similar thing as long as we throw UOE for the UnmodifiableCharArraySet

      will submit a patch later tonight (unless someone is bored and has nothing better to do)

      Attachments

        1. LUCENE-2179.patch
          2 kB
          Uwe Schindler

        Activity

          People

            uschindler Uwe Schindler
            rcmuir Robert Muir
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment