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

Pack200 API throws exceptions of unspecified type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 6
    • 6
    • deploy
    • None

    Description

      Date: Wed, 24 Aug 2005 13:12:24 -0700
      To: Elliotte Harold <###@###.###>
      CC: ###@###.###

      Elliotte Harold wrote:

      >> In Pack200.Packer the JavaDocs state that for an unknown attribute, "
      >> The string ERROR means that the pack operation as a whole will fail,
      >> with a suitable explanation." That's fine as far as it goes but it
      >> doesn't go far enough. It does not tell me how the operation fails. In
      >> particular does the method complete normally or does it throw an
      >> exception? If an exception which one? An IOException or a
      >> RuntimeException both seem possible here.


      You're right. This should be specified in the API, and it's a bug that
      it's not. It ought to be an IOException, but in fact the implementation
      happens to throw an implementation-specific flavor of RuntimeException.


      >> I have not yet been able to construct a test case that shows what the
      >> JDK actually does here. If you could answer that question, it would be
      >> appreciated. I did file a bug asking that this be clarified as well.


      Here's an example:

      --------
      $JAVA_HOME/bin/pack200 -CSourceFile=error /tmp/foo.pack.gz /tmp/foo.jar
      Exception in thread "main"
      com.sun.java.util.jar.pack.Attribute$FormatException: class.SourceFile:
      attribute not allowed in javax/swing/SwingBeanInfoBase
      at
      com.sun.java.util.jar.pack.ClassReader.readAttributes(ClassReader.java:335)
      at com.sun.java.util.jar.pack.ClassReader.read(ClassReader.java:127)
      at
      com.sun.java.util.jar.pack.PackerImpl$DoPack.readClass(PackerImpl.java:486)
      at com.sun.java.util.jar.pack.PackerImpl$DoPack.run(PackerImpl.java:460)
      at com.sun.java.util.jar.pack.PackerImpl.pack(PackerImpl.java:73)
      at com.sun.java.util.jar.pack.Driver.main(Driver.java:261)
      --------

      Attachments

        Issue Links

          Activity

            People

              ngthomas Thomas Ng (Inactive)
              jrose John Rose
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: