ObjectOutputStream and Record

Chris Hegarty chris.hegarty at oracle.com
Mon Dec 2 14:53:01 UTC 2019


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