This is an automated email from the ASF dual-hosted git repository.

sebb 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 25712c8  Why ctors not public
25712c8 is described below

commit 25712c8f40e12823edbf25b02aecfb3155349780
Author: Sebb <s...@apache.org>
AuthorDate: Fri Jul 31 13:33:53 2020 +0100

    Why ctors not public
---
 .../java/org/apache/commons/validator/routines/DomainValidator.java  | 5 +++++
 1 file changed, 5 insertions(+)

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 002e0a8..4fa09d8 100644
--- a/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
@@ -181,6 +181,11 @@ public class DomainValidator implements Serializable {
      * This is because the default instances are shared.
     */
 
+    // N.B. The constructors are deliberately private to avoid possible 
problems with unsafe publication.
+    // It is vital that the static override arrays are not mutable once they 
have been used in an instance
+    // The arrays could be copied into the instance variables, however if the 
static array were changed it could
+    // result in different settings for the shared default instances
+
     /**
      * Private constructor. 
     */

Reply via email to