{"action":"created","issue":{"url":"https://api.github.com/repos/immutables/immutables/issues/113","labels_url":"https://api.github.com/repos/immutables/immutables/issues/113/labels{/name}","comments_url":"https://api.github.com/repos/immutables/immutables/issues/113/comments","events_url":"https://api.github.com/repos/immutables/immutables/issues/113/events","html_url":"https://github.com/immutables/immutables/issues/113","id":79931991,"number":113,"title":"Java built-in deserialization improvements for evolving value objects","user":{"login":"jbergfi","id":7983034,"avatar_url":"https://avatars.githubusercontent.com/u/7983034?v=3","gravatar_id":"","url":"https://api.github.com/users/jbergfi","html_url":"https://github.com/jbergfi","followers_url":"https://api.github.com/users/jbergfi/followers","following_url":"https://api.github.com/users/jbergfi/following{/other_user}","gists_url":"https://api.github.com/users/jbergfi/gists{/gist_id}","starred_url":"https://api.github.com/users/jbergfi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbergfi/subscriptions","organizations_url":"https://api.github.com/users/jbergfi/orgs","repos_url":"https://api.github.com/users/jbergfi/repos","events_url":"https://api.github.com/users/jbergfi/events{/privacy}","received_events_url":"https://api.github.com/users/jbergfi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/immutables/immutables/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-23T19:25:17Z","updated_at":"2015-05-25T19:30:36Z","closed_at":null,"body":"When using java built-in serialization on evolving value objects you may end up with invalid valid objects which may contain required non-null attributes as null or optional (guava or Java8) attributes as null instead of Optional.absent.\r\n\r\nFor example if you add a new required attribute you would expect to get an exception from the deserialization if you deserialize an object which didn't have that attribute. If you add a new optional (guava or Java8) you expect to get an Optional.absent for the attribute when deserializing an old version of the value object.\r\n\r\nSuggested fix is to generate a readResolve method in the value implementation where the a new object is created using the builder or contstructor using the attribute values parsed by the java serialization."},"comment":{"url":"https://api.github.com/repos/immutables/immutables/issues/comments/105294030","html_url":"https://github.com/immutables/immutables/issues/113#issuecomment-105294030","issue_url":"https://api.github.com/repos/immutables/immutables/issues/113","id":105294030,"user":{"login":"elucash","id":1692611,"avatar_url":"https://avatars.githubusercontent.com/u/1692611?v=3","gravatar_id":"","url":"https://api.github.com/users/elucash","html_url":"https://github.com/elucash","followers_url":"https://api.github.com/users/elucash/followers","following_url":"https://api.github.com/users/elucash/following{/other_user}","gists_url":"https://api.github.com/users/elucash/gists{/gist_id}","starred_url":"https://api.github.com/users/elucash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elucash/subscriptions","organizations_url":"https://api.github.com/users/elucash/orgs","repos_url":"https://api.github.com/users/elucash/repos","events_url":"https://api.github.com/users/elucash/events{/privacy}","received_events_url":"https://api.github.com/users/elucash/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T19:30:36Z","updated_at":"2015-05-25T19:30:36Z","body":"After playing with possible annotation API and trying to match the _\"theme\"_ of existing API, there are couple of ideas how to name module and annotations.\r\n\r\n* `org.immutables:serial` - module and corresponding top level package for the API\r\n* `@Serial.Structural` - annotation to generate structural serialization. No attributes. Could be applied to types, enclosing types, enclosing packages and as meta-annotation.\r\n* `@Serial.Version(1L)` - required value attribute to specify serial version. This annotation will be slightly magical in that it will make covered value types serializable (by structure if `@Serial.Structural` is also specified). Could be applied to types, enclosing types, enclosing packages and as meta-annotation. If no serial version annotation is specified — default will be used — 1L (seems to be a reasonable default) if serialization is implied by other means."}}