On Wed, 2008-02-06 at 23:18 +0100, Roland Weber wrote: > Hi Oleg, > > > Why not make NO_HOST a little prettier? > > > > public static final HttpHost NO_HOST = new HttpHost("", -1, ""); > > I chose an IP address for the host to make sure that > there will be no DNS lookup (though there might still > be a reverse lookup). Can we rely on an exception > being triggered for an empty string?
I believe so. We can expect any sane hostname resolution system to not resolve a blank hostname to an IP. > And can we rely > on ourselves not adding empty string checks to the > HttpHost constructor? > I believe so. This is what unit tests are for. > -1 is a magic number used in HttpHost, I wanted to > avoid that. > But there is nothing that really prevents it from being used in NO_HOST, is there? > I also want to be able to identify NO_HOST when it > appears in debug output, which is easier if the > attributes are not empty. > I believe this is just a matter of having a reasonable #toString() implementation. Cheers Oleg > cheers, > Roland > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]