summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java')
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java6
1 files changed, 6 insertions, 0 deletions
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");
}