-
Notifications
You must be signed in to change notification settings - Fork 25.6k
FileAccessTree fixes for ordering and pruning #123291
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
Conversation
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
| for (int i = 1; i < paths.size(); ++i) { | ||
| String nextPath = paths.get(i); | ||
| if (nextPath.startsWith(currentPath) == false) { | ||
| if (isParent(currentPath, nextPath) == false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pruning fix.
| return path.toAbsolutePath().normalize().toString(); | ||
| String result = path.toAbsolutePath().normalize().toString(); | ||
| while (result.endsWith(FILE_SEPARATOR)) { | ||
| result = result.substring(0, result.length() - FILE_SEPARATOR.length()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix to strip trailing separators
jdconrad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* Custom comparator for paths in FileAccessTree * Strip trailing separators in normalizePath
* Custom comparator for paths in FileAccessTree * Strip trailing separators in normalizePath
.sorting before/normalizePath