-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LANG-1647 - Check if an throwable is a checked exception #729
Conversation
src/changes/changes.xml
Outdated
@@ -100,6 +100,7 @@ The <action> type attribute can be add,update,fix,remove. | |||
<action type="add" dev="jochen">Introduce the use of @Nonnull, and @Nullable, and the Objects class as a helper tool.</action> | |||
<action type="add" dev="ggregory" due-to="Arturo Bernal, Gary Gregory">Add and use true and false String constants #714.</action> | |||
<action type="add" dev="ggregory" due-to="Arturo Bernal, Gary Gregory">Add and use ObjectUtils.requireNonEmpty() #716.</action> | |||
<action issue="LANG-1647" type="add" dev="abernal" due-to="">Check if an throwable is a checked exception.</action> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in the wrong place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true. thanks. @aherbert
* @see java.lang.Error | ||
* @since 3.12.1 | ||
*/ | ||
public static boolean isCheckedException(final Throwable throwable) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API name is misleading since it takes more than Exception as input.
Going further, I think the type name in the method name is redundant and calling the API 'isChecked' should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
* @see java.lang.Exception | ||
* @see java.lang.RuntimeException | ||
* @see java.lang.Error | ||
* @since 3.12.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a new API is not a maintenance version change per semantic versioning guidelines, the version should be the next minor one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @garydgregory
Changed
The idea it's have a function that check if a given throwable is a checked exception. There are some similar function in ConcurrentUtils, but have package visibility and return the same exception.
Seem logic have this verification in the class that have this responsibility -
ExceptionUtils