You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/10/01 12:40:58 UTC
[camel] branch 17031-fix created (now 76b36c4)
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a change to branch 17031-fix
in repository https://gitbox.apache.org/repos/asf/camel.git.
at 76b36c4 CAMEL-17031 - Performances/Profiling: Avoid boolean allocation in EventHelper
This branch includes the following new commits:
new 76b36c4 CAMEL-17031 - Performances/Profiling: Avoid boolean allocation in EventHelper
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[camel] 01/01: CAMEL-17031 - Performances/Profiling: Avoid boolean
allocation in EventHelper
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch 17031-fix
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 76b36c456e3c6ecff0d41277c78438821e958c01
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Oct 1 13:05:06 2021 +0200
CAMEL-17031 - Performances/Profiling: Avoid boolean allocation in EventHelper
---
.../src/main/java/org/apache/camel/support/EventHelper.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/EventHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/EventHelper.java
index fbc26ce..f144ac9 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/EventHelper.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/EventHelper.java
@@ -44,6 +44,7 @@ public final class EventHelper {
// be left as-is.
private static final Logger LOG = LoggerFactory.getLogger(EventHelper.class);
+ private static volatile boolean started;
private EventHelper() {
}
@@ -1300,8 +1301,7 @@ public final class EventHelper {
private static boolean doNotifyEvent(EventNotifier notifier, CamelEvent event) {
// only notify if notifier is started
- boolean started = true;
- if (notifier instanceof StatefulService) {
+ if (!started && notifier instanceof StatefulService) {
started = ((StatefulService) notifier).isStarted();
}
if (!started) {