Closed
Bug 157196
Opened 23 years ago
Closed 23 years ago
ScriptableObject needs custom serialization implementation
Categories
(Rhino Graveyard :: Core, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
1.5R4
People
(Reporter: igor, Assigned: norrisboyd)
Details
Attachments
(2 files)
4.81 KB,
patch
|
Details | Diff | Splinter Review | |
1.50 KB,
text/plain
|
Details |
Currently ScriptableObject uses the standard Java support for serialization of
its data structures from hashtable implementation. But this does not work
properly as long as the slots array contains deleted entries marked with the
REMOVED slot tag. The standard Java de-serialization restores such entries to a
reference to a newly allocated object which != REMOVED. Such entries will stick
with hashtable forever and at some point will violate internal sanity checks.
In addition, the standard serialization waists storage as it takes room to store
empty/deleted slots.
Reporter | ||
Comment 1•23 years ago
|
||
The patch marks slots array as transient and adds writeObject/readObject that
write/read only existing slots in the hashtable. I had also to change
implementation of sealObject to set count to -1 - count so it would be possible
to know amount of existing slots without searching throw the slots array even
in the sealed object.
Reporter | ||
Comment 2•23 years ago
|
||
Save it as SerTest.java
Reporter | ||
Comment 3•23 years ago
|
||
Fixed: I commited the patch as it passes the above stress test.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 4•23 years ago
|
||
Verified FIXED. Before the patch, the above testcase failed as follows:
Exception in thread "main" java.lang.RuntimeException: FAILED!
at SerTest.test(SerTest.java:36)
at SerTest.main(SerTest.java:12)
After the patch:
PASSED
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•