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 fa64f6f Restore privacy accidentally dropped
fa64f6f is described below
commit fa64f6f21107ff0ce55af70ea4900a200bf395d9
Author: Sebb <[email protected]>
AuthorDate: Sun Jul 26 12:27:41 2020 +0100
Restore privacy accidentally dropped
---
.../org/apache/commons/validator/routines/DomainValidator.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 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 86ce204..0f1da41 100644
--- a/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
@@ -172,11 +172,15 @@ public class DomainValidator implements Serializable {
final String[] mycountryCodeTLDsPlus;
final String[] mygenericTLDsPlus;
final String[] mygenericTLDsMinus;
-
+ /*
+ * N.B. It is vital that instances are immutable.
+ * This is because the default instances are shared.
+ */
+
/**
* Private constructor.
*/
- DomainValidator(boolean allowLocal) {
+ private DomainValidator(boolean allowLocal) {
this.allowLocal = allowLocal;
// link to class overrides
mycountryCodeTLDsMinus = countryCodeTLDsMinus;
@@ -189,7 +193,7 @@ public class DomainValidator implements Serializable {
* Private constructor, allowing local overrides
* @since 1.7
*/
- DomainValidator(boolean allowLocal, List<Item> items) {
+ private DomainValidator(boolean allowLocal, List<Item> items) {
this.allowLocal = allowLocal;
// default to class overrides