OSDN Git Service

* java/util/zip/ZipEntry.java (ZipEntry(String)): When name is bigger
authormark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Feb 2003 14:08:40 +0000 (14:08 +0000)
committermark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Feb 2003 14:08:40 +0000 (14:08 +0000)
       then 65535 chars throw IllegalArgumentException.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63222 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/util/zip/ZipEntry.java

index 2663795..c27bd8b 100644 (file)
@@ -1,5 +1,10 @@
 2003-02-21  Mark Wielaard  <mark@klomp.org>
 
+       * java/util/zip/ZipEntry.java (ZipEntry(String)): When name is bigger
+       then 65535 chars throw IllegalArgumentException.
+
+2003-02-21  Mark Wielaard  <mark@klomp.org>
+
        * java/util/zip/ZipFile.java (finalize): New method.
 
 2003-02-21  Michael Koch  <konqueror@gmx.de>
index c9f1b1d..b705850 100644 (file)
@@ -84,11 +84,15 @@ public class ZipEntry implements ZipConstants, Cloneable
    * Creates a zip entry with the given name.
    * @param name the name. May include directory components separated
    * by '/'.
+   *
+   * @exception NullPointerException when name is null.
+   * @exception IllegalArgumentException when name is bigger then 65535 chars.
    */
   public ZipEntry(String name)
   {
-    if (name == null)
-      throw new NullPointerException();
+    int length = name.length();
+    if (length > 65535)
+      throw new IllegalArgumentException("name length is " + length);
     this.name = name;
   }