qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r743029 - /qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/NetMatcher.java
Date Tue, 10 Feb 2009 17:39:26 GMT
Author: aidan
Date: Tue Feb 10 17:39:25 2009
New Revision: 743029

URL: http://svn.apache.org/viewvc?rev=743029&view=rev
Log:
Change package, remove dependency on Java DNS server

Modified:
    qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/NetMatcher.java

Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/NetMatcher.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/NetMatcher.java?rev=743029&r1=743028&r2=743029&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/NetMatcher.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/NetMatcher.java Tue Feb
10 17:39:25 2009
@@ -15,9 +15,10 @@
  * permissions and limitations under the License.                      *
  ***********************************************************************/
 
-package org.apache.james.util;
+package org.apache.qpid.util;
 
 import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.util.Collection;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -62,7 +63,7 @@
 
         try
         {
-            ip = org.apache.james.dnsserver.DNSServer.getByName(hostIP);
+            ip = InetAddress.getByName(hostIP);
         }
         catch (java.net.UnknownHostException uhe)
         {
@@ -130,7 +131,7 @@
 
     public boolean contains(final String name) throws java.net.UnknownHostException
     {
-        return network.equals(maskIP(org.apache.james.dnsserver.DNSServer.getByName(name),
netmask));
+        return network.equals(maskIP(InetAddress.getByName(name), netmask));
     }
 
     public boolean contains(final InetAddress ip)
@@ -164,8 +165,8 @@
             else if (netspec.indexOf('.', iSlash) == -1) netspec = normalizeFromCIDR(netspec);
         }
 
-        return new InetNetwork(org.apache.james.dnsserver.DNSServer.getByName(netspec.substring(0,
netspec.indexOf('/'))),
-                               org.apache.james.dnsserver.DNSServer.getByName(netspec.substring(netspec.indexOf('/')
+ 1)));
+        return new InetNetwork(InetAddress.getByName(netspec.substring(0, netspec.indexOf('/'))),
+                InetAddress.getByName(netspec.substring(netspec.indexOf('/') + 1)));
     }
 
     public static InetAddress maskIP(final byte[] ip, final byte[] mask)



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message