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

Manifest is inconsistent when reading/writing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3
    • 1.4.2
    • 1.4.2
    • core-libs
    • None

    Description

      java.util.jar.Manifest class doesn't behave the same way when it is read or written.
      Consider a simple j2me manifest file:

      MIDlet-1: Blackjack, BlackjackS60Tr.png, com.mobilsoft.blackjack.BlackJack
      MIDlet-Name: Blackjack
      MIDlet-Vendor: Mobilsoft
      MIDlet-Version: 1.0
      MicroEdition-Configuration: CLDC-1.0
      MicroEdition-Profile: MIDP-1.0

      Now, if code is executed:

      Manifest mf = new Manifest(new FileInputStream('manifest'));
      mf.write(new FileOutputStream('manifest2'));

      the resulted file 'manifest2' will be empty.

      Apparently, when manifest write itself, only main attributes are written.
      (Manifest.write() calls Attributes.writeMain()). However, when Manifest.getMainAttributes() is called, all attributes, that are not per entry
      attributes are returned.

      This looks like a bad experience, first, I don't see how the J2ME manifests
      can be handled (read/written), and why the 'main' attributes are treated
      differently when writing manifest, or when asking for main attributes programmatically.

      Please contact ###@###.### for more inforamtion.

      ###@###.### 2005-07-05 22:27:14 GMT

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: