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

JAR tool: option -i can't be combined with other options

    Details

    • Subcomponent:
      jar
    • Resolved In Build:
      b97
    • CPU:
      x86
    • OS:
      windows_nt, windows_2000
    • Verification:
      Not verified

      Description

      Name: rmT116609 Date: 05/23/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      Windows NT Version 4.0 service pack 6a
      French version


      A DESCRIPTION OF THE PROBLEM :
      JAR tools with option -i (Generate index information) work
      as expected when used alone. However, unexpected behavior
      occurs when -i is combined with some other flags:

        -i0 throws a JarException

        -cfi Emmit an error message saying that the 'c' flag
               requires that input files be specified. This
               error message is emmited even if an imput file
               is actually specified (i.e. the -cf option work
               as expected).

        -cfmi No error message, but the index is not generated.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Compile the following class:

      class Dummy
      {
      }


      2. Create a "dummy.mf" file with the following content:

      Implementation-Version: 0



      3. Try the following from the command line:

      jar -vcfmi cfmi.jar dummy.mf Dummy.class
      jar -vcfi cfi.jar Dummy.class
      jar -vcfm0 cfmi0.jar dummy.mf Dummy.class
      jar -i0 cfmi0.jar


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      ---- CASE 1 -----------------------------

      jar -vcfm cfm.jar dummy.mf Dummy.class

          Work as expected. But adding option -i
          has strange behavior:


      jar -vcfmi cfmi.jar dummy.mf Dummy.class

          Add the manifest only. Neither the class
          or the index is added. No error message
          is emited.



      ---- CASE 2 -----------------------------

      jar -vcf cf.jar Dummy.class

          Work as expected. But adding option -i
          has strange behavior:

          
      jar -vcfi cfi.jar Dummy.class

          The following error message is emited:
          "'c' flag requires that input files be specified!"

          But the input file IS specified...



      ---- CASE 3 -----------------------------

      jar -vcfm cfmi.jar dummy.mf Dummy.class
      jar -i cfmi.jar

          Work as expected. But adding option -0
          doesn't work:


      jar -vcfm0 cfmi0.jar dummy.mf Dummy.class
      jar -i0 cfmi0.jar

          The second "jar" call fails with the
          stack trace below:


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      sun.tools.jar.JarException: incorrect length while processing: .\index31601.tmp
              at sun.tools.jar.Main.crc32File(Main.java:665)
              at sun.tools.jar.Main.addIndex(Main.java:505)
              at sun.tools.jar.Main.update(Main.java:435)
              at sun.tools.jar.Main.dumpIndex(Main.java:768)
              at sun.tools.jar.Main.genIndex(Main.java:842)
              at sun.tools.jar.Main.run(Main.java:196)
              at sun.tools.jar.Main.main(Main.java:904)


      This bug can be reproduced always.

      CUSTOMER WORKAROUND :
      use jar -i only.
      (Review ID: 146930)
      ======================================================================


      The exception thrown when "jar" is called with "-i0" is due to a bug
      that is independent of the other issues addressed in this bug report.
      That bug will be addressed by bugid 4823701: JAR tool: fails for "-i0".

      ###@###.### 2003-02-25

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sherman Xueming Shen
                Reporter:
                rmandalasunw Ranjith Mandala (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: