mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
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:
@ -19,9 +19,6 @@ public class InetAddress {
|
||||
private InetAddress(String name) throws UnknownHostException {
|
||||
this.name = name;
|
||||
this.ip = ipv4AddressForName(name);
|
||||
if (ip == 0) {
|
||||
throw new UnknownHostException(name);
|
||||
}
|
||||
}
|
||||
|
||||
public String getHostName() {
|
||||
|
@ -286,6 +286,24 @@ public class Arrays {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean equals(byte[] a, byte[] b) {
|
||||
if(a == b) {
|
||||
return true;
|
||||
}
|
||||
if(a == null || b == null) {
|
||||
return false;
|
||||
}
|
||||
if(a.length != b.length) {
|
||||
return false;
|
||||
}
|
||||
for(int i = 0; i < a.length; i++) {
|
||||
if(a[i] != b[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static <T> List<T> asList(final T ... array) {
|
||||
return new AbstractList<T>() {
|
||||
public int size() {
|
||||
|
Reference in New Issue
Block a user