list literal gotcha and suggestion

Lawrence Kesteloot lk at teamten.com
Wed Oct 7 17:46:33 PDT 2009


> http://www.google.com/codesearch?hl=en&lr=&q=ImmutableList.of|ImmutaleSet.of|ImmutableMap.of|Arrays.asList\(\w%2B,\w%2B+lang:java&sbtn=Search
>
> Seems like all sorts of configuration/static data/quick and
> dirty/unittest/mock/etc types of syntax would benefit.

That search returns 800 files out of a total of 11,300,000. That's one
file in 14,125, or 0.007%.

I would be against a feature which (1) has such an unclear correct
specification; (2) provides so little advantage over a static
ArrayList.of() and HashSet.of(); and (3) helps only one file in
14,125.

On the other hand, the idea (proposed twice in this discussion) of
have a pair literal seems much more widely useful, and would allow
HashMap.of().

Lawrence



More information about the coin-dev mailing list