Netflix / archaius

Library for configuration management API
Apache License 2.0
2.46k stars 485 forks source link

Return unmodifiable collections in DefaultCollectionsTypeConverterFactory #691

Closed kilink closed 9 months ago

kilink commented 10 months ago

DefaultCollectionsTypeConverterFactory already returned an unmodifiable Map, so update the collection converters for List, Set, and SortedSet to also wrap the converted result with the appropriate unmodifiable collection. Additionally, if the value to convert is an empty String, don't allocate a collection and simply return the appropriate empty singleton (e.g. Collections.emptyList()).

Finally, improve type safety in a few places and avoid usage of raw types.