Package: libgcj2
Version: 1:3.0.2-3
Severity: important
Tags: patch

Serialization of the java.util.Date class is broken in libgcj.
Although the "Date" class is correctly marked as "implements
java.io.Serializable", the actual data stored in the Date class is
marked transient!  This means that the field won't actually get
serialized.  Below is a patch to correct the problem.  I could write a
small demonstration program to show the difference in behavior from
javac, if desired.

-- Agthorr

--- gcc-20011024/libjava/java/util/Date.java~   Tue Jan  9 01:43:39 2001
+++ gcc-20011024/libjava/java/util/Date.java    Wed Nov 28 16:09:36 2001
@@ -24,7 +24,7 @@ public class Date implements java.io.Ser
 {
   private static final long serialVersionUID = 7523967970034938905L;
 
-  transient private long millis;
+  private long millis;
 
   public Date() { millis = System.currentTimeMillis(); }


-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux eleutheromania 2.4.12 #1 Fri Oct 12 15:06:20 PDT 2001 i686
Locale: LANG=C, LC_CTYPE=

Versions of packages libgcj2 depends on:
ii  libc6                         2.2.4-5    GNU C Library: Shared libraries an
ii  libgcc1                       1:3.0.2-3  GCC support library.
ii  zlib1g                        1:1.1.3-16 compression library - runtime



Reply via email to