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

commit ba432ae72ee07319a547fc6635dab0851edbedfc
Author: Gary D. Gregory <[email protected]>
AuthorDate: Fri Sep 5 14:08:12 2025 -0700

    Use final
---
 .../org/apache/commons/validator/routines/DomainValidator.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/validator/routines/DomainValidator.java 
b/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
index db5cbb7d..0dc67ea7 100644
--- a/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
@@ -2206,23 +2206,23 @@ public class DomainValidator implements Serializable {
      * @param domain the parameter to check for domain name syntax.
      * @return true if the parameter is a valid domain name.
      */
-    public boolean isValid(String domain) {
+    public boolean isValid(final String domain) {
         if (domain == null) {
             return false;
         }
-        domain = unicodeToASCII(domain);
+        final String ascii = unicodeToASCII(domain);
         // hosts must be equally reachable via punycode and Unicode
         // Unicode is never shorter than punycode, so check punycode
         // if domain did not convert, then it will be caught by ASCII
         // checks in the regexes below
-        if (domain.length() > MAX_DOMAIN_LENGTH) {
+        if (ascii.length() > MAX_DOMAIN_LENGTH) {
             return false;
         }
-        final String[] groups = domainRegex.match(domain);
+        final String[] groups = domainRegex.match(ascii);
         if (groups != null && groups.length > 0) {
             return isValidTld(groups[0]);
         }
-        return allowLocal && hostnameRegex.isValid(domain);
+        return allowLocal && hostnameRegex.isValid(ascii);
     }
 
     /**

Reply via email to