Raw types warning

Michael Nascimento misterm at gmail.com
Thu Apr 18 13:47:45 PDT 2013


On Thu, Apr 18, 2013 at 5:45 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
> That's going pretty roundabout...
>
> How about:
>
>   hqIds.stream()
>        .map(id -> findDealer(id))
>        .flatMap(d -> d.getBranches().stream())
>        .collect(toList());
>
> No reason to create intermediate garbage List<Dealer> if you can efficiently
> map from id to Dealer.

Except it hits the database multiple times instead of just one :-)

I wonder about the raw types warning though.

Regards,
Michael


More information about the lambda-dev mailing list