Closed Clashsoft closed 4 years ago
Double-brace initialization is commonly abused for its brevity, but has performance and clarity implications.
The use of Collections.unmodifiableSet and unmodifiableMap prevents outsider classes from modifying these collections, which is not desirable.
Collections.unmodifiableSet
unmodifiableMap
Wow. crazy performance issue. allowing. thanks!
Double-brace initialization is commonly abused for its brevity, but has performance and clarity implications.
The use of
Collections.unmodifiableSet
andunmodifiableMap
prevents outsider classes from modifying these collections, which is not desirable.