You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2015/06/18 15:48:01 UTC

[jira] [Comment Edited] (SOLR-7590) Finish and improve MDC logging support.

    [ https://issues.apache.org/jira/browse/SOLR-7590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14591804#comment-14591804 ] 

Uwe Schindler edited comment on SOLR-7590 at 6/18/15 1:47 PM:
--------------------------------------------------------------

Hi Mark,

I am wondering why you be so verbose in Java 8's code. The main reason for {{ThreadLocal.withInitial()}} is to use it like that:

{code:java}
private static final ThreadLocal<Integer> CALL_DEPTH = ThreadLocal.withInitial(() -> 0);
{code}

Using a Supplier without a lambda is not the intention behind this method /API :-)
In Java 7, you can use the code like this fix comitted. If you want it verbose in Java 8, I would also use the Java 7 code...

Uwe



was (Author: thetaphi):
Hi Mark,

I am wondering why you be so verbose in Java 8's code. The main reason for {{ThreadLocal.withInitial()}} is to use it like that:

{code:java}
private static final ThreadLocal<Integer> CALL_DEPTH = ThreadLocal.withInitial(() -> 0);
{code:java}

Using a Supplier without a lambda is not the intention behind this method /API :-)
In Java 7, you can use the code like this fix comitted. If you want it verbose in Java 8, I would also use the Java 7 code...

Uwe


> Finish and improve MDC logging support.
> ---------------------------------------
>
>                 Key: SOLR-7590
>                 URL: https://issues.apache.org/jira/browse/SOLR-7590
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Mark Miller
>            Assignee: Mark Miller
>             Fix For: 5.3, Trunk
>
>         Attachments: SOLR-7950.patch, SOLR-7950.patch, SOLR-7950.patch, SOLR-7950.patch, SOLR-7950.patch, SOLR-7950.patch, SOLR-7950.patch, SOLR-7950.patch, SOLR-7950.patch, SOLR-7950.patch, SOLR-7950.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org