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

CharArraySet cannot be made generic, because it violates the Set<char[]> interface

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.9
    • 3.0
    • None
    • None
    • New

    Description

      I tried to make CharArraySet using generics (extends AbstractSet<char[]>) but this is not possible, as it e.g. returns sometimes String instances in the Iterator instead of []. Also its addAll method accepts both String and char[]. I think this class is a complete mis-design and violates almost everything (sorry).

      What to do? Make it Set<?> or just place a big @SuppressWarnings("unchecked"> in front of it?

      Because of this problem also a lot of Set declarations inside StopAnalyzer cannot be made generic as you never know whats inside.

      Attachments

        1. LUCENE-1989.patch
          2 kB
          Uwe Schindler
        2. LUCENE-1989.patch
          3 kB
          Uwe Schindler

        Issue Links

          Activity

            People

              uschindler Uwe Schindler
              uschindler Uwe Schindler
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: