This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git


The following commit(s) were added to refs/heads/master by this push:
     new e68c9e2a Implicit narrowing conversion in compound assignment.
e68c9e2a is described below

commit e68c9e2acbdd8099fec4b1635985a801d2fd3f61
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Fri Nov 4 17:41:47 2022 -0400

    Implicit narrowing conversion in compound assignment.
---
 .../compressors/bzip2/BZip2CompressorOutputStream.java     | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
 
b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
index 3c565b56..f0887232 100644
--- 
a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
+++ 
b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
@@ -841,12 +841,12 @@ public class BZip2CompressorOutputStream extends 
CompressorOutputStream
 
                     for (int i = gs; i <= ge; i++) {
                         final int icv = sfmap[i];
-                        cost0 += len_0[icv] & mask;
-                        cost1 += len_1[icv] & mask;
-                        cost2 += len_2[icv] & mask;
-                        cost3 += len_3[icv] & mask;
-                        cost4 += len_4[icv] & mask;
-                        cost5 += len_5[icv] & mask;
+                        cost0 += (short) (len_0[icv] & mask);
+                        cost1 += (short) (len_1[icv] & mask);
+                        cost2 += (short) (len_2[icv] & mask);
+                        cost3 += (short) (len_3[icv] & mask);
+                        cost4 += (short) (len_4[icv] & mask);
+                        cost5 += (short) (len_5[icv] & mask);
                     }
 
                     cost[0] = cost0;
@@ -864,7 +864,7 @@ public class BZip2CompressorOutputStream extends 
CompressorOutputStream
                     for (int i = gs; i <= ge; i++) {
                         final int icv = sfmap[i];
                         for (int t = nGroups; --t >= 0;) {
-                            cost[t] += len[t][icv] & mask;
+                            cost[t] += (short) (len[t][icv] & mask);
                         }
                     }
                 }

Reply via email to