You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/04/08 16:08:36 UTC

(commons-cli) 02/02: Fail-fase on null input

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

commit 613e86252b1e6add149f6cabec13d2415725d32f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Apr 8 12:08:30 2024 -0400

    Fail-fase on null input
    
    Javadoc
---
 src/main/java/org/apache/commons/cli/TypeHandler.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/cli/TypeHandler.java b/src/main/java/org/apache/commons/cli/TypeHandler.java
index 86a7da7..3ec9a51 100644
--- a/src/main/java/org/apache/commons/cli/TypeHandler.java
+++ b/src/main/java/org/apache/commons/cli/TypeHandler.java
@@ -26,6 +26,7 @@ import java.nio.file.Path;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 
 /**
  * TypeHandler will handle the pluggable conversion and verification of Option types. It handles the mapping of classes to bot converters and verifiers. It
@@ -258,11 +259,11 @@ public class TypeHandler {
      * For each entry, that Class' type must match the Converter's first type.
      * </p>
      *
-     * @param converterMap The converter map.
+     * @param converterMap The converter map, not null.
      * @since 1.7.0
      */
     public TypeHandler(final Map<Class<?>, Converter<?, ? extends Throwable>> converterMap) {
-        this.converterMap = converterMap;
+        this.converterMap = Objects.requireNonNull(converterMap, "converterMap");
     }
 
     /**