Skip to content

Commit

Permalink
8286393: Address possibly lossy conversions in java.rmi
Browse files Browse the repository at this point in the history
8286388: Address possibly lossy conversions in java.smartcardio

Reviewed-by: lancea, dfuchs, smarks
  • Loading branch information
Roger Riggs committed May 13, 2022
1 parent cbe7e7b commit 237f280
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/java.rmi/share/classes/sun/rmi/log/LogInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public long skip(long n) throws IOException {
return 0;
n = (length < n) ? length : n;
n = in.skip(n);
length -= n;
length -= (int) n;
return n;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,14 @@ private void setChannel(byte[] com) {
if (channel <= 3) {
// mask of bits 7, 1, 0 (channel number)
// 0xbc == 1011 1100
com[0] &= 0xbc;
com[0] |= channel;
com[0] &= (byte) 0xbc;
com[0] |= (byte) channel;
} else if (channel <= 19) {
// mask of bits 7, 3, 2, 1, 0 (channel number)
// 0xbc == 1011 0000
com[0] &= 0xb0;
com[0] |= 0x40;
com[0] |= (channel - 4);
com[0] &= (byte) 0xb0;
com[0] |= (byte) 0x40;
com[0] |= (byte) (channel - 4);
} else {
throw new RuntimeException("Unsupported channel number: " + channel);
}
Expand Down

0 comments on commit 237f280

Please sign in to comment.