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-net.git


The following commit(s) were added to refs/heads/master by this push:
     new ffee3c96 Use Objects.requireNonNull()
ffee3c96 is described below

commit ffee3c96dab59aec1458930d57360b4f414442d8
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Fri May 6 08:01:54 2022 -0400

    Use Objects.requireNonNull()
---
 src/main/java/org/apache/commons/net/util/Base64.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/net/util/Base64.java 
b/src/main/java/org/apache/commons/net/util/Base64.java
index dbaa9d64..a80f8d8e 100644
--- a/src/main/java/org/apache/commons/net/util/Base64.java
+++ b/src/main/java/org/apache/commons/net/util/Base64.java
@@ -19,6 +19,7 @@ package org.apache.commons.net.util;
 
 import java.math.BigInteger;
 import java.nio.charset.StandardCharsets;
+import java.util.Objects;
 
 
 /**
@@ -351,9 +352,6 @@ public class Base64 {
      * @since 1.4
      */
     public static byte[] encodeInteger(final BigInteger bigInt) {
-        if (bigInt == null) {
-            throw new NullPointerException("encodeInteger called with null 
parameter");
-        }
         return encodeBase64(toIntegerBytes(bigInt), false);
     }
 
@@ -448,6 +446,7 @@ public class Base64 {
      * @return a byte array representation of the BigInteger parameter
      */
     static byte[] toIntegerBytes(final BigInteger bigInt) {
+        Objects.requireNonNull(bigInt, "bigInt");
         int bitlen = bigInt.bitLength();
         // round bitlen
         bitlen = ((bitlen + 7) >> 3) << 3;

Reply via email to