Hmm... Suppressed Exceptions are Throwables[]

Paul Benedict pbenedict at apache.org
Fri Oct 1 06:44:36 PDT 2010


Thanks Joe and Osvaldo for your feedback. I like getSuppressed() too.

On Thu, Sep 30, 2010 at 11:31 PM, Joe Darcy <joe.darcy at oracle.com> wrote:
> Osvaldo Pinali Doederlein wrote:
>>   My $0.02:  getSupressed().
>>
>
> Hopefully the method name would not be misinterpreted as a command!
>
>> - It's sufficiently clear (from both the context of the containing class
>> and the return static type), so this is terse without being obscure;
>> - There is a BIG precedent: we already have getCause(), not
>> getCauseException() or getCauseThrowable().
>>
>
> Good point; I'll consider this renaming.
>
> Thanks,
>
> -Joe
>
>> A+
>> Osvaldo
>>
>> On 30/09/2010 14:12, Mike Clark wrote:
>>
>>> Re: "cause" instead of "suppressed"
>>> To me it is fairly obvious that suppressed exceptions are not causes,
>>> secondary or otherwise.  Thus I would vote against any use of the term
>>> "cause" in relationship to suppressed exceptions.
>>>
>>> Re: "Exception" vs "Throwable":
>>> The Java exception class hierarchy and naming has always been ever so
>>> slightly awkward.  In conversation, when I talk about exceptions in a
>>> _general_ sense, I mean anything that can be thrown.  Thus when I
>>> speak of Java exceptions in the general sense, I am usually talking
>>> about Throwable and its subclasses.
>>>
>>> This follows with the Java Language Specification where you will find
>>> the specification of java.lang.Throwable under the prominent chapter
>>> title "Exceptions."  So, you might say that while java.lang.Exception
>>> is subordinate to java.lang.Throwable, java.lang.Throwable is itself
>>> subordinate to the Java language feature "exceptions."  And so it
>>> could be argued that the "Exceptions" term in
>>> "getSuppressedExceptions" actually refers to the exceptions language
>>> feature, not java.lang.Exception.
>>>
>>> I am also familiar with (and myself use, where appropriate) the
>>> convention of keeping a method's name in sync with the type name of
>>> its return value.  Under this convention, the method would be better
>>> named "getSuppressedThrowables."
>>>
>>> However, I think the current naming ("getSuppressedExceptions") is
>>> understandable and justifiable under the perspective of "exceptions
>>> are a language feature" (e.g. JLS.)
>>>
>>> So for me, I'm happy either way.
>>>
>>> my 2 cents,
>>>
>>> Mike
>>>
>>>
>>
>>
>>
>
>
>



More information about the coin-dev mailing list