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/07/11 11:21:28 UTC
(commons-validator) 05/05: Merge if statements
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 7fe8b61be1df7ce141f8c63d9c78338bfa57788b
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jul 11 07:21:17 2026 -0400
Merge if statements
---
.../org/apache/commons/validator/routines/EmailValidator.java | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/main/java/org/apache/commons/validator/routines/EmailValidator.java b/src/main/java/org/apache/commons/validator/routines/EmailValidator.java
index 2235f59b..406b43f7 100644
--- a/src/main/java/org/apache/commons/validator/routines/EmailValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/EmailValidator.java
@@ -178,13 +178,7 @@ public class EmailValidator implements Serializable {
}
// Check the whole email address structure
final Matcher emailMatcher = EMAIL_PATTERN.matcher(email);
- if (!emailMatcher.matches()) {
- return false;
- }
- if (!isValidUser(emailMatcher.group(1))) {
- return false;
- }
- if (!isValidDomain(emailMatcher.group(2))) {
+ if (!emailMatcher.matches() || !isValidUser(emailMatcher.group(1)) || !isValidDomain(emailMatcher.group(2))) {
return false;
}
return true;