You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2023/10/19 06:30:52 UTC

[camel] branch main updated: (chores) camel-core: remove unnecessary volatile

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

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 20a60fd9d19 (chores) camel-core: remove unnecessary volatile
20a60fd9d19 is described below

commit 20a60fd9d1932b2b7a84c928160ecaf4de1ac2e3
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu Oct 19 07:58:18 2023 +0200

    (chores) camel-core: remove unnecessary volatile
    
    Volatile only guarantees visibility, but not atomicity. This could mislead maintainers into thinking it's thread-safe when it's not.
    
    This aligns this variable with the rest of the other member variables in this class.
---
 .../main/java/org/apache/camel/impl/engine/AbstractCamelContext.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
index 70e7c243dc4..d3acd07f206 100644
--- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
+++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
@@ -195,7 +195,7 @@ public abstract class AbstractCamelContext extends BaseService
 
     private static final Logger LOG = LoggerFactory.getLogger(AbstractCamelContext.class);
 
-    protected final InternalServiceManager internalServiceManager;
+    private final InternalServiceManager internalServiceManager;
 
     private final DefaultCamelContextExtension camelContextExtension = new DefaultCamelContextExtension(this);
     private final AtomicInteger endpointKeyCounter = new AtomicInteger();
@@ -219,7 +219,7 @@ public abstract class AbstractCamelContext extends BaseService
     private String managementName;
     private ClassLoader applicationContextClassLoader;
     private boolean autoCreateComponents = true;
-    private volatile VaultConfiguration vaultConfiguration = new VaultConfiguration();
+    private VaultConfiguration vaultConfiguration = new VaultConfiguration();
 
     private final List<RoutePolicyFactory> routePolicyFactories = new ArrayList<>();
     // special flags to control the first startup which can are special