Lucene - Core
  1. Lucene - Core
  2. LUCENE-2103

NoLockFactory should have a private constructor

    Details

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

      Description

      NoLockFactory documents in its javadocs that one should use the static getNoLockFactory() method. However the class does not declare a private empty constructor, which breaks its Singleton purpose. We cannot add the empty private constructor because that'd break break-compat (even though I think it's very low chance someone actually instantiates the class), therefore we'll add a @deprecated warning to the class about this, and add the method in 4.0. I personally prefer to add an empty constructor w/ the @deprecated method, but am fine either way.

      Don't know if a patch is needed, as this is a trivial change.

      1. LUCENE-2103.patch
        1 kB
        Uwe Schindler
      2. LUCENE-2103.patch
        0.8 kB
        Uwe Schindler

        Activity

        Hide
        Uwe Schindler added a comment -

        Attached is the patch with javadocs and deprecation.

        Will commit in a day.

        Show
        Uwe Schindler added a comment - Attached is the patch with javadocs and deprecation. Will commit in a day.
        Hide
        Uwe Schindler added a comment -

        New patch with CHANGES.txt, thanks Shai!

        Show
        Uwe Schindler added a comment - New patch with CHANGES.txt, thanks Shai!
        Hide
        Uwe Schindler added a comment -

        One addition: In my opinion, this class should be final. With the private ctor it gets automatically final (you cannot extend without ctor), but should we change this for now, too? This would be a (small) BW break.

        Show
        Uwe Schindler added a comment - One addition: In my opinion, this class should be final. With the private ctor it gets automatically final (you cannot extend without ctor), but should we change this for now, too? This would be a (small) BW break.
        Hide
        Shai Erera added a comment -

        if we're breaking BW, why not add the private ctor? I'm sure that when 3.1 will be out, that won't be the only BW . Anyway, this is not a serious BW. If somebody relies on the ctor, then that somebody may also rely on the class not being final.

        Show
        Shai Erera added a comment - if we're breaking BW, why not add the private ctor? I'm sure that when 3.1 will be out, that won't be the only BW . Anyway, this is not a serious BW. If somebody relies on the ctor, then that somebody may also rely on the class not being final.
        Hide
        Uwe Schindler added a comment -

        I think I keep this open for a moment, maybe others also have a comment about that.

        I would also like to make it final and private (also the package private inner class).

        Show
        Uwe Schindler added a comment - I think I keep this open for a moment, maybe others also have a comment about that. I would also like to make it final and private (also the package private inner class).
        Hide
        Uwe Schindler added a comment -

        Committed revision: 887995. Thanks Shai!

        Show
        Uwe Schindler added a comment - Committed revision: 887995. Thanks Shai!

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development