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

Uwe Schindler commented on SOLR-7590:
-------------------------------------

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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to