So you believe someone actually does "new NoLockFactory()"? If so, we should
add the ctor as deprecated, because currently it does not exist, and thus
cannot be deprecated :).

Of course, adding a deprecated empty ctor needs to be accompanied by proper
documentation to move it to private, or else it will be deleted, and we'll
have this thread again after 4.0 :).

Shai

On Wed, Dec 2, 2009 at 2:57 PM, Uwe Schindler <u...@thetaphi.de> wrote:

>  I have seen this several times when working on oal.store. We should have
> deprecated the ctor in 2.9 and removed in 3.0. For BW compatibility we have
> to simply deprecate it and tell the user to take the singleton.
>
>
>
> Uwe
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: u...@thetaphi.de
>   ------------------------------
>
> *From:* Shai Erera [mailto:ser...@gmail.com]
> *Sent:* Wednesday, December 02, 2009 1:11 PM
> *To:* java-dev@lucene.apache.org
> *Subject:* NoLockFactory does not have a private ctor
>
>
>
> NoLockFactory documents in its javadocs that one should call the static
> getNoLockFactory() in order to create an instance. The class however does
> not have a private ctor, so someone can create another instance of it. This
> is not a big deal though, because makeLock returns a static member. But it
> looks like this class should follow the singleton pattern, however doesn't.
>
> Looks an easy fix to me. Can someone commit it, or do we need an issue?
>
> Shai
>

Reply via email to