You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2026/06/13 15:25:41 UTC
(commons-validator) branch master updated (d25e561f -> fc7e6029)
This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git
from d25e561f Merge pull request #395 from sahvx655-wq/regex-validate-null-group
new 86464fd0 Fix RegexValidator.validate() returning null for a valid match (#395).
new fc7e6029 Javadoc and comments
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/changes/changes.xml | 1 +
.../commons/validator/routines/RegexValidator.java | 22 +++++++++++-----------
.../validator/routines/RegexValidatorTest.java | 4 ++--
3 files changed, 14 insertions(+), 13 deletions(-)
(commons-validator) 01/02: Fix RegexValidator.validate() returning null for a valid match (#395).
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git
commit 86464fd0add9cff63c61e5f781c8c7a7b688a313
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jun 13 15:24:05 2026 +0000
Fix RegexValidator.validate() returning null for a valid match (#395).
---
src/changes/changes.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index ed5a5790..b0950c7d 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -79,6 +79,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="fix" dev="ggregory" due-to="Gary Gregory, sahvx655-wq">Fix long range check in GenericTypeValidator.formatLong (#387).</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory, sahvx655-wq">Fix BigIntegerValidator minValue(), maxValue(), and processParsedValue() for out of Long range values (#397).</action>
<action type="fix" dev="ggregory" due-to="Mauricio Bento, Gary Gregory">Add missing tests for ValidatorUtils.replace and ValidatorUtils.copyMap (#396)..</action>
+ <action type="fix" dev="ggregory" due-to="sahvx655-wq, Gary Gregory">Fix RegexValidator.validate() returning null for a valid match (#395)..</action>
<!-- ADD -->
<action type="add" dev="ggregory" due-to="Gary Gregory">Add and use CheckDigitException.CheckDigitException(String, Object...) (#389).</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Add and use ValidatorException.ValidatorException(Throwable). Call sites that previously called new ValidatorException(Throwable#getMessage()) now preserve that exception (#390).</action>
(commons-validator) 02/02: Javadoc and comments
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git
commit fc7e60297009b054aa5c797d59a8abdc392ecf8d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jun 13 15:25:35 2026 +0000
Javadoc and comments
---
.../commons/validator/routines/RegexValidator.java | 22 +++++++++++-----------
.../validator/routines/RegexValidatorTest.java | 4 ++--
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/main/java/org/apache/commons/validator/routines/RegexValidator.java b/src/main/java/org/apache/commons/validator/routines/RegexValidator.java
index cea2edb4..7153cc4b 100644
--- a/src/main/java/org/apache/commons/validator/routines/RegexValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/RegexValidator.java
@@ -25,7 +25,7 @@ import java.util.regex.Pattern;
* <strong>Regular Expression</strong> validation (using the JRE's regular expression support).
* <p>
* Constructs the validator either for a single regular expression or a set (array) of regular expressions. By default, validation is <em>case sensitive</em> but
- * constructors are provided to allow <em>case in-sensitive</em> validation. For example to create a validator which does <em>case in-sensitive</em> validation
+ * constructors are provided to allow <em>case insensitive</em> validation. For example to create a validator which does <em>case insensitive</em> validation
* for a set of regular expressions:
* </p>
*
@@ -83,7 +83,7 @@ public class RegexValidator implements Serializable {
/**
* Constructs a new instance that matches any one of the set of regular expressions with the specified case sensitivity.
*
- * @param regexs The set of regular expressions this validator will validate against
+ * @param regexs The set of regular expressions this validator will validate against.
* @param flags See flags in {@link Pattern#compile(String, int)}.
*/
private RegexValidator(final int flags, final String... regexs) {
@@ -103,7 +103,7 @@ public class RegexValidator implements Serializable {
/**
* Constructs a new <em>case sensitive</em> instance that matches any one in the list of regular expressions.
*
- * @param regexs The set of regular expressions this validator will validate against
+ * @param regexs The set of regular expressions this validator will validate against.
*/
RegexValidator(final List<String> regexs) {
this(CASE_SENSITIVE, regexs.toArray(new String[] {}));
@@ -112,7 +112,7 @@ public class RegexValidator implements Serializable {
/**
* Constructs a new <em>case sensitive</em> instance for a single regular expression.
*
- * @param regex The regular expression this validator will validate against
+ * @param regex The regular expression this validator will validate against.
*/
public RegexValidator(final String regex) {
this(CASE_SENSITIVE, regex);
@@ -121,7 +121,7 @@ public class RegexValidator implements Serializable {
/**
* Constructs a new <em>case sensitive</em> instance that matches any one in the array of regular expressions.
*
- * @param regexs The set of regular expressions this validator will validate against
+ * @param regexs The set of regular expressions this validator will validate against.
*/
public RegexValidator(final String... regexs) {
this(CASE_SENSITIVE, regexs);
@@ -130,8 +130,8 @@ public class RegexValidator implements Serializable {
/**
* Constructs a new instance for a single regular expression with the specified case sensitivity.
*
- * @param regex The regular expression this validator will validate against
- * @param caseSensitive when {@code true} matching is <em>case sensitive</em>, otherwise matching is <em>case in-sensitive</em>
+ * @param regex The regular expression this validator will validate against.
+ * @param caseSensitive when {@code true} matching is <em>case sensitive</em>, otherwise matching is <em>case insensitive</em>.
*/
public RegexValidator(final String regex, final boolean caseSensitive) {
this(toCompileFlags(caseSensitive), regex);
@@ -140,8 +140,8 @@ public class RegexValidator implements Serializable {
/**
* Constructs a new instance that matches any one of the set of regular expressions with the specified case sensitivity.
*
- * @param regexs The set of regular expressions this validator will validate against
- * @param caseSensitive when {@code true} matching is <em>case sensitive</em>, otherwise matching is <em>case in-sensitive</em>
+ * @param regexs The set of regular expressions this validator will validate against.
+ * @param caseSensitive when {@code true} matching is <em>case sensitive</em>, otherwise matching is <em>case insensitive</em>.
*/
public RegexValidator(final String[] regexs, final boolean caseSensitive) {
this(toCompileFlags(caseSensitive), regexs);
@@ -179,7 +179,7 @@ public class RegexValidator implements Serializable {
* Validates a value against the set of regular expressions returning the array of matched groups.
*
* @param value The value to validate.
- * @return String array of the <em>groups</em> matched if valid or {@code null} if invalid
+ * @return String array of the <em>groups</em> matched if valid or {@code null} if invalid.
*/
public String[] match(final String value) {
if (value == null) {
@@ -222,7 +222,7 @@ public class RegexValidator implements Serializable {
* Validates a value against the set of regular expressions returning a String value of the aggregated groups.
*
* @param value The value to validate.
- * @return Aggregated String value comprised of the <em>groups</em> matched if valid or {@code null} if invalid
+ * @return Aggregated String value comprised of the <em>groups</em> matched if valid or {@code null} if invalid.
*/
public String validate(final String value) {
if (value == null) {
diff --git a/src/test/java/org/apache/commons/validator/routines/RegexValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/RegexValidatorTest.java
index b7cee44a..dc6b3347 100644
--- a/src/test/java/org/apache/commons/validator/routines/RegexValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/RegexValidatorTest.java
@@ -114,11 +114,11 @@ class RegexValidatorTest {
}
/**
- * Test with multiple regular expressions (case in-sensitive).
+ * Test with multiple regular expressions (case insensitive).
*/
@Test
void testMultipleInsensitive() {
- // Set up In-sensitive Validators
+ // Set up insensitive Validators
final RegexValidator multiple = new RegexValidator(MULTIPLE_REGEX, false);
final RegexValidator single1 = new RegexValidator(REGEX_1, false);
final RegexValidator single2 = new RegexValidator(REGEX_2, false);