Conversation
Contributor
|
Hi, This method is very security sensitive. I do not see immediate performance gains for normal inputs here, at least the ones that are worth the risk of changing this method. |
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.
Summary
WebUtils.normalize()currently removes one occurrence of//or/./per iteration. Each iteration creates a new string and scans the path again.This change replaces all non-overlapping occurrences in each pass and repeats only while the pattern remains. It preserves the normalization order and returned paths while reducing repeated intermediate string copying for paths with repeated separators or current-directory segments.
For example:
Scope
nullhandling, and/../behavior unchanged./../loop is outside this change.Tests
////////->/and/./././x->/x../mvnw -pl web -am -Dtest=WebUtilsTest -Dsurefire.failIfNoSpecifiedTests=false test(WebUtilsTest: 7 tests, 0 failures, 0 errors)../mvnw verifyreached the Jakarta EE browser integration tests. On the local macOS environment, Arquillian Drone timed out while creating a Firefox WebDriver session. This occurs outside the changed code and files.Checklist
mvn verifydid not complete because of the local Firefox WebDriver environment.