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
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.
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
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
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
[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
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:
+
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
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
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
10 matches
Mail list logo