Unloadable ImageIcons throw exceptions during serialization

XMLWordPrintable

    • kestrel
    • sparc
    • solaris_2.5.1



      Name: krT82822 Date: 01/17/99


      If you load an ImageIcon, and it fails to load, when you serialize the
      icon an exception is generated. If the ImageIcon fails silently at load,
      it must fail silently at Serialization as well.

      import java.io.*;
      import com.sun.java.swing.*;

      public class IconSer {
      public static void main(String[] args) throws Exception {
      ImageIcon icon = new ImageIcon("xxx");
      System.out.println("Loaded bad image!");

      ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("icon.ser"));

      out.writeObject(icon);
      out.flush();
      out.close();
      }
      }
      (Review ID: 35642)
      ======================================================================

            Assignee:
            Jeff Dinkins
            Reporter:
            Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: