The HttpHost InetAddress constructor will use the InetAddress#getHostName (rather than InetAddress#getHostAddress) when provided with an InetAddress.

System.out.println(new HttpHost(InetAddress.getByAddress("127.0.0.1", new byte[] {127,0,0,1}), 80, "http"));
System.out.println(new HttpHost(InetAddress.getByAddress(new byte[] {127,0,0,1}), 80, "http"));
System.out.println(new HttpHost(InetAddress.getByAddress("somehost", new byte[] {127,0,0,1}), 80, "http"));

Produces:
http://127.0.0.1:80
http://localhost:80
http://somehost:80

This ensures that HttpHost#getHostName reflects the name wish to use (rather than the IP address).  Which can be important, for example with Cookie domains and HTTP Host: headers.