Skip to content
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

Fix #1758: Accept a non-directory file in Files.walk() #1838

Merged

Conversation

WojciechMazur
Copy link
Contributor

Resolves #1758 bug.
In cases when Files.walk was used with path directing to file instead of directory second element of stream resulted in throwing exceptions.
Also extracted conversion between FileVisitOption[] -> LinkOption[] used in several places.

@WojciechMazur WojciechMazur changed the title Bugfix/1758 files.walk on file Fix #1758 Files.walk on file Jul 8, 2020
Copy link
Collaborator

@sjrd sjrd left a comment

Choose a reason for hiding this comment

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

Great, thank you :)

I only have formatting nitpicks.

javalib/src/main/scala/java/nio/file/Files.scala Outdated Show resolved Hide resolved
javalib/src/main/scala/java/nio/file/Files.scala Outdated Show resolved Hide resolved
@sjrd sjrd changed the title Fix #1758 Files.walk on file Fix #1758: Accept a non-directory file in Files.walk() Jul 8, 2020
@WojciechMazur WojciechMazur requested a review from sjrd July 8, 2020 12:12
@sjrd sjrd merged commit 091fc92 into scala-native:master Jul 8, 2020
@WojciechMazur WojciechMazur deleted the bugfix/1758-Files.walk_on_file branch August 18, 2020 08:22
ekrich pushed a commit to ekrich/scala-native that referenced this pull request May 21, 2021
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.

java.nio.file.Files.walk should not fail when called on a file.
2 participants