git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Require JDK1.5

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
May 14, 2007, 17:24 UTC
Message-ID
<200705141924.34490.robin.rosenberg@dewire.com>
In-Reply-To
<46480E02.1010500@peralex.com>
måndag 14 maj 2007 skrev Noel Grandin:
Show 29 quoted lines
> 
> >> 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
Previous: Noel GrandinNext: Robin Rosenberg
Message 12 of 13 in “This week in EGIT - more tags”
  1. Robin RosenbergMay 13, 2007
  2. Implement simple tagsRobin Rosenberg, May 13, 2007
  3. Write refs when creating tagsRobin Rosenberg, May 13, 2007
  4. Implement packed refsRobin Rosenberg, May 13, 2007
  5. Show tags in history viewRobin Rosenberg, May 13, 2007
  6. Shawn O. PearceMay 14, 2007
  7. Robin RosenbergMay 14, 2007
  8. The first patch in the seriesRobin Rosenberg, May 13, 2007
  9. Require JDK1.5Robin Rosenberg, May 13, 2007
  10. Grzegorz KulewskiMay 14, 2007
  11. Noel GrandinMay 14, 2007
  12. Robin RosenbergMay 14, 2007
  13. Set required execution enviromentRobin Rosenberg, May 14, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.