Ticket #12797

Bean serialization is broken
Open Date: 2008-06-18 06:19 Last Update: 2008-11-09 16:04

Reporter:
Owner:
Type:
Status:
Open [Owner assigned]
Component:
(None)
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Accepted
File:
None

Details

This is in addition to the
interface.getClass().getMethods() bug.

Bean serialization does not work properly. Only the
object directly specified in writeObject is written,
even for classes such as JButton -- only <new
class="JButton" /> or something like that is written -
no properties etc.

The problem apparently occurs when the
PersistenceDelegate sees that streamCandidate (the new
uninitialized object it compares against to determinate
default values) is null (so mutatesTo is false), and
therefore calls instantiate instead of initialize.
However, instantiate only checks for constructor
properties, and doesn't bother with any other
properties. I think that this is how it is in Sun's
implementation, and I'm not sure where or how the other
properties are supposed to get written, and I haven't
tried Classpath on a PC, so I don't know where the
problem lies.

Ticket History (2/2 Histories)

2008-11-06 22:35 Updated by: freebeans
  • Resolution Update from None to Accepted
  • Owner Update from (None) to freebeans
2008-11-09 16:04 Updated by: freebeans
Comment
I'm investigating the cause of this problem.
And I found that "streamCandidate" always null, and DefaultPersistenceDelegate.initialize() never called.
The problem is not fixed yet, but I continue investigating.

Attachment File List

No attachments

Edit

Please login to add comment to this ticket » Login