Serialization opt-in syntax (again)

David M. Lloyd david.lloyd at redhat.com
Mon Oct 8 06:35:27 PDT 2012


On 10/07/2012 10:13 PM, Brian Goetz wrote:
>> 1. Why I am *against* the *~>* syntax.
>>
>> Serialization is one of the more obscure features of Java. This makes it
>> much more important that to make related syntax *self-explanatory* than
>> for more ubiquitous features.
>> "~>" is about the least self-explanatory syntax we could possibly have.
>
> Totally agreed.  ~> is off the table.
>
>> I'd say those *annotation-based options look most adequate to me*.
>> (In the issue tracker there is some consensus of two more people about
>> this, so I'm the third)
>[...]
> So I think we're going to have to take annotations mostly off the table,
> too.
> [...]
> So, let's go back to where I set the bar earlier this week: aside from
> "I like XYZ better", are there any reasons why the intersection type
> cast should be unacceptable?

Well, they don't really solve the problem of making serialization 
correct; they accept as given that it's OK for anonymous and (worse yet) 
capturing lambdas to be serialized with the expectation that it'll just 
be flat-out wrong if you change the source in any way, which is 
something I absolutely do not concede and which I firmly believe will 
bite us (where "us"=="Java EE vendors"... and RMI users, and JPA users, 
and just about any of the hundreds of widely-used serialization-based 
technologies out there).

That said, and as I also said before, I like the general idea anyway; I 
think it could be pretty handy (especially if applied to anonymous 
classes), but not for solving the problem of serializability.

-- 
- DML


More information about the lambda-spec-observers mailing list