Skip to content

fix[javalib]: Corrections & improvements to Files#find, Files#walk, & Files#walkFileTree methods #3967

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

LeeTibbert
Copy link
Contributor

Fix #3744 Fix #3890

This PR introduces a number of improvements to javalib Files#find, Files#walk, and Files#walkFileTree methods.

  • walkFileTree now detects & reports FileSystemLoopException

  • find should do half the number of attribute lookups. This should increase execution speed.

  • All three methods have been refactored to use common code. This should increase both consistency
    and execution speed.

A concerted effort was made to report IOException and UncheckedIOException in the same conditions
as JVM does. They may still be lingering issues where one of those exceptions is reported by Scala Native
when JVM reports the other.

This code passes the Scala Native unit-tests.

It also passes more extensive semi-automated private tests.

@LeeTibbert LeeTibbert marked this pull request as draft June 17, 2024 11:06
@LeeTibbert
Copy link
Contributor Author

I am moving this to "draft" whilst I investigate the unit-test failures.

One is a Windows JDK compliance which can be factored out as "usual j-random Windows failure"

The rest are all in the same test, which passes on macOS & windows. From examining the code for that
Test, I believe that it makes an unwarranted assumption about the order in which entries are returned by the file system.

I believe the underlying code is correct and can be reviewed.

@LeeTibbert LeeTibbert marked this pull request as ready for review June 18, 2024 10:45
@WojciechMazur WojciechMazur merged commit a965710 into scala-native:main Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

javalib Files#walkFileTree method has mutiple opportunities for improvement Files.walkFileTree does not throw FileSystemLoopException
2 participants