Changed in https://issues.apache.org/jira/browse/LOG4J2-1823

On 24 February 2017 at 12:58, Remko Popma <remko.po...@gmail.com> wrote:

> +1 I'm fine with undeprecating MessageSupplier.
>
> Remko
>
> Sent from my iPhone
>
> On Feb 24, 2017, at 19:07, Matt Sicker <boa...@gmail.com> wrote:
>
> In log4j-api, the interface MessageSupplier has been deprecated ever since
> we realized that we didn't need it and could just use Supplier<Message> for
> lambda support. However, now that I've actually tried to use this in my own
> Java 8 project, I noticed that by default, the following will call the
> deprecated method:
>
> logger.info(() -> new MapMessage(convertForLogging(fields)));
>
> However, if I cast it, it'll call the non-deprecated form:
>
> logger.info((Supplier<Message>) () -> new MapMessage(convertForLogging(
> fields)));
>
> This isn't ideal. I propose we simply undeprecate MessageSupplier as it's
> the more specific form that javac will use by default anyways. We should
> note that it won't be available in a hypothetical 3.0 API, but I'd imagine
> that hypothetical API would just use Java 8's Supplier functional interface
> instead as well.
>
> --
> Matt Sicker <boa...@gmail.com>
>
>


-- 
Matt Sicker <boa...@gmail.com>

Reply via email to