commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1100564 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/net/SocketAddress.java test/org/apache/commons/runtime/TestAddress.java
Date Sat, 07 May 2011 16:31:40 GMT
Author: mturk
Date: Sat May  7 16:31:40 2011
New Revision: 1100564

URL: http://svn.apache.org/viewvc?rev=1100564&view=rev
Log:
Cleanup code

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddress.java
    commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestAddress.java

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddress.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddress.java?rev=1100564&r1=1100563&r2=1100564&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddress.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddress.java
Sat May  7 16:31:40 2011
@@ -53,51 +53,24 @@ public abstract class SocketAddress exte
 
     /**
      * Creates an new object
+     * @param family indicates a protocl family accepted.
      */
     protected SocketAddress(AddressFamily family)
     {
         super(family);
     }
 
-    protected SocketAddress(byte[] sockaddr)
-    {
-        super.sa = sockaddr;
-    }
     /**
      * Create a new socket address object.
      *
-     * @param hostname a host(node) name or a numeric host address string.
-     * @param servname a service name or a port number represented as string.
-     * @param family indicates a protocl family accepted.
+     * @param sockaddr binary socket address.
      */
-    /*
-    protected SocketAddress(AddressFamily family, String hostname, String servname, int port)
-        throws InvalidArgumentException,
-               NetworkException
-    {
-        super(family);
-        if (family == AddressFamily.LOCAL)
-            throw new InvalidArgumentException();
-        if (hostname == null && family != AddressFamily.UNSPEC) {
-            throw new InvalidArgumentException();
-        }
-        super.sa = SocketAddressImpl.getnameinfo(family, hostname, servname, port);
-    }
-
-    protected SocketAddress(AddressFamily family, String hostname, String servname)
-        throws InvalidArgumentException,
-               NetworkException
+    protected SocketAddress(byte[] sockaddr)
     {
-        this(family, hostname, servname, 0);
+        super();
+        super.sa = sockaddr;
     }
 
-    protected SocketAddress(AddressFamily family, String hostname)
-        throws InvalidArgumentException,
-               NetworkException
-    {
-        this(family, hostname, null, 0);
-    }
-    */
     /**
      * Gets the hostname of this socket.
      * <p>

Modified: commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestAddress.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestAddress.java?rev=1100564&r1=1100563&r2=1100564&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestAddress.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestAddress.java
Sat May  7 16:31:40 2011
@@ -78,7 +78,7 @@ public class TestAddress extends Assert
         throws IOException
     {
         InetSocketAddress a = new InetSocketAddress("127.0.0.1");
-        System.out.println("localhost: " + a.getFamily());
+        System.out.println("127.0.0.1: " + a.getFamily());
         assertEquals(a.getFamily(), AddressFamily.INET);
     }
 



Mime
View raw message