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-fileupload.git
commit 00f6d040674a7ddcc1b5f9fe51c245480d4fcada Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Fri Sep 15 16:34:33 2023 -0400 Fail fast on null inputs to org.apache.commons.fileupload2.core.AbstractRequestContext.AbstractRequestContext(Function<String, String>, LongSupplier, T) --- .../apache/commons/fileupload2/core/AbstractRequestContext.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/commons-fileupload2-core/src/main/java/org/apache/commons/fileupload2/core/AbstractRequestContext.java b/commons-fileupload2-core/src/main/java/org/apache/commons/fileupload2/core/AbstractRequestContext.java index 7f6cc251..f6e96fae 100644 --- a/commons-fileupload2-core/src/main/java/org/apache/commons/fileupload2/core/AbstractRequestContext.java +++ b/commons-fileupload2-core/src/main/java/org/apache/commons/fileupload2/core/AbstractRequestContext.java @@ -17,6 +17,7 @@ package org.apache.commons.fileupload2.core; +import java.util.Objects; import java.util.function.Function; import java.util.function.LongSupplier; @@ -42,12 +43,12 @@ public abstract class AbstractRequestContext<T> implements RequestContext { * * @param contentLengthString How to get the content length string. * @param contentLengthDefault How to get the content length default. - * @param request TODO + * @param request The request. */ protected AbstractRequestContext(final Function<String, String> contentLengthString, final LongSupplier contentLengthDefault, final T request) { - this.contentLengthString = contentLengthString; - this.contentLengthDefault = contentLengthDefault; - this.request = request; + this.contentLengthString = Objects.requireNonNull(contentLengthString, "contentLengthString"); + this.contentLengthDefault = Objects.requireNonNull(contentLengthDefault, "contentLengthDefault"); + this.request = Objects.requireNonNull(request, "request"); } /**