don't throw UnknownHostException from InetAddress.getByName("0.0.0.0")

0.0.0.0 means any local interface, which is commonly used by servers
which wish to listen on all interfaces.
This commit is contained in:
Joel Dice
2013-12-18 10:12:10 -07:00
parent dae1f81d27
commit 5f40c1642e
3 changed files with 23 additions and 4 deletions

View File

@ -135,7 +135,7 @@ public class Misc {
}
}
public static void main(String[] args) {
public static void main(String[] args) throws Exception {
zam();
Bim bim = new Baz();
@ -287,6 +287,10 @@ public class Misc {
} catch (IOException e) {
throw new RuntimeException(e);
}
expect(java.util.Arrays.equals
(new byte[] { 0, 0, 0, 0 },
java.net.InetAddress.getByName("0.0.0.0").getAddress()));
}
protected class Protected { }