river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter_firmst...@apache.org
Subject svn commit: r1448023 - /river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/QAConfig.java
Date Wed, 20 Feb 2013 07:55:38 GMT
Author: peter_firmstone
Date: Wed Feb 20 07:55:38 2013
New Revision: 1448023

URL: http://svn.apache.org/r1448023
Log:
On some platforms an unknown domain doesn't cause an UnknownHostException to be thrown, check
the domain exists before returning hostname.

Modified:
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/QAConfig.java

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/QAConfig.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/QAConfig.java?rev=1448023&r1=1448022&r2=1448023&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/QAConfig.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/QAConfig.java Wed Feb
20 07:55:38 2013
@@ -2194,6 +2194,9 @@ public class QAConfig implements Seriali
 	return getConstrainedLocator(loc);
     }
 
+    private static final CharSequence NXDOMAIN = "NXDOMAIN";
+    private static final CharSequence nxdomain = "nxdomain";
+    
     /**
      * Convert a host name to canonical form. If the name cannot
      * be converted for any reason, the original name is returned.
@@ -2204,7 +2207,10 @@ public class QAConfig implements Seriali
     private static String getFQHostName(String hostName) {
 	try {
 	    InetAddress hostAddr = InetAddress.getByName(hostName);
-	    hostName = hostAddr.getCanonicalHostName();
+	    String fqHostName = hostAddr.getCanonicalHostName();
+            if (fqHostName.contains(NXDOMAIN)) return hostName;
+            if (fqHostName.contains(nxdomain)) return hostName;
+            return fqHostName;
 	} catch (UnknownHostException ignore) {
             logger.severe("InetAddress threw unknown host exception: " + hostName);
 	}



Mime
View raw message