Skip to content
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

Closed
wants to merge 1 commit into from
Closed

LANG-1647 - Check if an throwable is a checked exception #729

wants to merge 1 commit into from

Conversation

arturobernalg
Copy link
Member

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

@coveralls
Copy link

coveralls commented Mar 5, 2021

Coverage Status

Coverage increased (+0.007%) to 94.936% when pulling 73f2b73 on arturobernalg:feature/LANG-1647 into 6b9964f on apache:master.

@@ -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>
Copy link
Contributor

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

Copy link
Member Author

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) {
Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @garydgregory
Changed

@arturobernalg arturobernalg closed this by deleting the head repository Jun 22, 2023
@aherbert aherbert mentioned this pull request Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants