RFR: JDK-8134373: explore potential uses of convenience factories within the JDK
patrick at reini.net
Thu Sep 15 12:33:51 UTC 2016
I tried to process all suggested change input into the following new
Give me feedback if something is missing/wrong
On 2016-09-15 13:48, Pavel Rappo wrote:
> Daniel, Claes,
> List.of() and Collections.emptyList() are not the same. The behaviours
> different. Moreover, immutable static factory methods return instances
> which are
> value-based. I believe it also means we are not tied with unconditional
> instantiation, and in case of empty collections/maps could probably
> return the
> same object every time.
> We should ask Stuart why it has been done like that in the first place.
> out of concern people might synchronize of those objects? I don't know.
> say for now it's an implementation-specific detail.
>> On 15 Sep 2016, at 12:35, Claes Redestad <claes.redestad at oracle.com>
>> I don't mind List.of() aesthetically, but there are places where
>> startup/footprint is important where Collections.emptyList()
>> is simply superior, e.g., constituting permanent data structures
>> such as the module graph during early bootstrap.
More information about the core-libs-dev