File tree Expand file tree Collapse file tree
main/java/org/apache/commons/codec/cli
test/java/org/apache/commons/codec/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222import java .security .MessageDigest ;
2323import java .util .Arrays ;
2424import java .util .Locale ;
25+ import java .util .Objects ;
2526
2627import org .apache .commons .codec .binary .Hex ;
2728import org .apache .commons .codec .digest .DigestUtils ;
@@ -58,9 +59,7 @@ public static void main(final String[] args) throws IOException {
5859 private final String [] inputs ;
5960
6061 private Digest (final String [] args ) {
61- if (args == null ) {
62- throw new IllegalArgumentException ("args" );
63- }
62+ Objects .requireNonNull (args );
6463 final int argsLength = args .length ;
6564 if (argsLength == 0 ) {
6665 throw new IllegalArgumentException (
Original file line number Diff line number Diff line change @@ -38,6 +38,6 @@ public void testEmptyArguments() {
3838 */
3939 @ Test
4040 public void testNullArguments () {
41- assertThrows (IllegalArgumentException .class , () -> Digest .main (null ));
41+ assertThrows (NullPointerException .class , () -> Digest .main (null ));
4242 }
4343}
You can’t perform that action at this time.
0 commit comments