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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 4.0-ALPHA
    • core/search
    • None
    • 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

            uschindler Uwe Schindler
            uschindler Uwe Schindler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: