This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: merge File.toURI() from Classpath
- From: Stephen Crawley <crawley at dstc dot edu dot au>
- To: Chris Pickett <chris dot pickett at mail dot mcgill dot ca>
- Cc: Bryce McKinlay <mckinlay at redhat dot com>, David Daney <ddaney at avtrex dot com>, cbj at gnu dot org, Ranjit Mathew <rmathew at gmail dot com>, java-patches at gcc dot gnu dot org, gnustuff at thisiscool dot com, classpath at gnu dot org, crawley at piglet dot dstc dot edu dot au
- Date: Wed, 07 Jul 2004 13:21:42 +1000
- Subject: Re: Patch: merge File.toURI() from Classpath
For the record, grep tells me that Sun's JDK 1.4.2 class libraries
throws InternalError in 145 places. Notwithstanding the wording of the
InternalError javadoc, Sun uses it extensively for library errors. In a
couple of cases, the comments that indicated that the developer thought
that InternalError was the wrong exception ... but used it anyway.
On the other hand, grep tells me that JDK 1.4.2 throws RuntimeException
in 157 places.
In the light of this confusion, I think that:
1) It is appropriate for Classpath to throw InternalError if there
is no chance that the application can recover.
2) The Sun javadoc (which describes InternalError as "thrown to
indicate some unexpected internal error has occurred in the
Java Virtual Machine") is incorrect.
I'm going to submit a Sun bug report against the InternalError javadoc.
It will suggest that either they change the javadoc wording to match
current practice, or they define a new xxxError exception to be thrown
for library internal errors.
I'm also going to submit a bug report about the JDK's widespread abuse
of RuntimeException. IMO, they should either throw InternalError (or
its replacement) or they should define some appropriate subtypes of
RuntimeException and throw those.
-- Steve