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

getExtraMetadataFormatNames returns an empty array

XMLWordPrintable

    • beta2
    • generic
    • generic



      Name: mlR10151 Date: 05/08/2001



      According to the spec., javax.imageio.metadata.IIOMetadata.getExtraMetadataFormatNames


            Returns:
                  an array of Strings with length at least 1, or null.

      But it returns array of zero length.
      To reproduce the bug run the following example:


      ========================== a.java =============================
      import javax.imageio.metadata.IIOMetadata;
      import org.w3c.dom.Node;

      public class a extends IIOMetadata {
          static String[] sarr = {};

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

          public a() {
              super(true, null, null, sarr, sarr);

              String[] names = getExtraMetadataFormatNames();
              if( names != null && names.length < 1 )
                  System.out.println("Failed");
              else
                  System.out.println("Passed");
          }

          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
      Failed


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

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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: