Re: [EGIT PATCH] Fixed trivial warnings. Mainly parametrized raw types, added serialVersionUID, removed unnecessery throws.
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Jan 5, 2009, 02:19 UTC
- Message-ID
- <20090105021959.GB20973@spearce.org>
- In-Reply-To
- <gjrgip$al9$1@ger.gmane.org>
Vasyl' Vavrychuk <vvavrychuk@gmail.com> wrote:
Show 6 quoted lines
> Not sure what is right:
> public abstract class AnyObjectId implements Comparable<ObjectId> {
> or
> public abstract class AnyObjectId implements Comparable<AnyObjectId> {
>
> IMHO second, but class AnyObjectId contains some compareTo(ObjectId).Hmmph. That probably can be AnyObjectId. At one point we only had ObjectId, then AnyObjectId was introduced as a base so we can have the immutable AnyObjectId and the mutable MutableObjectId subclasses.
compareTo doesn't care about the mutable state of its argument, this is probably left-over code that didn't get converted when we added the AnyObjectId base class.
So it should be the second, and the compareTo method should be made to match that.
-- Shawn.