----- Mail original ----- > De: "Florian Weimer" <f...@deneb.enyo.de> > À: "Peter Levart" <peter.lev...@gmail.com> > Cc: "Stuart Marks" <sma...@openjdk.java.net>, "core-libs-dev" > <core-libs-dev@openjdk.java.net> > Envoyé: Mercredi 18 Novembre 2020 12:55:02 > Objet: Re: RFR: 8180352: Add Stream.toList() method [v2]
> * Peter Levart: > >> But I see that the new IMM_LIST_NULLS type is needed for one other >> thing - the immutable list implementation of that type has different >> behavior of indexOf and lastIndexOf methods (it doesn't throw NPE when >> null is passed to those methods) so this behavior has to be preserved in >> the deserialized instance and there is not way to achieve that on old >> JDK with existing serialization format, so there has to be an >> incompatible change in the serialization format for that matter. > > I think it's also needed for an efficient null element check in > List::copyOf. I have a hunch that with the posted implementation, it > would incorrectly produce an immutable list that contains null > elements. yes ! Rémi