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

spec: unspecified IllegalStateException in IIOMetadata.getMetadataFormat()

    Details

    • Subcomponent:
    • Resolved In Build:
      beta2
    • CPU:
      generic
    • OS:
      generic

      Description



      Name: mlR10151 Date: 05/08/2001



      The description for the
          javax.imageio.metadata.IIOMetadata.getMetadataFormat(String formatName)
      says nothing about throwing IllegalStateException, but
      getMetadataFormat does throw it in the example below:
      ========================== a.java =============================
      import javax.imageio.metadata.IIOMetadata;
      import org.w3c.dom.Node;

      public class a extends IIOMetadata {
          static String[] sarr1 = {"name1"};
          static String[] sarr2 = {"name2"};

          public static void main (String argv[]) throws Exception {
              new a();
          }

          public a() throws Exception {
              super(true, null, null, sarr1, sarr2);
              getMetadataFormat("name1");
          }

          public Node getAsTree(String formatName) {
              return null;
          }

          public boolean isReadOnly() {
              return true;
          }

          public void mergeTree(String formatName, Node root) {}

          public void reset() {}
      }
      ==========================log========================
      % java -version
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b63)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b63, mixed mode)
      % java a
      Exception in thread "main" java.lang.IllegalStateException: Can't obtain format
              at javax.imageio.metadata.IIOMetadata.getMetadataFormat(IIOMetadata.java:340)
              at a.<init>(a.java:14)
              at a.main(a.java:9)
      Caused by: java.lang.ClassNotFoundException: name2
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:130)
              at javax.imageio.metadata.IIOMetadata.getMetadataFormat(IIOMetadata.java:336)
              ... 2 more


      This bug causes failure of the new JCK test
      api/javax_imageio/metadata/IIOMetadata/index.html#Ctor

      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              dricesunw Daniel Rice (Inactive)
              Reporter:
              mlsunw Ml Ml (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: