[tomcat] branch 7.0.x updated: Revert back-ports that created a requirement for Java 7+

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[tomcat] branch 7.0.x updated: Revert back-ports that created a requirement for Java 7+

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


The following commit(s) were added to refs/heads/7.0.x by this push:
     new 9c9e49c  Revert back-ports that created a requirement for Java 7+
9c9e49c is described below

commit 9c9e49c081a214e6025f85909f8fc879508de4cf
Author: Mark Thomas <[hidden email]>
AuthorDate: Sun Jan 17 18:03:44 2021 +0000

    Revert back-ports that created a requirement for Java 7+
---
 java/org/apache/tomcat/util/codec/binary/Base64.java            | 5 +++--
 java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java | 6 ++++--
 2 files changed, 7 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 77ff7eb..1beca1a 100644
--- a/java/org/apache/tomcat/util/codec/binary/Base64.java
+++ b/java/org/apache/tomcat/util/codec/binary/Base64.java
@@ -17,7 +17,6 @@
 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>.
@@ -332,7 +331,9 @@ public class Base64 extends BaseNCodec {
      * @since 1.4
      */
     public static byte[] encodeInteger(final BigInteger bigInteger) {
-        Objects.requireNonNull(bigInteger,sm.getString("base64.nullEncodeParameter"));
+        if (bigInteger == null) {
+            throw new NullPointerException(sm.getString("base64.nullEncodeParameter"));
+        }
         return encodeBase64(toIntegerBytes(bigInteger), false);
     }
 
diff --git a/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java b/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
index ad2a470..2e95798 100644
--- a/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
+++ b/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
@@ -23,7 +23,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.Objects;
 
 import org.apache.tomcat.util.http.fileupload.impl.FileItemIteratorImpl;
 import org.apache.tomcat.util.http.fileupload.impl.FileItemStreamImpl;
@@ -281,7 +280,10 @@ public abstract class FileUploadBase {
         boolean successful = false;
         try {
             final FileItemIterator iter = getItemIterator(ctx);
-            final FileItemFactory fileItemFactory = Objects.requireNonNull(getFileItemFactory(), "No FileItemFactory has been set.");
+            final FileItemFactory fileItemFactory = getFileItemFactory();
+            if (fileItemFactory == null) {
+                throw new NullPointerException("No FileItemFactory has been set.");
+            }
             while (iter.hasNext()) {
                 final FileItemStream item = iter.next();
                 // Don't use getName() here to prevent an InvalidFileNameException.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]