komatzu1337 commented on code in PR #1382:
URL: https://github.com/apache/commons-lang/pull/1382#discussion_r2093493135


##########
src/main/java/org/apache/commons/lang3/RegExUtils.java:
##########
@@ -751,4 +755,64 @@ private static String toStringOrNull(final CharSequence 
text) {
     public RegExUtils() {
         // empty
     }
+
+
+    public class MatchFinder {
+
+        /**
+         * Finds all matches in the given text according to the specified 
pattern.
+         *
+         * @param text    the text to search for matches
+         * @param pattern the pattern to search for
+         * @return a list of found matches
+         * @throws IllegalArgumentException if text or pattern is null
+         */
+        public List<String> findMatches(CharSequence text, Pattern pattern) {
+            if (text == null)
+                throw new IllegalArgumentException("Text must not be null");
+
+            if (pattern == null)
+                throw new IllegalArgumentException("Pattern must not be null");

Review Comment:
   ```suggestion
            if (text == null || pattern == null){
               return Collections.emptyList();
           }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to