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

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

    Details

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

        Attachments

        1. LUCENE-2258.patch
          0.7 kB
          Uwe Schindler

          Activity

            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: