This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch camel-3.11.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.11.x by this push:
new 618f0b6 CAMEL-17031 - Performances/Profiling: Avoid boolean
allocation in EventHelper (#6194)
618f0b6 is described below
commit 618f0b6279c8ba9c6338938022b3cd764cf5bf8c
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Oct 1 16:51:24 2021 +0200
CAMEL-17031 - Performances/Profiling: Avoid boolean allocation in
EventHelper (#6194)
---
.../src/main/java/org/apache/camel/support/EventHelper.java | 10 ++--------
1 file changed, 2 insertions(+), 8 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 9dda3ae..cdb21bb 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
@@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory;
public final class EventHelper {
// This implementation has been optimized to be as fast and not create
unnecessary objects or lambdas.
- // So therefore there is some code that seems duplicated. But this code is
used frequently during routing and should
+ // Therefore there is some code that seems duplicated. But this code is
used frequently during routing and should
// be left as-is.
private static final Logger LOG =
LoggerFactory.getLogger(EventHelper.class);
@@ -1299,20 +1299,14 @@ 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) {
// only notify if notifier is started (when stateful service)
- started = ((StatefulService) notifier).isStarted();
+ boolean started = ((StatefulService) notifier).isStarted();
if (!started) {
LOG.debug("Ignoring notifying event {}. The EventNotifier has
not been started yet: {}", event, notifier);
return false;
}
}
- if (!started) {
- LOG.debug("Ignoring notifying event {}. The EventNotifier has not
been started yet: {}", event, notifier);
- return false;
- }
if (!notifier.isEnabled(event)) {
LOG.trace("Notifier: {} is not enabled for the event: {}",
notifier, event);