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

commit 3312ad79b01f5681e75097a2d9af4c1004f0ab55
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Thu May 1 00:29:03 2025 -0400

    Shared primitive variable "throwExceptionOnMissing" in one thread may
    not yield the value of the most recent write from another thread
    [org.apache.commons.configuration2.AbstractConfiguration] At
    AbstractConfiguration.java:[line 1493]
    AT_STALE_THREAD_WRITE_OF_PRIMITIVE
---
 src/changes/changes.xml                                                 | 1 +
 .../java/org/apache/commons/configuration2/AbstractConfiguration.java   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 62e91885..b3796169 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -25,6 +25,7 @@
   <body>
     <release version="2.12.1" date="YYYY-MM-DD" description="Minor release 
with new features and updated dependencies; requires Java 8 or above.">
        <!-- FIX -->
+       <action type="fix" dev="ggregory" due-to="Gary Gregory, 
SpotBugs">Shared primitive variable "throwExceptionOnMissing" in one thread may 
not yield the value of the most recent write from another thread 
[org.apache.commons.configuration2.AbstractConfiguration] At 
AbstractConfiguration.java:[line 1493] 
AT_STALE_THREAD_WRITE_OF_PRIMITIVE.</action>
        <!-- ADD -->
        <!-- UPDATE -->
        <action type="update" dev="ggregory" due-to="Gary Gregory, 
Dependabot">Bump com.fasterxml.jackson.core:jackson-databind from 2.18.3 to 
2.19.0 #565.</action>
diff --git 
a/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java 
b/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
index eb198664..46012f8a 100644
--- a/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
+++ b/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
@@ -190,7 +190,7 @@ public abstract class AbstractConfiguration extends 
BaseEventSource implements C
      * Whether the configuration should throw NoSuchElementExceptions or 
simply return null when a property does not exist.
      * Defaults to return null.
      */
-    private boolean throwExceptionOnMissing;
+    private volatile boolean throwExceptionOnMissing;
 
     /** Stores a reference to the object that handles variable interpolation. 
*/
     private AtomicReference<ConfigurationInterpolator> interpolator;

Reply via email to