This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: minor error reporting patch
- To: David Brownell <david-b at pacbell dot net>
- Subject: Re: minor error reporting patch
- From: Tom Tromey <tromey at redhat dot com>
- Date: 25 Jun 2001 21:45:19 -0600
- Cc: java at gcc dot gnu dot org, Java Patch List <java-patches at gcc dot gnu dot org>
- References: <00ea01c0fdb4$c47f6dc0$6800000a@brownell.org>
- Reply-To: tromey at redhat dot com
>>>>> "David" == David Brownell <david-b@pacbell.net> writes:
David> Running that API test suite, I noticed that file open errors
David> gave a different exception string. That shouldn't be a
David> big deal, except that since Java doesn't really provide good
David> ways to distinguish many errors except by such strings,
David> programs often end up needing to compare them.
This is not really something I like to do, since it means we're
indirectly supporting bad programming habits. However this particular
patch is pretty innocuous, and it is hard to argue against it, so I am
going to check it in.
There are certain kinds of bug compatibility changes we probably ought
to reject. We can do that on a case-by-case basis though.
David> --- natFdOrig.cc Mon Jun 25 11:14:44 2001
David> +++ natFileDescriptorPosix.cc Mon Jun 25 11:15:17 2001
David> @@ -111,7 +111,7 @@
David> if (fd == -1)
David> {
David> char msg[MAXPATHLEN + 200];
David> - sprintf (msg, "%s: %s", buf, strerror (errno));
David> + sprintf (msg, "%s (%s)", buf, strerror (errno));
David> JvThrow (new FileNotFoundException (JvNewStringLatin1 (msg)));
David> }
David> return fd;
Thanks,
Tom