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


The following commit(s) were added to refs/heads/master by this push:
     new 234875e8 Use final
234875e8 is described below

commit 234875e8ad2db7deb632de3634a8bcd1b76fb1ed
Author: Gary D. Gregory <[email protected]>
AuthorDate: Sun Sep 7 17:23:00 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 0dc67ea7..1ce8fd66 100644
--- a/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
@@ -2239,20 +2239,20 @@ public class DomainValidator implements Serializable {
 
     // package protected for unit test access
     // must agree with isValid() above
-    final boolean isValidDomainSyntax(String domain) {
+    final boolean isValidDomainSyntax(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);
-        return groups != null && groups.length > 0 || 
hostnameRegex.isValid(domain);
+        final String[] groups = domainRegex.match(ascii);
+        return groups != null && groups.length > 0 || 
hostnameRegex.isValid(ascii);
     }
 
     /**

Reply via email to