dave08
02/13/2018, 5:46 PMnew HashMap() {{ put("this", true) }};
== mapOf("this" to true)
(note the double {{
)?araqnid
02/13/2018, 6:10 PMdave08
02/13/2018, 6:17 PMCzar
02/13/2018, 7:10 PM{{ }}
in frequently executed code. Each time anonymous class is created, in the days of PermGenSpace this would kill a lot of apps, nowdays it will probably just cause a slow growing memory hog which could potentially cause OutOfMemory error down the line. I think {{ }}
should only be allowed during app initialization (which would ensure that only finite number of anonymous classes are generated) and nowhere else.araqnid
02/13/2018, 7:14 PMmapOf(...)
instead; at least, I hope so šCzar
02/13/2018, 7:15 PMdave08
02/13/2018, 7:39 PM