classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch: merge File.toURI() from Classpath


From: Stephen Crawley
Subject: Re: Patch: merge File.toURI() from Classpath
Date: Wed, 07 Jul 2004 13:21:42 +1000

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








reply via email to

[Prev in Thread] Current Thread [Next in Thread]