Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [handly-dev] bad comment for ISnapshot.isEqualTo

Thanks Vlad! I missed that, now I see.
 
I agree with you that the comment for Snapshot#isEqualTo may be misleading.
Actually, this is one case where I would prefer no (additional) comment.
The method contract is specified in ISnapshot, and the method implementation
is final and literally is in the code. In this case the Javadoc for #predictEquality
should suffice IMO.
 
Best regards,
Vladimir
 
 
Hi!

Well, then the documentation for Snapshot.isEqualTo is misleading, as it says

     * <li><code>Snapshot</code>s which have expired are not equal 
     *  to all other snapshots

[I think "to _any_ other snapshots" would be a bit clearer]

regards,
Vlad


On Tue, Feb 24, 2015 at 8:13 AM, Vladimir Piskarev <pisv@xxxxx> wrote:
Hi Vlad,
 
Thanks for the notice, but... sorry, I cannot see a contradiction.
 
In fact, DocumentSnapshots can be equal even if they are expired,
in case both of them correspond to the same document and the same
modificationStamp (see #predictEquality).
 
The contract says what it says to allow flexibility in implementations.
Best regards,
Vladimir
 
The comment in ISnapshot says 

     * Returns whether the two snapshots are equal. If the snapshots are equal 
     * they have equal contents (or had had equal contents before one or both 
     * of them have expired). However, the converse is not necessarily true.

Which is wrong according to the implementation (and its comment): snapshots can be equal only if none of them is expired.

regards,
Vlad


_______________________________________________
handly-dev mailing list
handly-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/handly-dev


Back to the top