On Thu, 21 Oct 2021 11:17:31 GMT, Pavel Rappo <pra...@openjdk.org> wrote:

>> This is a conceptually simple change to merge the "Exception" and "Error" 
>> classes into a single "Exception Class" group.
>> 
>> The only change that is not strictly related to the merge is the removal of 
>> unused type subsets and related methods in `TypeElementCatalog.java` and the 
>> use of `Collections.emptySortedSet()` as the default return value in the 
>> `allClasses` method (I made sure it is never modified).
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java
>  line 518:
> 
>> 516:         }
>> 517:         return typeUtils.isSubtype(te.asType(), getExceptionType())
>> 518:             || typeUtils.isSubtype(te.asType(), getErrorType());
> 
> Would it be clearer if we changed that to this?
> 
>     return typeUtils.isSubtype(te.asType(), getThrowableType();
> 
> Where `getThrowableType()` is defined as:
> 
>     public TypeMirror getThrowableType() {
>         return getSymbol("java.lang.Throwable");
>     }

You are right, Throwable is supposed to be included in exception classes. I 
just re-read the JLS quote from Alex in the JBS issue. I was fooled by the fact 
that Throwable is currently listed as an ordinary class in javadoc. 

I will update this PR soon.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6061

Reply via email to