Skip to content

Commit 613e862

Browse files
committed
Fail-fase on null input
Javadoc
1 parent 1cc9875 commit 613e862

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/org/apache/commons/cli/TypeHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
2626
import java.util.Date;
2727
import java.util.HashMap;
2828
import java.util.Map;
29+
import java.util.Objects;
2930

3031
/**
3132
* 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 TypeHandler() {
258259
* For each entry, that Class' type must match the Converter's first type.
259260
* </p>
260261
*
261-
* @param converterMap The converter map.
262+
* @param converterMap The converter map, not null.
262263
* @since 1.7.0
263264
*/
264265
public TypeHandler(final Map<Class<?>, Converter<?, ? extends Throwable>> converterMap) {
265-
this.converterMap = converterMap;
266+
this.converterMap = Objects.requireNonNull(converterMap, "converterMap");
266267
}
267268

268269
/**

0 commit comments

Comments
 (0)