--- old/src/java.base/share/classes/java/nio/file/DirectoryStream.java 2019-02-27 18:10:40.000000000 -0800 +++ new/src/java.base/share/classes/java/nio/file/DirectoryStream.java 2019-02-27 18:10:40.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,10 +34,10 @@ * allows for the convenient use of the for-each construct to iterate over a * directory. * - *

While {@code DirectoryStream} extends {@code Iterable}, it is not a + *

{@code DirectoryStream} extends {@code IterableOnce}. It is not a * general-purpose {@code Iterable} as it supports only a single {@code * Iterator}; invoking the {@link #iterator iterator} method to obtain a second - * or subsequent iterator throws {@code IllegalStateException}. + * or subsequent iterator throws {@code IllegalStateException}. * *

An important property of the directory stream's {@code Iterator} is that * its {@link Iterator#hasNext() hasNext} method is guaranteed to read-ahead by @@ -117,7 +117,7 @@ */ public interface DirectoryStream - extends Closeable, Iterable { + extends Closeable, IterableOnce { /** * An interface that is implemented by objects that decide if a directory * entry should be accepted or filtered. A {@code Filter} is passed as the