You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/01/15 15:18:27 UTC
[tomcat] 01/02: Align with Codec
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit ac39b5658cfc875a0c9dc339eb114256182a92ce
Author: Mark Thomas <ma...@apache.org>
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 08d7d34..3cd4f1a 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);
}
@@ -360,7 +359,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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org