git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: "Sohn, Matthias" <matthias.sohn@sap.com>
Cc: Robin Rosenberg <robin.rosenberg@dewire.com>, git@vger.kernel.org
Subject: Re: [PATCH JGIT] Equals method should not assume anything about the type of its argument
Date: Wed, 29 Apr 2009 08:02:40 -0700	[thread overview]
Message-ID: <20090429150240.GB23604@spearce.org> (raw)
In-Reply-To: <366BBB1215D0AB4B8A153AF047A287800302A6F9@dewdfe18.wdf.sap.corp>

"Sohn, Matthias" <matthias.sohn@sap.com> wrote:
> The equals(Object o) method shouldn't make any assumptions about the type of o. It should simply return false if o is not the same type as this.

True.

Please line wrap your commit message at ~70 columns wide.
 
> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>

FWIW, your From header in the emails comes out "Sohn, Matthias"
while your Signed-off-By is as above.  This means that when I slam
your patch through git-am I get an author name of "Sohn, Matthias",
which looks damn funny.  I have to remember to edit the patch after
the fact to make it come out correct.

Any change you can get your MUA to behave better?  Or is this
Exchange enforcing a nice uniform standard... *sigh*

> diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java b/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
> index 2e3a43e..0bd2288 100644
> --- a/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
> +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
> @@ -253,7 +253,11 @@ public boolean equals(final AnyObjectId other) {
>  	}
>  
>  	public boolean equals(final Object o) {
> -		return equals((AnyObjectId) o);
> +		if (o instanceof AnyObjectId) {
> +			return equals((AnyObjectId) o);
> +		} else {
> +			return false;
> +		}
>  	}

Style nit: We avoid unnecessary braces around clauses.

-- 
Shawn.

  reply	other threads:[~2009-04-29 15:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-29 14:54 [PATCH JGIT] Equals method should not assume anything about the type of its argument Sohn, Matthias
2009-04-29 15:02 ` Shawn O. Pearce [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-04-29 21:47 Sohn, Matthias
2009-04-29 21:51 ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090429150240.GB23604@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=matthias.sohn@sap.com \
    --cc=robin.rosenberg@dewire.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).