[ 
https://issues.apache.org/jira/browse/WICKET-6644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16788882#comment-16788882
 ] 

Thomas Heigl commented on WICKET-6644:
--------------------------------------

This is the commit that introduced the {{readResolve}} method: 

https://github.com/apache/wicket/commit/a3cf4a0cf43ee96878a9c9167913a9d7ee03cf3e

> AbstractPageableView can only be serialized with Java built-in serialization
> ----------------------------------------------------------------------------
>
>                 Key: WICKET-6644
>                 URL: https://issues.apache.org/jira/browse/WICKET-6644
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core
>    Affects Versions: 8.3.0
>            Reporter: Thomas Heigl
>            Priority: Major
>
> I'm in the progress of replacing FST serialization, that we have used in 
> production for years, with Kryo.
> FST is a drop-in replacement for Java's built-in serialization and respects 
> the {{readObject/writeObject}} contract. Kryo does not rely on Java 
> serialization at all.
> All of Wicket's classes can be serialized with recent versions of Kryo 
> without problems, but when I did some exploratory testing, I noticed that all 
> our pageable lists were empty after deserialization.
> After some investigation, I found the root cause of this: WICKET-1323
> {{AbstractPageableView}} is the *only* class in Wicket that relies a custom 
> {{readResolve}} method to correctly restore its sate.
> I propose to get rid of this method and simply initialize the transient field 
> to a default value of {{-1}} or use a {{Long}} instead of a {{long}} to 
> represent that cached item count.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to