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

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pdfbox-jbig2.git


The following commit(s) were added to refs/heads/master by this push:
     new a97aca7  PDFBOX-5660: Sonar fix
a97aca7 is described below

commit a97aca763a773ffde7aa39d787019c3ea601cb24
Author: Tilman Hausherr <[email protected]>
AuthorDate: Fri May 15 11:41:21 2026 +0200

    PDFBOX-5660: Sonar fix
---
 .../java/org/apache/pdfbox/jbig2/image/Scanline.java     | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/pdfbox/jbig2/image/Scanline.java 
b/src/main/java/org/apache/pdfbox/jbig2/image/Scanline.java
index faea2c0..e55d4a3 100644
--- a/src/main/java/org/apache/pdfbox/jbig2/image/Scanline.java
+++ b/src/main/java/org/apache/pdfbox/jbig2/image/Scanline.java
@@ -546,33 +546,33 @@ abstract class Scanline
             final int preShift0 = preShift[0];
             final int postShift0 = postShift[0];
             if (preShift0 != 0)
-                for (int bp = 0, b = 0; b < nx; b++)
+                for (int bp = 0, b = 0; b < nx; b++, bp++)
                 {
                     final Weighttab wtab = tabs[b];
                     final int an = wtab.weights.length;
 
                     int sum = start;
-                    for (int wp = 0, ap = wtab.i0; wp < an && ap < 
abuf.length; wp++)
+                    for (int wp = 0, ap = wtab.i0; wp < an && ap < 
abuf.length; wp++, ap++)
                     {
-                        sum += wtab.weights[wp] * (abuf[ap++] >> preShift0);
+                        sum += wtab.weights[wp] * (abuf[ap] >> preShift0);
                     }
 
                     final int t = sum >> postShift0;
-                    bbuf[bp++] = t < 0 ? 0 : t > 255 ? 255 : t;
+                    bbuf[bp] = t < 0 ? 0 : t > 255 ? 255 : t;
                 }
             else
-                for (int bp = 0, b = 0; b < nx; b++)
+                for (int bp = 0, b = 0; b < nx; b++, bp++)
                 {
                     final Weighttab wtab = tabs[b];
                     final int an = wtab.weights.length;
 
                     int sum = start;
-                    for (int wp = 0, ap = wtab.i0; wp < an && ap < 
abuf.length; wp++)
+                    for (int wp = 0, ap = wtab.i0; wp < an && ap < 
abuf.length; wp++, ap++)
                     {
-                        sum += wtab.weights[wp] * abuf[ap++];
+                        sum += wtab.weights[wp] * abuf[ap];
                     }
 
-                    bbuf[bp++] = sum >> postShift0;
+                    bbuf[bp] = sum >> postShift0;
                 }
         }
 

Reply via email to