You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by pa...@apache.org on 2019/08/04 16:22:00 UTC

[commons-text] branch master updated: [TEXT-170] Add String lookup for host names and IP addresses

This is an automated email from the ASF dual-hosted git repository.

pascalschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-text.git


The following commit(s) were added to refs/heads/master by this push:
     new 420ae4f  [TEXT-170] Add String lookup for host names and IP addresses
420ae4f is described below

commit 420ae4ff04e307d7e82e1db3d5779f153158171d
Author: Pascal Schumacher <pa...@gmx.net>
AuthorDate: Sun Aug 4 18:21:45 2019 +0200

    [TEXT-170] Add String lookup for host names and IP addresses
    
    Fix checkstyle violations.
---
 src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java | 3 ++-
 src/test/java/org/apache/commons/text/lookup/DnsStringLookupTest.java | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java b/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
index b548503..89b6cb2 100644
--- a/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
+++ b/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
@@ -599,7 +599,8 @@ public final class StringLookupFactory {
      * StringSubstitutor.createInterpolator().replace("... ${java:version} ..."));
      * </pre>
      * <p>
-     * The above examples convert {@code "version"} to the current VM version, for example, {@code "Java version 1.8.0_181"}.
+     * The above examples convert {@code "version"} to the current VM version, for example,
+     * {@code "Java version 1.8.0_181"}.
      * </p>
      *
      * @return The JavaPlatformStringLookup singleton instance.
diff --git a/src/test/java/org/apache/commons/text/lookup/DnsStringLookupTest.java b/src/test/java/org/apache/commons/text/lookup/DnsStringLookupTest.java
index fd0e7c0..e3af1ab 100644
--- a/src/test/java/org/apache/commons/text/lookup/DnsStringLookupTest.java
+++ b/src/test/java/org/apache/commons/text/lookup/DnsStringLookupTest.java
@@ -62,8 +62,9 @@ public class DnsStringLookupTest {
         final InetAddress[] localHostAll = InetAddress.getAllByName(address);
         boolean matched = false;
         for (InetAddress localHost : localHostAll) {
-            if (localHost.getHostName().equals(DnsStringLookup.INSTANCE.lookup("name|" + address + "")))
+            if (localHost.getHostName().equals(DnsStringLookup.INSTANCE.lookup("name|" + address + ""))) {
                 matched = true;
+            }
         }
         Assertions.assertTrue(matched);
     }