8064736: Part of java.util.jar.JarFile spec looks confusing with references to Zip

Update the api doc for entries()/stream() accordingly

Reviewed-by: alanb
This commit is contained in:
Xueming Shen 2015-05-22 08:56:33 -07:00
parent 67b606e456
commit d1d75812b0
2 changed files with 15 additions and 3 deletions
jdk/src/java.base/share/classes/java/util

@ -268,13 +268,25 @@ class JarFile extends ZipFile {
}
/**
* Returns an enumeration of the zip file entries.
* Returns an enumeration of the jar file entries.
*
* @return an enumeration of the jar file entries
* @throws IllegalStateException
* may be thrown if the jar file has been closed
*/
public Enumeration<JarEntry> entries() {
return new JarEntryIterator();
}
@Override
/**
* Returns an ordered {@code Stream} over the jar file entries.
* Entries appear in the {@code Stream} in the order they appear in
* the central directory of the jar file.
*
* @return an ordered {@code Stream} of entries in this jar file
* @throws IllegalStateException if the jar file has been closed
* @since 1.8
*/
public Stream<JarEntry> stream() {
return StreamSupport.stream(Spliterators.spliterator(
new JarEntryIterator(), size(),

@ -538,7 +538,7 @@ class ZipFile implements ZipConstants, Closeable {
}
/**
* Return an ordered {@code Stream} over the ZIP file entries.
* Returns an ordered {@code Stream} over the ZIP file entries.
* Entries appear in the {@code Stream} in the order they appear in
* the central directory of the ZIP file.
*