Review request for initial lambda functions and utils

Rémi Forax forax at univ-mlv.fr
Wed Aug 10 10:17:56 PDT 2011


Hi Mike,

On 08/10/2011 06:07 PM, Mike Duigou wrote:
>> On Tue, Aug 9, 2011 at 9:55 AM, Colin Decker<cgdecker at gmail.com>  wrote:
>>
>>> I'm curious about cases such as Predicates.IS_NULL and Predicates.isNull()
>>> where there is both a public constant of type Predicate<Object>  and a
>>> public
>>> method that returns Predicate<T>. For one thing, I find the existence of
>>> both fields and methods for these standard functions kind of awkward,
>>> particularly when there's both a field and a method for the same thing.
> My intention is for the static utility functions to be the primary way to access these objects. There are no features available only via the static final fields.
>
> One value for the public static final field is the rare cases where having a field allows for conditional compilation behaviour not available using the static method.

The compiler only inlines static final value that are primitives.
Also, lambdas already come with a kind of auto-constant mechanism so
i don't think there is a real need of your static final fields to be public.

>
> The inconsistent typing and abuse of erasure do advocate towards making these fields private.
>
> Mike
>

Rémi



More information about the lambda-dev mailing list