You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2015/09/18 17:04:45 UTC

logging-log4j2 git commit: Refactor duplicate string into constant.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master fddd1c2fc -> 04fa4f27c


Refactor duplicate string into constant.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/04fa4f27
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/04fa4f27
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/04fa4f27

Branch: refs/heads/master
Commit: 04fa4f27c39ce9bb62baa101f12876355486111e
Parents: fddd1c2
Author: ggregory <gg...@apache.org>
Authored: Fri Sep 18 08:04:42 2015 -0700
Committer: ggregory <gg...@apache.org>
Committed: Fri Sep 18 08:04:42 2015 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/logging/log4j/core/util/NetUtils.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/04fa4f27/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NetUtils.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NetUtils.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NetUtils.java
index c2d1a8f..6b97cce 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NetUtils.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NetUtils.java
@@ -31,6 +31,7 @@ import org.apache.logging.log4j.status.StatusLogger;
 public final class NetUtils {
 
     private static final Logger LOGGER = StatusLogger.getLogger();
+    private static final String UNKNOWN_LOCALHOST = "UNKNOWN_LOCALHOST";
 
     private NetUtils() {
     }
@@ -64,10 +65,10 @@ public final class NetUtils {
                 }
             } catch (final SocketException se) {
                 LOGGER.error("Could not determine local host name", uhe);
-                return "UNKNOWN_LOCALHOST";
+                return UNKNOWN_LOCALHOST;
             }
             LOGGER.error("Could not determine local host name", uhe);
-            return "UNKNOWN_LOCALHOST";
+            return UNKNOWN_LOCALHOST;
         }
     }