--- a/jdk/src/java.base/share/classes/java/util/Optional.java Tue Nov 08 18:02:50 2016 +0530
+++ b/jdk/src/java.base/share/classes/java/util/Optional.java Wed Nov 09 10:36:32 2016 -0800
@@ -214,20 +214,20 @@
* @apiNote
* This method supports post-processing on {@code Optional} values, without
* the need to explicitly check for a return status. For example, the
- * following code traverses a stream of file names, selects one that has not
- * yet been processed, and then opens that file, returning an
- * {@code Optional<FileInputStream>}:
+ * following code traverses a stream of URIs, selects one that has not
+ * yet been processed, and creates a path from that URI, returning
+ * an {@code Optional<Path>}:
*
* <pre>{@code
- * Optional<FileInputStream> fis =
- * names.stream().filter(name -> !isProcessedYet(name))
+ * Optional<Path> p =
+ * uris.stream().filter(uri -> !isProcessedYet(uri))
* .findFirst()
- * .map(name -> new FileInputStream(name));
+ * .map(Paths::get);
* }</pre>
*
- * Here, {@code findFirst} returns an {@code Optional<String>}, and then
- * {@code map} returns an {@code Optional<FileInputStream>} for the desired
- * file if one exists.
+ * Here, {@code findFirst} returns an {@code Optional<URI>}, and then
+ * {@code map} returns an {@code Optional<Path>} for the desired
+ * URI if one exists.
*
* @param mapper the mapping function to apply to a value, if present
* @param <U> The type of the value returned from the mapping function