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

jar file created without error when the input file is same as archive file name

    XMLWordPrintable

    Details

    • Subcomponent:
      jar
    • CPU:
      x86
    • OS:
      generic

      Description

      jar file created without error when the input file is same as archive file name

      Tested Build : mustang jdk b78
      Tested OS : windows and solaris

      Steps to reproduce :

      1. Install mustang jdk b78
      2. Go to jdk1.6.0/bin
      3. Create a jar file with the source name file as same as destination file like the following :.

      *On windows*
       > jar -cvf c:\temp\test.jar c:\temp\test.jar (test.jar does not exist and same as archive file name)
      added manifest

      (though test.jar does not exist, it tries to create with test.jar as the input file)
       >jar -xvf c:\temp\test.jar
      java.io.IOException: META-INF : could not create directory
      .
      .
      .


      *On solaris*
       > jar -cvf /tmp/malathi/test.jar /tmp/malathi/test.jar
      added manifest
      adding: tmp/malathi/test.jar(in = 111) (out= 67)(deflated 39%) (this part is missing on Windows)

      (though test.jar does not exist, it tries to add test.jar as the input file)

       > jar -xvf /tmp/malathi/test.jar
      (2 more folders /tmp/malathi and test.jar file got created under /tmp/malathi)

      rohit:/tmp/malathi/tmp/malathi 107 % jar -xvf test.jar
        created: META-INF/
      java.io.EOFException: Unexpected end of ZLIB input stream
              at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:215)
              at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:134)
              at java.util.zip.ZipInputStream.read(ZipInputStream.java:140)
              at sun.tools.jar.Main.extractFile(Main.java:715)
              at sun.tools.jar.Main.extract(Main.java:678)
              at sun.tools.jar.Main.run(Main.java:190)
              at sun.tools.jar.Main.main(Main.java:904)

      Expected behavior : Instead of creating a jar file, it should throw error message like "/tmp/malathi/test.jar : no such file or directory" or something like "test.jar same as archive file."

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            mnarayansunw Malathi Narayanan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: