list literal gotcha and suggestion

Mark Thornton mthornton at optrak.co.uk
Tue Sep 29 01:02:19 PDT 2009


Reinier Zwitserloot wrote:
> new HashSet<>(["a", "b", "c"]);
>
> is too much effort in the rare cases where you need to initialize a 
> set-typed parameter? This is java, not perl. Golfing isn't the end goal.
>
Without scanning my codebase I wouldn't expect Set parameters and fields 
to be rare. I use Set's quite frequently.

Mark Thornton




More information about the coin-dev mailing list