Lucene - Core
  1. Lucene - Core
  2. LUCENE-1857

Change NumericRangeQuery to generics (for the numeric type)

    Details

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

      Description

      NumericRangeQuery/Filter can use generics for more type-safety: NumericRangeQuery<T extends Number>

      1. LUCENE-1857.patch
        22 kB
        Uwe Schindler
      2. LUCENE-1857.patch
        50 kB
        Uwe Schindler

        Issue Links

          Activity

          Uwe Schindler created issue -
          Uwe Schindler made changes -
          Field Original Value New Value
          Priority Major [ 3 ] Minor [ 4 ]
          Hide
          Uwe Schindler added a comment -

          Patch that adds generics:
          After thinking about it the whole night: The "static ctors" cannot be removed, because even with generics there is not type safety. The private ctor needs the valSize information, to choose the right term encoding. This could theoretically be determined by instanceof checks, but would not work, if you use null for both upper and lower bounds.
          This generified version is easier to handle, because it returns the correct type when calling getMin()/getMax(). It also uses generics for its collections api usage.

          Show
          Uwe Schindler added a comment - Patch that adds generics: After thinking about it the whole night: The "static ctors" cannot be removed, because even with generics there is not type safety. The private ctor needs the valSize information, to choose the right term encoding. This could theoretically be determined by instanceof checks, but would not work, if you use null for both upper and lower bounds. This generified version is easier to handle, because it returns the correct type when calling getMin()/getMax(). It also uses generics for its collections api usage.
          Uwe Schindler made changes -
          Attachment LUCENE-1857.patch [ 12421000 ]
          Hide
          Uwe Schindler added a comment -

          Updated patch with tests generified and also using autoboxing in javadocs and test code.

          Show
          Uwe Schindler added a comment - Updated patch with tests generified and also using autoboxing in javadocs and test code.
          Uwe Schindler made changes -
          Attachment LUCENE-1857.patch [ 12421016 ]
          Uwe Schindler made changes -
          Link This issue is related to LUCENE-1257 [ LUCENE-1257 ]
          Hide
          Uwe Schindler added a comment -

          Added CHANGES.txt an committed revision: 820792

          Show
          Uwe Schindler added a comment - Added CHANGES.txt an committed revision: 820792
          Uwe Schindler made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          uschindler committed 820795 (1 file)
          Uwe Schindler made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Mark Thomas made changes -
          Workflow jira [ 12474129 ] Default workflow, editable Closed status [ 12563116 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12563116 ] jira [ 12584186 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development