gnodet-bot commented on code in PR #27635:
URL: https://github.com/apache/camel/pull/27635#discussion_r4235029018
##########
core/camel-support/src/main/java/org/apache/camel/support/ExchangeHelper.java:
##########
@@ -454,6 +455,30 @@ public static Message getResultMessage(Exchange exchange) {
}
}
Review Comment:
💡 **Low severity:** `getShutdownStrategy()` is called unconditionally before
`isStopped()` can short-circuit it (Java `||` evaluates left-to-right:
`isStopping()` then `isStopped()` then
`getShutdownStrategy().isForceShutdown()`). In practice this is safe because
the method is only called during route stop, well after context startup, but a
defensive null check would make it bullet-proof:
```suggestion
ShutdownStrategy ss = context.getShutdownStrategy();
if (context.isStopping() || context.isStopped() || (ss != null &&
ss.isForceShutdown())) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]