Author: zothar
Date: 2007-09-23 16:28:32 +0000 (Sun, 23 Sep 2007)
New Revision: 15287

Modified:
   trunk/freenet/src/freenet/io/comm/Peer.java
Log:
Swap the order of two constructors in io.comm.Peer

Modified: trunk/freenet/src/freenet/io/comm/Peer.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/Peer.java 2007-09-23 16:26:56 UTC (rev 
15286)
+++ trunk/freenet/src/freenet/io/comm/Peer.java 2007-09-23 16:28:32 UTC (rev 
15287)
@@ -78,29 +78,24 @@
         * @param physical The string to be parsed, in the format [ ip or 
domain name ]:[ port number].
         * @param allowUnknown If true, allow construction of the Peer even if 
the domain name
         * lookup fails.
-        * @param checkHostnameOrIPSyntax If true, validate the syntax of the 
given DNS hostname or IPv4
-        * IP address
-        * @throws HostSyntaxException If the string is not formatted as a 
proper DNS hostname
-        * or IPv4 IP address
         * @throws PeerParseException If the string is not valid e.g. if it 
doesn't contain a 
         * port.
         * @throws UnknownHostException If allowUnknown is not set, and a 
domain name which does
         * not exist was passed in.
         */
-    public Peer(String physical, boolean allowUnknown, boolean 
checkHostnameOrIPSyntax) throws HostnameSyntaxException, PeerParseException, 
UnknownHostException {
+    public Peer(String physical, boolean allowUnknown) throws 
PeerParseException, UnknownHostException {
         int offset = physical.lastIndexOf(':'); // ipv6
         if(offset < 0) throw new PeerParseException();
         String host = physical.substring(0, offset);
-        addr = new FreenetInetAddress(host, allowUnknown, 
checkHostnameOrIPSyntax);
+        addr = new FreenetInetAddress(host, allowUnknown);
         String strport = physical.substring(offset+1);
         try {
             _port = Integer.parseInt(strport);
         } catch (NumberFormatException e) {
             throw new PeerParseException(e);
         }
-    }
+       }

-
        /**
         * Create a Peer from a string. This may be an IP address or a domain 
name. If it
         * is the latter, the name is primary rather than the IP address; 
@@ -109,23 +104,27 @@
         * @param physical The string to be parsed, in the format [ ip or 
domain name ]:[ port number].
         * @param allowUnknown If true, allow construction of the Peer even if 
the domain name
         * lookup fails.
+        * @param checkHostnameOrIPSyntax If true, validate the syntax of the 
given DNS hostname or IPv4
+        * IP address
+        * @throws HostSyntaxException If the string is not formatted as a 
proper DNS hostname
+        * or IPv4 IP address
         * @throws PeerParseException If the string is not valid e.g. if it 
doesn't contain a 
         * port.
         * @throws UnknownHostException If allowUnknown is not set, and a 
domain name which does
         * not exist was passed in.
         */
-    public Peer(String physical, boolean allowUnknown) throws 
PeerParseException, UnknownHostException {
+    public Peer(String physical, boolean allowUnknown, boolean 
checkHostnameOrIPSyntax) throws HostnameSyntaxException, PeerParseException, 
UnknownHostException {
         int offset = physical.lastIndexOf(':'); // ipv6
         if(offset < 0) throw new PeerParseException();
         String host = physical.substring(0, offset);
-        addr = new FreenetInetAddress(host, allowUnknown);
+        addr = new FreenetInetAddress(host, allowUnknown, 
checkHostnameOrIPSyntax);
         String strport = physical.substring(offset+1);
         try {
             _port = Integer.parseInt(strport);
         } catch (NumberFormatException e) {
             throw new PeerParseException(e);
         }
-       }
+    }

     public Peer(FreenetInetAddress addr, int port) {
        this.addr = addr;


Reply via email to