任务单 #12797

Bean serialization is broken
开放日期: 2008-06-18 06:19 最后更新: 2008-11-09 16:04

报告人:
属主:
类型:
状态:
开启 [Owner assigned]
组件:
(无)
里程碑:
(无)
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
Accepted
文件:

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.

任务单历史 (2/2 Histories)

2008-11-06 22:35 Updated by: freebeans
  • 处理结果 Update from to Accepted
  • 属主 Update from (无) to freebeans
2008-11-09 16:04 Updated by: freebeans
评论
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

编辑

Please login to add comment to this ticket » 登录名