Lucene - Core
  1. Lucene - Core
  2. LUCENE-2389

Enforce TokenStream impl / Analyzer finalness by an assertion

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major 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

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development