garydgregory commented on a change in pull request #565:
URL: https://github.com/apache/logging-log4j2/pull/565#discussion_r693526761



##########
File path: 
log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
##########
@@ -609,7 +610,13 @@ public Configuration setConfiguration(final Configuration 
config) {
             final ConcurrentMap<String, String> map = 
config.getComponent(Configuration.CONTEXT_PROPERTIES);
 
             try { // LOG4J2-719 network access may throw 
android.os.NetworkOnMainThreadException
-                map.putIfAbsent("hostName", NetUtils.getLocalHostname());
+                // LOG4J2-2808 don't block unless necessary
+                map.computeIfAbsent("hostName", new Function<String, String>() 
{

Review comment:
       You don't have to be so verbose here, use () -> or ::




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to