Skip to content

Remove useless XMLEntityException declaration in logout throws clause#337

Merged
pitbulk merged 1 commit into
SAML-Toolkits:masterfrom
mauromol:remove-xmlentityexception-declaration-from-logout
Apr 30, 2021
Merged

Remove useless XMLEntityException declaration in logout throws clause#337
pitbulk merged 1 commit into
SAML-Toolkits:masterfrom
mauromol:remove-xmlentityexception-declaration-from-logout

Conversation

@mauromol

Copy link
Copy Markdown
Contributor

This exception is indeed never thrown and it's a checked one, so it
makes using Auth.logout heavier then necessary. java-saml already has an
abundance of checked exceptions to handle, some of which could easily
be translated into unchecked ones or caught and recovered cleanly, this
is why I think that, if a useless exception declaration is found, it
should better be removed.
This indeed is a small source-incompatible change as soon as the
consumer code is catching XMLEntityException explicitly (rather than
SAMLException, Exception or Throwable). However, fixing this is trivial,
just remove XMLEntityException from the catch clause (which will never
be triggered anyway).

This exception is indeed never thrown and it's a checked one, so it
makes using Auth.logout heavier then necessary. java-saml already has an
abundance of checked exceptions to handle, some of which could easily
be translated into unchecked ones or caught and recovered cleanly, this
is why I think that, if a useless exception declaration is found, it
should better be removed.
This indeed is a small source-incompatible change as soon as the
consumer code is catching XMLEntityException explicitly (rather than
SAMLException, Exception or Throwable). However, fixing this is trivial,
just remove XMLEntityException from the catch clause (which will never
be triggered anyway).
@pitbulk pitbulk merged commit 6ee8841 into SAML-Toolkits:master Apr 30, 2021
@mauromol mauromol deleted the remove-xmlentityexception-declaration-from-logout branch May 5, 2021 13:09
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.

2 participants