Avoid using 1.7 method getHostString()