Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4112089

java.util.zip.ZipEntry.getTime() returns wrong initial value.

XMLWordPrintable

    • jar
    • 1.2beta4
    • sparc
    • solaris_2.5
    • Verified



      Name: sdC67446 Date: 02/13/98


      method java.util.zip.ZipEntry.getTime() returns wrong initial value.

      Here is what documentation says:
      --------------------------------------------------
       public long getTime()
       Returns the modification time of the entry, or -1 if not specified.
       
      Here is the test demonstrating the bug:
      -----------------Test.java------------------------
      import java.util.zip.*;

      public class Test {
        
        public static void main(String[] args) {

          ZipEntry testentry = new ZipEntry("");
          
          if (testentry.getTime() != -1) {
            System.out.println("getTime() != -1");
          } else {
            System.out.println("it's ok.");
          }
        }
      }
      ---------Output from the test---------------------
      getTime() != -1
      --------------------------------------------------

      ======================================================================

            dconnellsunw David Connelly (Inactive)
            sdmitriesunw Sergei Dmitriev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: