carterkozak commented on a change in pull request #289: LOG4J2-2644 - Improve 
performance of getting location info
URL: https://github.com/apache/logging-log4j2/pull/289#discussion_r298841477
 
 

 ##########
 File path: 
log4j-api-java9/src/main/java/org/apache/logging/log4j/util/StackLocator.java
 ##########
 @@ -31,6 +32,11 @@
 
     private final static StackLocator INSTANCE = new StackLocator();
 
+    private final static ThreadLocal<CallerLocator> LOCATOR = new 
ThreadLocal<CallerLocator>() {
+        public CallerLocator initialValue() {
+            return new CallerLocator();
+        }
+    };
 
 Review comment:
   Since this is java 9, we have the option to take advantage of the java 
8`ThreadLocal.withInitial(CallerLocator::new)`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to