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

META-INF/MANIFEST.MF created incorrectly when "jar cm" given with invalid manifest file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 1.4.1
    • core-libs
    • None

      While investigating 4815502, I determined that when an invalid manifest is provide to "jar cm", the MANIFEST.MF file in the resulting jar file is invalid, though differently.

      Testcase follows: Given the following bad.manifest file (bad because the newline expected between the 2 individual sections is missing), the META-INF/MANIFEST.MF below is produced.

      ---<bad.manifest>---
      Manifest-Version: 1.0
      Created-By: 1.2 (Sun Microsystems Inc.)
      Implementation-Version: 1.0

      Name: foo
      Implementation-Version: 1.1
      Name: bar
      Implementation-Version: 1.2
      ---</bad.manifest>---

      % jar cmf bad.manifest test.jar

      You'll see a warning, as a result of the fix for 4815502.

      % jar xf test.jar
      % cat META-INF/MANIFEST.MF
      Manifest-Version: 1.0
      Created-By: 1.2 (Sun Microsystems Inc.)
      Implementation-Version: 1.0

      Name: foo
      Implementation-Version: 1.2
      Name: bar

      Notice that the Implementation-Version of foo is wrong, and that Implementation-Version for bar is missing.

            Unassigned Unassigned
            bristor Dave Bristor (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: