You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/01/17 23:48:01 UTC

[GitHub] [iceberg] kbendick commented on a change in pull request #2102: [Misc] Remove non-test uses of commons-lang3

kbendick commented on a change in pull request #2102:
URL: https://github.com/apache/iceberg/pull/2102#discussion_r559257991



##########
File path: core/src/main/java/org/apache/iceberg/util/ArrayUtil.java
##########
@@ -59,4 +68,221 @@ private ArrayUtil() {
       return null;
     }
   }
+
+  /**
+   * <p>Converts an array of object Booleans to primitives.
+   *
+   * <p>This method returns {@code null} for a {@code null} input array.
+   *
+   * @param array  a {@code Boolean} array, may be {@code null}
+   * @return a {@code boolean} array, {@code null} if null array input
+   * @throws NullPointerException if array content is {@code null}
+   */
+  public static boolean[] toPrimitive(final Boolean[] array) {
+    if (array == null) {
+      return null;
+    } else if (array.length == 0) {
+      return EMPTY_BOOLEAN_ARRAY;
+    }
+    final boolean[] result = new boolean[array.length];
+    for (int i = 0; i < array.length; i++) {
+      result[i] = array[i].booleanValue();
+    }
+    return result;
+  }

Review comment:
       If the code for these comes from `org.apache.commons:commons-lang3`, it should be credited as such some where in the file.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org