Makes sense. I was also wondering why it was that way.
On Mon, Feb 22, 2016 at 3:05 PM, Gary Gregory <[email protected]>
wrote:
> We have:
>
> @Override
> public <R> R traceExit(final Message message, final R result) {
> if (isEnabled(Level.TRACE, EXIT_MARKER, message, null)) {
> logMessage(FQCN, Level.TRACE, EXIT_MARKER, new
> MessageSupplier() {
> @Override
> public Message get() {
> return flowMessageFactory.newExitMessage(result,
> message);
> };
> }, null);
> }
> return result;
> }
>
> But then we turn around and extract the message with:
>
> protected void logMessage(final String fqcn, final Level level, final
> Marker marker,
> final MessageSupplier msgSupplier, final Throwable t) {
> final Message message = LambdaUtil.get(msgSupplier);
> logMessage(fqcn, level, marker, message, t);
> }
>
> Why not simply do:
>
> @Override
> public <R> R traceExit(final Message message, final R result) {
> if (isEnabled(Level.TRACE, EXIT_MARKER, message, null)) {
> logMessage(FQCN, Level.TRACE, EXIT_MARKER,
> flowMessageFactory.newExitMessage(result, message), null);
> }
> return result;
> }
>
> ?
>
> Thank you,
> Gary
> --
> E-Mail: [email protected] | [email protected]
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>