mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
6868627: (spec) Files.walkFileTree doesn't make it clear that uncaught errors and exceptions are propagated
Reviewed-by: sherman
This commit is contained in:
parent
98e07b99bf
commit
5d15a44868
2 changed files with 7 additions and 6 deletions
|
@ -133,10 +133,11 @@ public final class Files {
|
||||||
* <p> This method walks a file tree rooted at a given starting file. The
|
* <p> This method walks a file tree rooted at a given starting file. The
|
||||||
* file tree traversal is <em>depth-first</em> with the given {@link
|
* file tree traversal is <em>depth-first</em> with the given {@link
|
||||||
* FileVisitor} invoked for each file encountered. File tree traversal
|
* FileVisitor} invoked for each file encountered. File tree traversal
|
||||||
* completes when all accessible files in the tree have been visited, a
|
* completes when all accessible files in the tree have been visited, or a
|
||||||
* visitor returns a result of {@link FileVisitResult#TERMINATE TERMINATE},
|
* visit method returns a result of {@link FileVisitResult#TERMINATE
|
||||||
* or the visitor terminates due to an uncaught {@code Error} or {@code
|
* TERMINATE}. Where a visit method terminates due an uncaught error or
|
||||||
* RuntimeException}.
|
* runtime exception then the traversal is terminated and the error or
|
||||||
|
* exception is propagated to the caller of this method.
|
||||||
*
|
*
|
||||||
* <p> For each file encountered this method attempts to gets its {@link
|
* <p> For each file encountered this method attempts to gets its {@link
|
||||||
* java.nio.file.attribute.BasicFileAttributes}. If the file is not a
|
* java.nio.file.attribute.BasicFileAttributes}. If the file is not a
|
||||||
|
|
|
@ -124,8 +124,8 @@ public class SimpleFileVisitor<T> implements FileVisitor<T> {
|
||||||
* cause.
|
* cause.
|
||||||
*
|
*
|
||||||
* @throws IOError
|
* @throws IOError
|
||||||
* if iteration of the directory completed prematurely due to an
|
* with the I/O exception thrown when iteration of the directory
|
||||||
* I/O error
|
* completed prematurely due to an I/O error
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public FileVisitResult postVisitDirectory(T dir, IOException exc) {
|
public FileVisitResult postVisitDirectory(T dir, IOException exc) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue