classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: Better NotSerializableException exception


From: Mark Wielaard
Subject: [cp-patches] FYI: Better NotSerializableException exception
Date: Mon, 03 Oct 2005 01:39:35 +0200

Hi,

This small patch helps a lot when trying to figure out where some
non-serializable object comes from. It prints the class that contains
the field that holds the reference to the non-serializable object:

2005-10-02  Mark Wielaard  <address@hidden>

    * java/io/ObjectOutputStream.java (writeObject): Add defining class
    to NotSerializableException.

Committed,

Mark

diff -u -r1.59 ObjectOutputStream.java
--- java/io/ObjectOutputStream.java     9 Sep 2005 12:12:03 -0000
1.59
+++ java/io/ObjectOutputStream.java     2 Oct 2005 23:35:30 -0000
@@ -361,7 +361,9 @@
                break;
              }

-           throw new NotSerializableException(clazz.getName ());
+           throw new NotSerializableException(clazz.getName()
+                                              + " in "
+                                              +
currentObject.getClass());
          } // end pseudo-loop
       }
     catch (ObjectStreamException ose)

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]