RFR: 6543126: Level.known can leak memory

Mandy Chung mandy.chung at oracle.com
Wed Aug 17 04:05:32 UTC 2016


> On Aug 16, 2016, at 5:42 AM, Daniel Fuchs <daniel.fuchs at oracle.com> wrote:
> 
> Hi Mandy,
> 
> I added an additional selector parameter to the find methods.
> This made it possible to return Optional<Level> instead of
> KnownLevel - and it does simply the parse() method.
> 
> http://cr.openjdk.java.net/~dfuchs/webrev_6543126/webrev.02
> 

This looks much better.  I like the findByName method taking a function to select what to be returned.  But the selector looks strange to map from a KnownLevel to a stream of Level.  I think it should be Function<KnownLevel, Optional<Level>> and the callsite can convert to Stream using Optional::stream.

No need for me to see an updated webrev.

thanks
Mandy



More information about the core-libs-dev mailing list