8064736: Part of java.util.jar.JarFile spec looks confusing with references to Zip
authorsherman
Fri, 22 May 2015 08:56:33 -0700
changeset 30786 fb0d6aaea1dc
parent 30785 e0e92b4448a4
child 30787 758feb62a4b0
8064736: Part of java.util.jar.JarFile spec looks confusing with references to Zip Summary: update the api doc for entries()/stream() accordingly Reviewed-by: alanb
jdk/src/java.base/share/classes/java/util/jar/JarFile.java
jdk/src/java.base/share/classes/java/util/zip/ZipFile.java
--- a/jdk/src/java.base/share/classes/java/util/jar/JarFile.java	Fri May 22 17:30:21 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/jar/JarFile.java	Fri May 22 08:56:33 2015 -0700
@@ -268,13 +268,25 @@
     }
 
     /**
-     * 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(),
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java	Fri May 22 17:30:21 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java	Fri May 22 08:56:33 2015 -0700
@@ -538,7 +538,7 @@
     }
 
     /**
-     * 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.
      *