antlr / stringtemplate4

StringTemplate 4
http://www.stringtemplate.org
Other
955 stars 231 forks source link

Remove double-brace initialization and wrap constant collections in Collection.unmodifiable{Set,Map} #228

Closed Clashsoft closed 4 years ago

Clashsoft commented 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.

parrt commented 4 years ago

Wow. crazy performance issue. allowing. thanks!