Skip to content

DatabaseUtils: Revise getInt() to return Integer.MIN_VALUE #13

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

Closed
sbabcoc opened this issue Apr 20, 2019 · 1 comment
Closed

DatabaseUtils: Revise getInt() to return Integer.MIN_VALUE #13

sbabcoc opened this issue Apr 20, 2019 · 1 comment

Comments

@sbabcoc
Copy link
Owner

sbabcoc commented Apr 20, 2019

Currently, the getInt() method returns -1 if no records were found, This is potentially a valid value. This should probably return something like Integer.MIN_VALUE instead.

@sbabcoc
Copy link
Owner Author

sbabcoc commented Sep 5, 2020

Upon further consideration, this should probably throw an IllegalStateException, as this should be considered an exceptional result. Same holds true for the getString() methods. Returning null isn't terribly informative, and potentially harmful to the client (i.e. - NullPointerException).

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

No branches or pull requests

1 participant