AFAIK, this will will fail in all branches afrer HDFS-10923 in windows at least.
Problem with InetSocketAddress#getHostName which will return localhost and 127.0.0.1 for linux and windows.
Sample program which I tried.
InetSocketAddress inet = new InetSocketAddress("127.0.0.1",9820);
Uploaded the patch to handle this..Kindly review.