changeset 1602:05ea733a7ae2

6868627: (spec) Files.walkFileTree doesn't make it clear that uncaught errors and exceptions are propagated Reviewed-by: sherman
author alanb
date Fri, 04 Sep 2009 18:17:26 +0100
parents 3f87b755b1c8
children 87a2ef2439bc
files src/share/classes/java/nio/file/Files.java src/share/classes/java/nio/file/SimpleFileVisitor.java
diffstat 2 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/nio/file/Files.java	Fri Sep 04 18:15:50 2009 +0100
+++ b/src/share/classes/java/nio/file/Files.java	Fri Sep 04 18:17:26 2009 +0100
@@ -133,10 +133,11 @@
      * <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
      * FileVisitor} invoked for each file encountered. File tree traversal
-     * completes when all accessible files in the tree have been visited, a
-     * visitor returns a result of {@link FileVisitResult#TERMINATE TERMINATE},
-     * or the visitor terminates due to an uncaught {@code Error} or {@code
-     * RuntimeException}.
+     * completes when all accessible files in the tree have been visited, or a
+     * visit method returns a result of {@link FileVisitResult#TERMINATE
+     * TERMINATE}. Where a visit method terminates due an uncaught error or
+     * 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
      * java.nio.file.attribute.BasicFileAttributes}. If the file is not a
--- a/src/share/classes/java/nio/file/SimpleFileVisitor.java	Fri Sep 04 18:15:50 2009 +0100
+++ b/src/share/classes/java/nio/file/SimpleFileVisitor.java	Fri Sep 04 18:17:26 2009 +0100
@@ -124,8 +124,8 @@
      * cause.
      *
      * @throws  IOError
-     *          if iteration of the directory completed prematurely due to an
-     *          I/O error
+     *          with the I/O exception thrown when iteration of the directory
+     *          completed prematurely due to an I/O error
      */
     @Override
     public FileVisitResult postVisitDirectory(T dir, IOException exc) {