Tíquete #12797

Bean serialization is broken
: 2008-06-18 06:19 Última Atualização: 2008-11-09 16:04

Relator:
Dono:
Tipo:
Estado:
Aberto [Owner assigned]
Componente:
(Nenhum)
Marcos:
(Nenhum)
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Accepted
Arquivo:
Nenhum

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
  • Resolução Update from Nenhum to Accepted
  • Dono Update from (Nenhum) to freebeans
2008-11-09 16:04 Updated by: freebeans
Comentário
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

Editar

Please login to add comment to this ticket » Login