ObjectOutputStream and Record

forax at univ-mlv.fr forax at univ-mlv.fr
Mon Dec 2 22:47:53 UTC 2019


Thank you Chris.

Rémi

----- Mail original -----
> De: "Chris Hegarty" <chris.hegarty at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "amber-dev" <amber-dev at openjdk.java.net>
> Envoyé: Lundi 2 Décembre 2019 15:53:01
> Objet: Re: ObjectOutputStream and Record

> Thank you Remi.
> 
> Pushed: https://hg.openjdk.java.net/amber/amber/rev/e1a4d3bc65c1
> 
> -Chris.
> 
>> On 30 Nov 2019, at 23:48, Remi Forax <forax at univ-mlv.fr> wrote:
>> 
>> Hi all,
>> in ObjectOutputStream.writeOrdinaryObject, there is a weird code:
>> 
>>  final boolean isRecord = isRecord(obj.getClass()) ? true : false;
>>  if (isRecord) {
>> 
>> Like enums, proxies, etc, the ObjectStreamClass knows if a record is a record or
>> not,
>> so the code can be simplified to
>> 
>>  if (desc.isRecord()) {
>> 
>> 
>> so the method isRecord can disappear (and writeRecordData can be marked as
>> preview).
>> 
>> regards,
> > Rémi


More information about the amber-dev mailing list