You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EthernetAddress(long) retains bits outside the documented address range #149
The EthernetAddress(long) constructor documents that the address consists of the lowest six bytes, but retains all 64 bits. Two objects can therefore have identical string/byte representations while comparing unequal.
EthernetAddressaddress = newEthernetAddress(0x00010123456789abL);
EthernetAddresscanonical = newEthernetAddress("01:23:45:67:89:ab");
address.toString().equals(canonical.toString()); // trueaddress.equals(canonical); // falseaddress.toLong(); // 0x00010123456789ab, including the extra high bit
EthernetAddress.valueOf(-1L) also fails an equality round trip through either its string or byte representation.
Expected: ignore the upper 16 bits as documented, keeping toLong, equality, hash codes, ordering and round trips consistent with the other constructors.
Activity