Current implementation produces hashcode where ip/port combos "1.2.3.4:2" and "1.2.3.5:1" result in the same hash code.
Existing code:
public final int hashCode()
Manual test code:
InetAddress ip1 = InetAddress.getByAddress( new byte[]
);
int port1 = 2;
int hash1 = ip1.hashCode() + port1;
System.out.println( "hash1 = " + hash1 );
InetAddress ip2 = InetAddress.getByAddress( new byte[]
{1,2,3,5} );
int port2 = 1;
int hash2 = ip2.hashCode() + port2;
System.out.println( "hash2 = " + hash2 );
- is related to
-
JGRP-129 Logical addresses
- Resolved