Skip to content

improves validation in unquote()#104

Merged
keith-turner merged 9 commits intoapache:mainfrom
keith-turner:unquote-validation
Mar 10, 2026
Merged

improves validation in unquote()#104
keith-turner merged 9 commits intoapache:mainfrom
keith-turner:unquote-validation

Conversation

@keith-turner
Copy link
Contributor

This PR adds test that do not currently pass. Opened as a follow on to #102 (comment)

@keith-turner keith-turner marked this pull request as ready for review March 10, 2026 21:57
throw new IllegalArgumentException("Unbalanced quotes : " + term);
}

term = len == 2 ? "" : AccessEvaluatorImpl.unescape(term.subSequence(1, len - 1));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In testing this, I wanted to see how AccessEvaluatorImpl.unescape handles quoted strings. It correctly fails (by the time it reaches this method, the outer quotes should be removed, and there should be no unescaped quotes in the string), but the error message is wrong. It says there is an illegal character after a slash, when I didn't provide any slashes in the string, just two quotes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed that error message and added a test for it in 15ddc4c

keith-turner and others added 2 commits March 10, 2026 15:41
…essExpressionImpl.java

Co-authored-by: Christopher Tubbs <ctubbsii@apache.org>
…cessEvaluatorTest.java

Co-authored-by: Christopher Tubbs <ctubbsii@apache.org>
Copy link
Member

@ctubbsii ctubbsii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good, but I'm still curious if we can improve the error messages, and maybe some other stuff in the unescape method.

@keith-turner keith-turner merged commit 5d7a944 into apache:main Mar 10, 2026
7 checks passed
@keith-turner keith-turner deleted the unquote-validation branch March 10, 2026 23:06
@ctubbsii ctubbsii added this to the 1.0.0 milestone Mar 11, 2026
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