Unit type?

Paul Sandoz paul.sandoz at oracle.com
Mon Sep 16 03:13:58 PDT 2013


On Sep 14, 2013, at 3:55 AM, John Rose <john.r.rose at oracle.com> wrote:

> On Sep 13, 2013, at 6:19 PM, Zhong Yu <zhong.j.yu at gmail.com> wrote:
> 
>> public class Void
>> 
>>   /** a constant for (Void)null */
>>   public static final Void VOID = (Void)null;
> 
> I like that; it's as concise and better typed than "return null".  How many occurrences of null in the JDK could be be replaced by VOID, today?
> 

FWIW my IDE reports 264 usages of Void method return type and 471 usages as a type parameter in JDK code (including tests). Very few (Void)null casts are used.

Paul.


More information about the lambda-dev mailing list