On Fri, 25 Feb 2022 03:51:09 GMT, Jaikiran Pai <j...@openjdk.org> wrote:

>> test/jdk/java/util/Properties/PropertiesStoreTest.java line 112:
>> 
>>> 110:         locales.add(Locale.getDefault()); // always test the default 
>>> locale
>>> 111:         locales.add(Locale.US); // guaranteed to be present
>>> 112:         locales.add(Locale.ROOT); // guaranteed to be present
>> 
>> Can we assume the returned `Set<Locale>` is mutable? `Collectors.toSet()` 
>> javadoc reads no guarantee for mutability.
>
> That's a very good point. I've updated the PR to now explicitly use a mutable 
> `Set` instead of using `Collectors.toSet()`

This is ok, although `Collectors.toCollection(HashSet::new)` is a bit concise.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7558

Reply via email to