8286378: Address possibly lossy conversions in java.base

Reviewed-by: naoto, xuelei, bpb, alanb
This commit is contained in:
Roger Riggs 2022-05-12 16:50:36 +00:00
parent 0a6832b24c
commit 17c52789b7
32 changed files with 68 additions and 71 deletions

View file

@ -152,7 +152,7 @@ public final class UUID implements java.io.Serializable, Comparable<UUID> {
randomBytes[6] &= 0x0f; /* clear version */
randomBytes[6] |= 0x40; /* set to version 4 */
randomBytes[8] &= 0x3f; /* clear variant */
randomBytes[8] |= 0x80; /* set to IETF variant */
randomBytes[8] |= (byte) 0x80; /* set to IETF variant */
return new UUID(randomBytes);
}
@ -176,7 +176,7 @@ public final class UUID implements java.io.Serializable, Comparable<UUID> {
md5Bytes[6] &= 0x0f; /* clear version */
md5Bytes[6] |= 0x30; /* set to version 3 */
md5Bytes[8] &= 0x3f; /* clear variant */
md5Bytes[8] |= 0x80; /* set to IETF variant */
md5Bytes[8] |= (byte) 0x80; /* set to IETF variant */
return new UUID(md5Bytes);
}