-
Bug
-
Resolution: Fixed
-
P4
-
1.2.2, 1.4.0
-
None
-
mantis
-
generic
-
generic
-
Verified
Some unsynchronized collections (ArrayList, LinkedList, HashSet and TreeSet) have synchronized readObject and writeObject methods. This is of no benefit and could even cause deadlock in applications that concurrently serialize different parts of an object graph in multiple threads. The synchronized modifier should be removed from these methods. Further, the synchronized modifier is present on the readObject method of a synchronized collection (Hashtable). This is unnecessary and should be removed. (It is, however, essential that Hashtable's writeObject method remain synchronized.) Finally, Vector uses default serialization, which is unsynchronized. We must add a synchronized writeObject method to Vector that simply calls the default method.
- duplicates
-
JDK-4261107 Vector serialization is not synchronized
-
- Closed
-
- relates to
-
JDK-6927486 Hashtable.writeObject() synchronization risks serialization deadlock
-
- Closed
-
-
JDK-5085747 Java level deadlock in java.util.Vector.writeObject
-
- Closed
-
-
JDK-6934356 Vector.writeObject() synchronization risks serialization deadlock
-
- Closed
-