On Mon, Jul 3, 2023 at 12:20 AM Gary Gregory <[email protected]> wrote:
>
> Hi Elliotte:
>
> Might you be looking at some old code in the PR?
>
Just looking at what was posted in the email thread. It's a weird
corner case not everyone thinks of.
> The current code is:
>
> /**
> * Checks if a throwable represents a checked exception
> *
> * @param throwable
> * The throwable to check.
> * @return True if the given Throwable is a checked exception.
> * @since 3.13.0
> */
> public static boolean isChecked(final Throwable throwable) {
> return throwable != null && !(throwable instanceof Error) &&
> !(throwable instanceof RuntimeException);
> }
This also looks wrong. This might work:
public static boolean isChecked(final Throwable throwable) {
return throwable != null && throwable instanceof Exception &&
!(throwable instanceof RuntimeException);
}
--
Elliotte Rusty Harold
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]