Exception handling and build improvements#119
Merged
Conversation
Exception handling improvements: * Use InvalidAuthorizationException instead of raw IllegalArgumentException where it makes sense, especially to follow the javadoc that says that it will be thrown when parsing an invalid authorization inside an access expression * Inline quote/unquote methods from AccessEvaluatorImpl to th eonly place they are called in AccessImpl, so they can be simplified without redundant checks for empty strings * Move (un)escape methods from AccessEvaluatorImpl to CharUtils, since they are not used in AccessEvaluatorImpl after the quote/unquote methods were inlined Build improvements: * Add junit-jupiter-engine explicitly to the classpath for tests (required to run tests in IDE; surefire on the command-line adds it automatically, so it's only needed for running tests in the IDE) * Relocate tests and generated files into standard directories * Put common test loader code in separate module, removing unneeded spotbugs suppressions and redundant test code
dlmarion
reviewed
Mar 17, 2026
Comment on lines
-224
to
-226
| // test with an input that is not a string | ||
| CharSequence charSeq = CharBuffer.wrap(illegalInput); | ||
| e = assertThrows(IllegalArgumentException.class, () -> AccessExpressionImpl.unquote(charSeq), |
Contributor
There was a problem hiding this comment.
Is there a reason this was removed?
Member
Author
There was a problem hiding this comment.
Yes. The method was inline'd into AccessImpl.unquote, and that public API method can only take a String type. So, testing this code with non-String types is neither necessary nor possible.
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.
Exception handling improvements:
Build improvements: