Mantis - Hessian
Viewing Issue Advanced Details
6477 feature always 09-27-22 00:55 10-03-22 07:21
vj_msu  
 
normal  
new 4.0.63  
open  
none    
none  
0006477: Hessian 4.0.66 Serialize Object with Calendar would fail on deserialization if references are used
If you try to serialize and de-serialize an object with a Calendar instance the de-serialization will fail if references are used. This is because the `Calendar` instance will be replaced with `CalendarHandle`. During de-serialization the index of referenced objects is wrong (real index + 1 for example) because during `Hessian2Output#replaceRef` the `_refCount` will be be unchanged although the refs size will be decreased.

<code>
private static class TestUser implements java.io.Serializable {
        private final String name;
        private final Calendar lastSeen;
    }
</code>

Sample Test File in Github Repo: https://github.com/MCMicS/hessian/blob/a1d0b50eca6c68d18439775f281278c2bc44e975/test/com/caucho/hessian/io/SerializerDeserializerTest.java#L14 [^]

maybe simlar to issues:
- http://bugs.caucho.com/view.php?id=4069 [^]
- http://bugs.caucho.com/view.php?id=4430 [^]

Notes
(0007103)
vj_msu   
09-27-22 00:57   
Will fail for all object with `writeReplace` methods where original instance will be replaced with other instances