Skip to content

refactor: improve error messages of loadDirectory and refactor #399

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

Merged
merged 1 commit into from
Apr 17, 2025

Conversation

katrinafyi
Copy link
Member

the biggest change is to use the java.nio.file.Path abstraction (https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html) instead of manually manipulating slashes. this should make it more robust on different platforms, and more reasonable in the face of paths which contain semantically equivalent but syntactically different paths (e.g., multiple slashes in a row // or . path components).

it also improves readability by using methods with path-specific names instead of manipulating lists and strings. some other changes to add more comments and use more functional programming.

in most cases, the new behaviour should be equivalent to the old one. in cases with elements like // or ., the behaviour should be more reasonable - now, it correctly treats those as insignificant.

the biggest change is to use the java.nio.file.Path abstraction
(https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html)
instead of manually manipulating slashes. this should make it more
robust on different platforms, and more reasonable in the face of
paths which contain semantically equivalent but syntactically different
paths (e.g., multiple slashes in a row `//` or `.` path components).

it also improves readability by using methods with path-specific names
instead of manipulating lists and strings. some other changes to add
more comments and use more functional programming.
@ailrst ailrst merged commit b1d9cd6 into main Apr 17, 2025
6 checks passed
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