From: Robin Rosenberg <robin.rosenberg@dewire.com>
To: Noel Grandin <noel@peralex.com>
Cc: Grzegorz Kulewski <kangur@polcom.net>,
spearce@spearce.org, git@vger.kernel.org
Subject: Re: [PATCH] Require JDK1.5
Date: Mon, 14 May 2007 19:24:34 +0200 [thread overview]
Message-ID: <200705141924.34490.robin.rosenberg@dewire.com> (raw)
In-Reply-To: <46480E02.1010500@peralex.com>
måndag 14 maj 2007 skrev Noel Grandin:
>
> >> diff --git
> >> a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectIdMap.java
> >> b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectIdMap.java
> >> index c397a0d..63796fd 100644
> >> --- a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectIdMap.java
> >> +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectIdMap.java
> >> @@ -50,9 +50,9 @@ public class ObjectIdMap implements Map {
> >>
> >> public ObjectIdMap(Map sample) {
> >> try {
> >> - Method m=sample.getClass().getMethod("clone", null);
> >> + Method m=sample.getClass().getMethod("clone",
> >> (Class[])null);
> >> for (int i=0; i<256; ++i) {
> >> - level0[i] = (Map)m.invoke(sample, null);
> >> + level0[i] = (Map)m.invoke(sample, (Object[])null);
> >> }
> >> } catch (IllegalAccessException e) {
> >> throw new IllegalArgumentException(e);
> >
> > I wonder why one would need changes like this?
> >
> > These casts are not needed for anything as far as I can see and your
> > IDE should easily tell you what type that parameter is. No?
> >
> Those are varargs parameters, so when compiling under 1.5 you sometimes
> have to tell the compiler the difference between passing a varargs array
> and passing one parameter.
The compiler does the right thing by default in this case, but I don't
like seeing warnings for code that is perfectly fine, hence the cast.
I noticed I dropped using this class just before sending the previous set
of patches, so it isn't really necessary in the current code, but I think I will start
using it soon so it can stay.
-- robin
next prev parent reply other threads:[~2007-05-14 17:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-13 23:39 This week in EGIT - more tags Robin Rosenberg
2007-05-13 23:39 ` [PATCH] Implement simple tags Robin Rosenberg
2007-05-13 23:39 ` [PATCH] Write refs when creating tags Robin Rosenberg
2007-05-13 23:39 ` [PATCH] Implement packed refs Robin Rosenberg
2007-05-13 23:39 ` [PATCH] Show tags in history view Robin Rosenberg
2007-05-14 22:45 ` [PATCH] Implement packed refs Shawn O. Pearce
2007-05-14 22:49 ` Robin Rosenberg
2007-05-13 23:48 ` The first patch in the series Robin Rosenberg
2007-05-13 23:48 ` [PATCH] Require JDK1.5 Robin Rosenberg
2007-05-14 1:07 ` Grzegorz Kulewski
2007-05-14 7:21 ` Noel Grandin
2007-05-14 17:24 ` Robin Rosenberg [this message]
2007-05-14 20:56 ` [PATCH] Set required execution enviroment Robin Rosenberg
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=200705141924.34490.robin.rosenberg@dewire.com \
--to=robin.rosenberg@dewire.com \
--cc=git@vger.kernel.org \
--cc=kangur@polcom.net \
--cc=noel@peralex.com \
--cc=spearce@spearce.org \
/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).