From 1c8bc7132d980c1ff2dbd6b9af579c3b2fd8c63e Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Sun, 3 Apr 2016 19:22:48 -0400 Subject: General code refactoring and maintenance --- BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java b/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java index b7d20aa..a73292c 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java @@ -28,6 +28,12 @@ public class StringUtils { * group is then matched one or more times and the pattern matches * to the end of the string */ + if (input == null) { + throw new NullPointerException("Input must not be null"); + } else if (regex == null) { + throw new NullPointerException("Regex must not be null"); + } + return input.matches("\\A(?:" + regex + ")+\\Z"); } -- cgit v1.2.3