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 bd5c4fc9 Document how non-final static fields are protected
bd5c4fc9 is described below
commit bd5c4fc9f7c5bad1754561c7c30a72ca2ad709a9
Author: Sebb <[email protected]>
AuthorDate: Sun Dec 28 18:01:29 2025 +0000
Document how non-final static fields are protected
---
.../apache/commons/validator/routines/DomainValidator.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 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 4ca8beb5..967da5b4 100644
--- a/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
@@ -1775,7 +1775,7 @@ public class DomainValidator implements Serializable {
* This field does not need to be volatile since it is only accessed from
* synchronized methods.
*/
- private static boolean inUse;
+ private static boolean inUse; //NOPMD @GuardedBy(this)
/*
* These arrays are mutable.
* They can only be updated by the updateTLDOverride method, and readers
must first get an instance
@@ -1783,13 +1783,13 @@ public class DomainValidator implements Serializable {
* The only other access is via getTLDEntries which is now synchronized.
*/
// WARNING: this array MUST be sorted, otherwise it cannot be searched
reliably using binary search
- private static String[] countryCodeTLDsPlus = EMPTY_STRING_ARRAY;
+ private static String[] countryCodeTLDsPlus = EMPTY_STRING_ARRAY; //NOPMD
@GuardedBy(this)
// WARNING: this array MUST be sorted, otherwise it cannot be searched
reliably using binary search
- private static String[] genericTLDsPlus = EMPTY_STRING_ARRAY;
+ private static String[] genericTLDsPlus = EMPTY_STRING_ARRAY; //NOPMD
@GuardedBy(this)
// WARNING: this array MUST be sorted, otherwise it cannot be searched
reliably using binary search
- private static String[] countryCodeTLDsMinus = EMPTY_STRING_ARRAY;
+ private static String[] countryCodeTLDsMinus = EMPTY_STRING_ARRAY; //NOPMD
@GuardedBy(this)
// WARNING: this array MUST be sorted, otherwise it cannot be searched
reliably using binary search
- private static String[] genericTLDsMinus = EMPTY_STRING_ARRAY;
+ private static String[] genericTLDsMinus = EMPTY_STRING_ARRAY; //NOPMD
@GuardedBy(this)
// 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
@@ -1797,10 +1797,10 @@ public class DomainValidator implements Serializable {
// result in different settings for the shared default instances
// WARNING: this array MUST be sorted, otherwise it cannot be searched
reliably using binary search
- private static String[] localTLDsMinus = EMPTY_STRING_ARRAY;
+ private static String[] localTLDsMinus = EMPTY_STRING_ARRAY; //NOPMD
@GuardedBy(this)
// WARNING: this array MUST be sorted, otherwise it cannot be searched
reliably using binary search
- private static String[] localTLDsPlus = EMPTY_STRING_ARRAY;
+ private static String[] localTLDsPlus = EMPTY_STRING_ARRAY; //NOPMD
@GuardedBy(this)
/**
* Tests if a sorted array contains the specified key