This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 7.0.x
in repository
https://gitbox.apache.org/repos/asf/tomcat.gitThe following commit(s) were added to refs/heads/7.0.x by this push:
new a6d4fbe Align with Codec
a6d4fbe is described below
commit a6d4fbe876bfbcba657859dd869c4392dcb75ddd
Author: Mark Thomas <
[hidden email]>
AuthorDate: Fri Jan 15 15:07:13 2021 +0000
Align with Codec
---
java/org/apache/tomcat/util/codec/binary/Base64.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/java/org/apache/tomcat/util/codec/binary/Base64.java b/java/org/apache/tomcat/util/codec/binary/Base64.java
index 3c76ca2..77ff7eb 100644
--- a/java/org/apache/tomcat/util/codec/binary/Base64.java
+++ b/java/org/apache/tomcat/util/codec/binary/Base64.java
@@ -17,6 +17,7 @@
package org.apache.tomcat.util.codec.binary;
import java.math.BigInteger;
+import java.util.Objects;
/**
* Provides Base64 encoding and decoding as defined by <a href="
http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>.
@@ -331,9 +332,7 @@ public class Base64 extends BaseNCodec {
* @since 1.4
*/
public static byte[] encodeInteger(final BigInteger bigInteger) {
- if (bigInteger == null) {
- throw new NullPointerException(sm.getString("base64.nullEncodeParameter"));
- }
+ Objects.requireNonNull(bigInteger,sm.getString("base64.nullEncodeParameter"));
return encodeBase64(toIntegerBytes(bigInteger), false);
}
@@ -375,7 +374,7 @@ public class Base64 extends BaseNCodec {
* @since 1.5
*/
public static boolean isBase64(final byte[] arrayOctet) {
- for (byte element : arrayOctet) {
+ for (final byte element : arrayOctet) {
if (!isBase64(element) && !isWhiteSpace(element)) {
return false;
}
---------------------------------------------------------------------
To unsubscribe, e-mail:
[hidden email]
For additional commands, e-mail:
[hidden email]