Lucene - Core
  1. Lucene - Core
  2. LUCENE-2258

Remove "synchonized" from FuzzyTermEnum#similarity(final String target)

    Details

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

      Description

      The similarity method in FuzzyTermEnum is synchronized which is stupid because of:

      • TermEnums are the iterator pattern and so are single-thread per definition
      • The method is private, so nobody could ever create a fake FuzzyTermEnum just to have this method and use it multithreaded.
      • The method is not static and has no static fields - so instances do not affect each other

      The root of this comes from LUCENE-296, but was never reviewd and simply committed. The argument for making it synchronized is wrong.

      1. LUCENE-2258.patch
        0.7 kB
        Uwe Schindler

        Activity

        Hide
        Uwe Schindler added a comment -

        Patch.

        Show
        Uwe Schindler added a comment - Patch.
        Hide
        Uwe Schindler added a comment -

        Committed trunk revision: 908477
        Committed 3.0 revision: 908479
        Committed 2.9 revision: 908481

        Show
        Uwe Schindler added a comment - Committed trunk revision: 908477 Committed 3.0 revision: 908479 Committed 2.9 revision: 908481

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development