Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Unified Diff: mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java

Issue 1296243003: Fix errorprone NarrowingCompoundAssignment error. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
diff --git a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
index c4e5d787e849aa27375c3cfc0dc6ae67f79e9120..3541f214a909019517b0976858ccd8353cbb3b27 100644
--- a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
+++ b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
@@ -166,7 +166,7 @@ public class Encoder {
public void encode(boolean v, int offset, int bit) {
if (v) {
byte encodedValue = mEncoderState.byteBuffer.get(mBaseOffset + offset);
- encodedValue |= 1 << bit;
+ encodedValue |= (byte) (1 << bit);
mEncoderState.byteBuffer.put(mBaseOffset + offset, encodedValue);
}
}
@@ -334,7 +334,7 @@ public class Encoder {
for (int j = 0; j < BindingsHelper.ALIGNMENT; ++j) {
int booleanIndex = BindingsHelper.ALIGNMENT * i + j;
if (booleanIndex < v.length && v[booleanIndex]) {
- bytes[i] |= (1 << j);
+ bytes[i] |= (byte) (1 << j);
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698