Hmm... Suppressed Exceptions are Throwables[]

Mike Clark mclark at apache.org
Thu Sep 30 10:12:20 PDT 2010


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