OPENJPA-2055: Added code to account for IPv6 addresses.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1295698 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Heath Thomann 2012-03-01 17:43:03 +00:00
parent 8971fda1aa
commit e07b3ce3cf
1 changed files with 7 additions and 1 deletions

View File

@ -118,7 +118,13 @@ public class UUIDGenerator {
IP = new byte[6];
RANDOM.nextBytes(IP);
System.arraycopy(ip, 0, IP, 2, ip.length);
//OPENJPA-2055: account for the fact that 'getAddress'
//may return an IPv6 address which is 16 bytes wide.
for( int i = 0 ; i < ip.length; ++i ) {
IP[2+(i%4)] ^= ip[i];
}
type1Initialized = true;
}