Add unchecked warnings failures for src#311
Merged
jimmyjames merged 2 commits intomasterfrom Nov 2, 2020
Merged
Conversation
lbalmaceda
approved these changes
Oct 30, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This is primarily a tech debt and future preparedness PR
APIExceptioncurrently performs an unsafe (in compiler terms) cast of the error description to aMap<String, Object>. Functionally, this shouldn't be an issue since aClassCastExceptionwould only come from a change in the error schema, which shouldn't happen.However, it does cause an unchecked cast warning, which we should typically not have or suppress as needed. This change does the following:
APIExceptionto only create aPasswordStrengthErrorParserif the error description is a map (currently it would fail with a runtime exception if not a string)Map<String, Object>obtainExceptionMessagebehavior in generalcompileJavaandcompileTestJava-Xlint:uncheckedcompiler flag for src (not for tests)Testing
Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.
Checklist