Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/443#discussion_r214541964
  
    --- Diff: 
solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformerFactory.java
 ---
    @@ -57,12 +58,34 @@
     
       static final char PATH_SEP_CHAR = '/';
       static final char NUM_SEP_CHAR = '#';
    +  private static final ThreadLocal<Boolean> transformerInitialized = new 
ThreadLocal<Boolean>(){
    --- End diff --
    
    This is the classic but more verbose way to declare a ThreadLocal.  In Java 
8 this can be a one-liner:  
    ```ThreadLocal<Boolean> recursionCheckThreadLocal = 
ThreadLocal.withInitial(() -> Boolean.FALSE);```
    And please consider another field name, not "transformerInitialized"?  I 
suggest "recursionCheckThreadLocal" since it declares it's purpose (to detect 
recursion) and it's type (it's a ThreadLocal).  "initialized" is dubious to me 
because it suggests an instance field of a class but this one is global.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to