From 9b2ecc70d0efb15c8ccf0f15640806e74d8a3bf5 Mon Sep 17 00:00:00 2001 From: remm Date: Fri, 29 Sep 2023 10:24:22 +0200 Subject: [PATCH] makeObjectCount is used for error reporting without sync volatile is enough then. Found by coverity. --- .../java/org/apache/commons/pool3/impl/GenericObjectPool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/pool3/impl/GenericObjectPool.java b/src/main/java/org/apache/commons/pool3/impl/GenericObjectPool.java index 5fed85add..8366f68c4 100644 --- a/src/main/java/org/apache/commons/pool3/impl/GenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool3/impl/GenericObjectPool.java @@ -117,7 +117,7 @@ private static void wait(final Object obj, final Duration duration) throws Inter */ private final AtomicLong createCount = new AtomicLong(); - private long makeObjectCount; + private volatile long makeObjectCount; private final Object makeObjectCountLock = new Object();