bug-classpath
[Top][All Lists]
Advanced

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

[Bug classpath/22781] Deserialization of an empty TreeMap fails


From: gcc-bugzilla at gcc dot gnu dot org
Subject: [Bug classpath/22781] Deserialization of an empty TreeMap fails
Date: 16 Oct 2005 01:27:10 -0000

Deserialization of an empty java.util.TreeMap fails with a 
NullPointerException. It happens because transient field 
"root" is not initialized during deserialization. To fix:
add root = nil; to the beginning of readObject method.


------- Comment #1 from from-classpath at savannah dot gnu dot org  2004-09-14 
20:23 -------
I've attached a Mauve test that triggers the bug with Classpath, and passes
with Sun's JDK 1.4.  I'll forward it to the mauve-patches mailing list also.


------- Comment #2 from from-classpath at savannah dot gnu dot org  2004-09-19 
20:13 -------
Thanks for the bug report.
Good spotting.

Solved by:

2004-09-19  Mark Wielaard  <address@hidden>

        * java/util/TreeMap.java (root): Don't initialize.
        (TreeMap(Comparator)): Call fabricateTree(0).
        (fabricateTree): Initialize root and size when count is 0.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22781





reply via email to

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