RFR: 6543126: Level.known can leak memory
daniel.fuchs at oracle.com
Wed Aug 17 07:11:08 UTC 2016
On 17/08/16 05:05, Mandy Chung wrote:
>> 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.
OK - I'll do that.
> No need for me to see an updated webrev.
More information about the core-libs-dev