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

Changing Exception Types Being Thrown #397

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

syoon2
Copy link
Contributor

@syoon2 syoon2 commented Aug 14, 2023

This PR changes the types of exceptions being thrown by the methods. More specifically, this PR:

  • Replaces uses of java.lang.Exception (way too broad) with more appropriate subclasses of it
  • Replaces uses of java.lang.RuntimeException with more appropriate subclasses of it
  • Replaces uses of java.lang.IllegalArgumentException for invalid null arguments with java.lang.NullPointerException (mostly via java.util.Objects.requireNonNull(Object))

    Applications should throw instances of this class to indicate other illegal uses of the null object.
    Java 11 API: java.lang.NullPointerException

  • Replaces uses of java.lang.IllegalArgumentException for invalid index with java.lang.IndexOutOfBoundsException
  • Etc.

@syoon2 syoon2 marked this pull request as ready for review August 16, 2023 02:47
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.

None yet

1 participant