-
Type:
CSR
-
Resolution: Approved
-
Priority:
P4
-
Component/s: core-libs
-
None
-
minimal
-
Specification-only change to align with existing behavior.
-
Java API
-
SE
Summary
Specify that the set returned from Locale.getISOCountries(Locale.IsoCountryCode type) is unmodifiable.
Problem
Locale.getISOCountries(Locale.IsoCountryCode type) returns an unmodifiable Set. This behavior is not specified in the method, and users can encounter an unexpected java.lang.UnsupportedOperationException if they attempt to modify the returned Set.
Solution
Specify the returned set is unmodifiable. This behavior is consistent with the other Set returning methods of Locale.
Specification
In Locale.getISOCountries(Locale.IsoCountryCode type),
- * {@return a {@code Set} of ISO3166 country codes for the specified type}
+ * {@return an unmodifiable {@code Set} of ISO3166 country codes for the specified type}
- csr of
-
JDK-8358449 Locale.getISOCountries does not specify the returned set is unmodifiable
-
- Resolved
-