8286393: Address possibly lossy conversions in java.rmi

8286388: Address possibly lossy conversions in java.smartcardio

Reviewed-by: lancea, dfuchs, smarks
This commit is contained in:
Roger Riggs 2022-05-13 14:40:22 +00:00
parent cbe7e7bd7f
commit 237f28014a
2 changed files with 6 additions and 6 deletions

View File

@ -103,7 +103,7 @@ class LogInputStream extends InputStream {
return 0; return 0;
n = (length < n) ? length : n; n = (length < n) ? length : n;
n = in.skip(n); n = in.skip(n);
length -= n; length -= (int) n;
return n; return n;
} }

View File

@ -255,14 +255,14 @@ final class ChannelImpl extends CardChannel {
if (channel <= 3) { if (channel <= 3) {
// mask of bits 7, 1, 0 (channel number) // mask of bits 7, 1, 0 (channel number)
// 0xbc == 1011 1100 // 0xbc == 1011 1100
com[0] &= 0xbc; com[0] &= (byte) 0xbc;
com[0] |= channel; com[0] |= (byte) channel;
} else if (channel <= 19) { } else if (channel <= 19) {
// mask of bits 7, 3, 2, 1, 0 (channel number) // mask of bits 7, 3, 2, 1, 0 (channel number)
// 0xbc == 1011 0000 // 0xbc == 1011 0000
com[0] &= 0xb0; com[0] &= (byte) 0xb0;
com[0] |= 0x40; com[0] |= (byte) 0x40;
com[0] |= (channel - 4); com[0] |= (byte) (channel - 4);
} else { } else {
throw new RuntimeException("Unsupported channel number: " + channel); throw new RuntimeException("Unsupported channel number: " + channel);
} }