changeset 8447:e05ae11a0854

improve javadoc for Files::find
author henryjen
date Tue, 30 Apr 2013 23:57:18 -0700
parents 619cafddd991
children 5097c0fece93
files src/share/classes/java/nio/file/Files.java
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/nio/file/Files.java	Tue Apr 30 23:13:34 2013 -0700
+++ b/src/share/classes/java/nio/file/Files.java	Tue Apr 30 23:57:18 2013 -0700
@@ -3409,15 +3409,18 @@
      * Path} by searching for files in a file tree rooted at a given starting
      * file.
      *
-     * <p> This method walks the file tree in exactly the manner specified by
+     * <p>This method walks the file tree in exactly the manner specified by
      * the {@link #walk walk} method. For each file encountered, the given
      * {@link BiPredicate} is invoked with its {@link Path} and {@link
      * BasicFileAttributes}. The {@code Path} object is obtained as if by
      * {@link Path#resolve(Path) resolving} the relative path against {@code
      * start} and is only included in the returned {@link CloseableStream} if
-     * the {@code BiPredicate} returns true.
-     *
-     * <p> If an {@link IOException} is thrown when accessing the directory
+     * the {@code BiPredicate} returns true. Compare to calling {@link
+     * java.util.stream.Stream#filter filter} on the {@code Stream} returned
+     * by {@code walk} method, this method is more efficient by avoiding
+     * redundant retrieval of the {@code BasicFileAttributes}.
+     *
+     * <p>If an {@link IOException} is thrown when accessing the directory
      * after returned from this method, it is wrapped in an {@link
      * UncheckedIOException} which will be thrown from the method that caused
      * the access to take place.