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

zchovan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 99c137d66 [java] Fix compiler warnings in array support
99c137d66 is described below

commit 99c137d66ff3e498799d82d68c11bd16d4764d3a
Author: Gabriella Lotz <[email protected]>
AuthorDate: Fri Nov 21 12:20:16 2025 +0100

    [java] Fix compiler warnings in array support
    
    - Add explicit byte cast in Array1dSerdes validity bitmap logic
    - Use %s instead of %d in Preconditions format string
    - Remove unused variable in ArrayCellViewHelper.toDecimalArray()
    - Remove unused helper method in TestArraySerdes
    
    Change-Id: I52c9862a9019441e47f749fa5326f314470f91fc
    Reviewed-on: http://gerrit.cloudera.org:8080/23703
    Reviewed-by: Zoltan Chovan <[email protected]>
    Tested-by: Alexey Serbin <[email protected]>
    Reviewed-by: Alexey Serbin <[email protected]>
---
 .../java/org/apache/kudu/client/Array1dSerdes.java |  4 +-
 .../apache/kudu/client/ArrayCellViewHelper.java    |  1 -
 .../org/apache/kudu/client/TestArraySerdes.java    | 44 ----------------------
 3 files changed, 2 insertions(+), 47 deletions(-)

diff --git 
a/java/kudu-client/src/main/java/org/apache/kudu/client/Array1dSerdes.java 
b/java/kudu-client/src/main/java/org/apache/kudu/client/Array1dSerdes.java
index bd3b0b830..139777f6f 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/Array1dSerdes.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/Array1dSerdes.java
@@ -107,7 +107,7 @@ public class Array1dSerdes {
     Arrays.fill(validityBytes, (byte)0);
     for (int idx = 0; idx < validityBitNum; ++idx) {
       if (validity[idx]) {
-        validityBytes[idx >> 3] |= 1 << (idx & 7);
+        validityBytes[idx >> 3] |= (byte)(1 << (idx & 7));
       }
     }
     return Content.createValidityVector(b, validityBytes);
@@ -146,7 +146,7 @@ public class Array1dSerdes {
     }
     final ByteVector vv = c.validityVector();
     Preconditions.checkState(vv.length() == n,
-        "unexpected length of validityVector: %d (expected %d)", vv.length(), 
n);
+        "unexpected length of validityVector: %s (expected %s)", vv.length(), 
n);
     for (int idx = 0; idx < m; ++idx) {
       validity[idx] = ((vv.get(idx >> 3) & (1 << (idx & 7))) != 0);
     }
diff --git 
a/java/kudu-client/src/main/java/org/apache/kudu/client/ArrayCellViewHelper.java
 
b/java/kudu-client/src/main/java/org/apache/kudu/client/ArrayCellViewHelper.java
index 937b26779..679ab4c13 100644
--- 
a/java/kudu-client/src/main/java/org/apache/kudu/client/ArrayCellViewHelper.java
+++ 
b/java/kudu-client/src/main/java/org/apache/kudu/client/ArrayCellViewHelper.java
@@ -235,7 +235,6 @@ class ArrayCellViewHelper {
   // ----------------------------------------------------------------------
 
   static BigDecimal[] toDecimalArray(ArrayCellView view, int precision, int 
scale) {
-    boolean[] v;
     BigDecimal[] out;
     if (precision <= 9) {
       Int32Array arr = view.asInt32FB();
diff --git 
a/java/kudu-client/src/test/java/org/apache/kudu/client/TestArraySerdes.java 
b/java/kudu-client/src/test/java/org/apache/kudu/client/TestArraySerdes.java
index da31c3b47..42b83d915 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestArraySerdes.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestArraySerdes.java
@@ -26,50 +26,6 @@ import java.util.Arrays;
 import org.junit.Test;
 
 public class TestArraySerdes {
-  // Helper to box primitive arrays for comparison
-  private static Object[] toObjectArray(Object arr) {
-    if (arr instanceof int[]) {
-      return Arrays.stream((int[]) arr).boxed().toArray();
-    }
-    if (arr instanceof long[]) {
-      return Arrays.stream((long[]) arr).boxed().toArray();
-    }
-    if (arr instanceof double[]) {
-      return Arrays.stream((double[]) arr).boxed().toArray();
-    }
-    if (arr instanceof float[]) {
-      float[] f = (float[]) arr;
-      Float[] boxed = new Float[f.length];
-      for (int i = 0; i < f.length; i++) {
-        boxed[i] = f[i];
-      }
-      return boxed;
-    }
-    if (arr instanceof short[]) {
-      short[] s = (short[]) arr;
-      Short[] boxed = new Short[s.length];
-      for (int i = 0; i < s.length; i++) {
-        boxed[i] = s[i];
-      }
-      return boxed;
-    }
-    if (arr instanceof byte[]) {
-      byte[] b = (byte[]) arr;
-      Byte[] boxed = new Byte[b.length];
-      for (int i = 0; i < b.length; i++) {
-        boxed[i] = b[i];
-      }
-      return boxed;
-    }
-    if (arr instanceof String[]) {
-      return (String[]) arr;
-    }
-    if (arr instanceof byte[][]) {
-      return (byte[][]) arr;
-    }
-    throw new IllegalArgumentException("Unsupported array type: " + 
arr.getClass());
-  }
-
   // ----------------------------
   // INT8
   // ----------------------------

Reply via email to