Lucene - Core
  1. Lucene - Core
  2. LUCENE-2057

TopDocsCollector should have bounded generic <T extends ScoreDoc>

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      TopDocsCollector was changed to be TopDocsCollector<T>. However it has methods which specifically assume the PQ stores ScoreDoc. Therefore, if someone extends it and defines a type which is not ScoreDoc, things will break.

      We shouldn't put <T> on TopDocsCollector at all, but rather change its ctor to protected TopDocsCollector(PriorityQueue<? extends ScoreDoc> pq). TopDocsCollector should handle ScoreDoc types. If we do this, we'll need to change FieldValueHitQueue's Entry to extend ScoreDoc as well.

      1. scoredoc.patch
        6 kB
        Uwe Schindler

        Activity

        Shai Erera created issue -
        Uwe Schindler made changes -
        Field Original Value New Value
        Attachment scoredoc.patch [ 12424637 ]
        Uwe Schindler made changes -
        Summary TopDocsCollector should not be declared with generic <T> TopDocsCollector should have bounded generic <T extends ScoreDoc>
        Uwe Schindler made changes -
        Assignee Uwe Schindler [ thetaphi ]
        Uwe Schindler made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Uwe Schindler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Workflow jira [ 12481796 ] Default workflow, editable Closed status [ 12563371 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12563371 ] jira [ 12584514 ]

          People

          • Assignee:
            Uwe Schindler
            Reporter:
            Shai Erera
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development