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

2004-07-11 Thread Mark Wielaard
Hi, On Wed, 2004-07-07 at 05:21, Stephen Crawley wrote: 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

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

2004-07-07 Thread Chris Pickett
David Daney wrote: Stephen Crawley writes: 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. I agree.

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

2004-07-07 Thread Stephen Crawley
Hi, I wrote: 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

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

2004-07-07 Thread Andrew Haley
Bryce McKinlay writes: David Daney wrote: It doesn't seem like a good idea to use an unsuitable exception type just because its API has a slightly more elegant constructor. I do not believe that RuntimeException is unsuitable. It seems a better match than InternalError. Yes, I

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

2004-07-07 Thread Dalibor Topic
Bryce McKinlay wrote: Again, these exceptions should be documented as part of our API documentation. They are exceptions that should _never_ happen. No call from the application should cause them to be thrown, thus they are not part of the API. If they are ever thrown, then there is a bug in

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

2004-07-07 Thread Stephen Crawley
[EMAIL PROTECTED] said: Dalibor Topic wrote: Can't we just use assertions for things that should never happen? In this case I think its better not to, because assertions may be disabled in production builds. Ah ... but we could avoid that by explicitly throwing AssertionError. But my

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

2004-07-06 Thread David Daney
Bryce McKinlay wrote: Ranjit Mathew wrote: Mohan Embar wrote: Just out of curiosity, why is the result of new InternalError() being explicitly cast to an InternalError? Look closely - it's the return value (a Throwable) from initCause() that is being cast into an InternalError: +

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

2004-07-06 Thread David Daney
Bryce McKinlay wrote: David Daney wrote: I wonder if we should standardize on using RuntimeException in these cases. A quick grep through the source code shows that we use both InternalError and RuntimeException for these shouldn't/can't happen catch blocks in various cases. I think

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

2004-07-06 Thread Bryce McKinlay
David Daney wrote: We can't add constructors to InternalError, as that would violate the spec. Which spec. would that be? I am unfamiliar with it. David Daney. The Java 2(TM) Platform API specification[1] [1] http://java.sun.com/j2se/1.4.2/docs/api/ Regards Bryce

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

2004-07-06 Thread David Daney
Bryce McKinlay wrote: David Daney wrote: We can't add constructors to InternalError, as that would violate the spec. Which spec. would that be? I am unfamiliar with it. The Java 2(TM) Platform API specification[1] [1] http://java.sun.com/j2se/1.4.2/docs/api/ Does it say