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


The following commit(s) were added to refs/heads/master by this push:
     new 615c1da  Use own validator ObjectUtils.anyNull to check null String 
input (#718)
615c1da is described below

commit 615c1dad1b2ed8901f97c6c75a89b8d49320643e
Author: Arturo Bernal <arturobern...@gmail.com>
AuthorDate: Thu Feb 25 15:43:14 2021 +0100

    Use own validator ObjectUtils.anyNull to check null String input (#718)
---
 src/main/java/org/apache/commons/lang3/RegExUtils.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/RegExUtils.java 
b/src/main/java/org/apache/commons/lang3/RegExUtils.java
index c658501..53ba4ff 100644
--- a/src/main/java/org/apache/commons/lang3/RegExUtils.java
+++ b/src/main/java/org/apache/commons/lang3/RegExUtils.java
@@ -256,7 +256,7 @@ public class RegExUtils {
      * @see java.util.regex.Pattern
      */
     public static String replaceAll(final String text, final Pattern regex, 
final String replacement) {
-        if (text == null || regex == null || replacement == null) {
+        if (ObjectUtils.anyNull(text, regex, replacement)) {
             return text;
         }
         return regex.matcher(text).replaceAll(replacement);
@@ -310,7 +310,7 @@ public class RegExUtils {
      * @see java.util.regex.Pattern#DOTALL
      */
     public static String replaceAll(final String text, final String regex, 
final String replacement) {
-        if (text == null || regex == null || replacement == null) {
+        if (ObjectUtils.anyNull(text, regex, replacement)) {
             return text;
         }
         return text.replaceAll(regex, replacement);
@@ -449,7 +449,7 @@ public class RegExUtils {
      * @see Pattern#DOTALL
      */
     public static String replacePattern(final String text, final String regex, 
final String replacement) {
-        if (text == null || regex == null || replacement == null) {
+        if (ObjectUtils.anyNull(text, regex, replacement)) {
             return text;
         }
         return Pattern.compile(regex, 
Pattern.DOTALL).matcher(text).replaceAll(replacement);

Reply via email to