Method argument inference?

Joe Darcy Joe.Darcy at Sun.COM
Mon Sep 21 21:52:22 PDT 2009


On 09/20/09 09:58 PM, Florian Weimer wrote:
> * John Hendrikx:
>
>   
>> This gets flagged as a warning by the compiler, as it cannot infer the 
>> type from the method parameters.  The code below is warning free however 
>> with an unnecessary intermediate assignment:
>>
>>   Set<String> emptySet = Collections.emptySet();
>>   dealWithStringSet(emptySet);
>>     
>
> FWIW, you can also use:
>
>     dealWithStringSet(Collections.<Set<String>>emptySet());
>
>   

That should be

        dealWithStringSet(Collections.<String>emptySet());

-Joe



More information about the coin-dev mailing list