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

Enforce TokenStream impl / Analyzer finalness by an assertion

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      As noted in LUCENE-1753 and other issues, TokenStream and Analyzers are based on the decorator pattern. At least all TokenStream and Analyzer implementations in Lucene and Solr should be final.

      The attached patch adds an assertion to the ctors of both classes that does the corresponding checks:

      • Analyzers must be final or private classes or anonymous inner classes
      • TokenStreams must be final or private classes or anonymous inner classes or have a final incrementToken()

      I will commit this after robert have fixed solr streams.

        Issue Links

          Activity

          Hide
          gsingers Grant Ingersoll added a comment -

          Bulk close for 3.1

          Show
          gsingers Grant Ingersoll added a comment - Bulk close for 3.1
          Hide
          thetaphi Uwe Schindler added a comment -

          Committed revision: 932864

          Show
          thetaphi Uwe Schindler added a comment - Committed revision: 932864
          Hide
          thetaphi Uwe Schindler added a comment -

          Improved patch that also makes Analyzers with final (reusable)TokenStream() possible.

          Show
          thetaphi Uwe Schindler added a comment - Improved patch that also makes Analyzers with final (reusable)TokenStream() possible.
          Hide
          thetaphi Uwe Schindler added a comment -

          Patch.

          Show
          thetaphi Uwe Schindler added a comment - Patch.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development