ok, since both of you say Dir + version, I'll go with your proposal :).

I can make all its methods abstract - have a hard time believing IndexCommit
is extended outside Lucene. Also, if someone extended it and didn't override
one of these methods, UOE would have hit him already?

Shai

On Wed, Apr 28, 2010 at 3:40 PM, Michael McCandless <
[email protected]> wrote:

> Good catch!  We should make both hashCode & equals consistent.
>
> I think Dir + version is best?
>
> In theory Dir + segFileName should be equally good, since segFileName
> <-> version is one-to-one/onto, but I think conceptually version is
> the better "identifier" of change.
>
> We really should make getVersion abstract w/ 3.0 -- all core ICs impl it.
>
> Mike
>
> On Wed, Apr 28, 2010 at 8:21 AM, Shai Erera <[email protected]> wrote:
> > Hi
> >
> > According to Java's hashCode jdoc, if two objects answer true to
> > o1.equals(o2), then o1.hashCode() == o2.hashCode(). However, IC uses Dir
> +
> > segmentFileName in hashCode() and Dir + version in equals(). More so, the
> > jdoc of equals specifies that two IC equals if their Dirs are equals and
> the
> > have the same version.
> >
> > I think this should be fixed?
> >
> > But what is the right criteria: Dir + version  || Dir + segFileName ||
> Dir +
> > version + segFileName?
> >
> > Shai
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to