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

java.awt.Frame fails to be serialized in jdk1.2beta4

XMLWordPrintable

    • sparc
    • solaris_2.5



      Name: avC70361 Date: 05/31/98



        The exception java.io.NotSerializableException: java.lang.ref.SoftReference
      is thrown when trying to serialize a Frame instance.

      Here is teh test demonstrating the bug.
      -----------------FrameTest.java-------------
      import java.awt.*;
      import java.io.*;

      public class FrameTest {

        public static void main(String args[]) {
          Frame frame = new Frame("frame");

          ObjectOutputStream stream = null;

          try {
            stream = new ObjectOutputStream(new ByteArrayOutputStream());

            stream.writeObject(frame);

            stream.close();

          } catch(IOException e) {
            System.out.println("Couldn't write " + frame + " : " + e);
          }
          System.exit(0);
        }
      }
      -------------Test output----------
      <avv@stardust(pts/7).465> java -fullversion
      java full version "JDK-1.2beta4-G"
      <avv@stardust(pts/7).466> java FrameTest
      Couldn't write java.awt.Frame[frame0,0,0,0x0,invalid,hidden,layout=java.awt.BorderLayout,resizable,title=frame] : java.io.NotSerializableException: java.lang.ref.SoftReference

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

            lbunnisunw Lara Bunni (Inactive)
            ovlasov Oleksandr Vlasov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: