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: David Daney
Subject: Re: Patch: merge File.toURI() from Classpath
Date: Tue, 06 Jul 2004 09:57:04 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031030

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 RuntimeException would be a 
>>>better choice, since it has a proper "cause" constructor for re-throwing 
>>>exceptions.
>>>
>>>   
>>>
>>
>>I don't like this idea.
>>
>>RuntimeException is meant to be the base class for Exceptions that can
>>reasonable be expected to be thrown from error free library code when
>>called by buggy application code.
>>
>>InternalError as its name suggests is meant to be thrown in situations
>>that could only be caused by a bug internal to the runtime.
>>
>>If don't like the idiom new InternalError().initCause(), then add a
>>constructor to InternalError (and perhaps Error also) so that you can
>>pass the cause as a constructor parameter.
>> 
>>
> 
> 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.





reply via email to

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