RFR: 8023681: Fix raw type warning caused by Sink

Mike Duigou mike.duigou at oracle.com
Fri Aug 23 14:40:44 PDT 2013


I considered that as well but since the types are generics you'd have to cast anyway.

The only viable declaration is:

private static Function<?,?> CASTING_IDENTITY = i -> i;

On usage you'd have to add (Function<I,R>) CASTING_IDENTITY

(Which assumes the compiler would even accept this heinous cast, I haven't tried it)

Mike

On Aug 23 2013, at 14:18 , Ali Ebrahimi wrote:

> Why not to make castingIdentity method a constant?
> 
> 
> On Fri, Aug 23, 2013 at 11:47 PM, Henry Jen <henry.jen at oracle.com> wrote:
> 
>> Hi,
>> 
>> Please kindly review the fix for eliminate some warnings in
>> java.util.stream package.
>> 
>> Chained Sink is an internal implementation detail, add the type for
>> downstream is more precise but verbose.
>> 
>> Included is also a couple other warnings cleanup.
>> 
>> http://cr.openjdk.java.net/~henryjen/tl/8023681.0/webrev/
>> 
>> Cheers,
>> Henry
>> 
>> 



More information about the lambda-dev mailing list