Skip to content

Commit

Permalink
use guard clause
Browse files Browse the repository at this point in the history
  • Loading branch information
koin612 committed Aug 11, 2023
1 parent 1ea8ee2 commit 0eaa9e5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ public Outcome handleResponse(Exchange exc) throws Exception {
}

private Outcome handleMessage(Exchange exchange, Message msg) {
if (!ifAbsent || !msg.getHeader().contains(name)) {
msg.getHeader().setValue(name, evaluateExpression(new ExchangeEvaluationContext(exchange, msg).getStandardEvaluationContext()));
if (msg.getHeader().contains(name) && ifAbsent) {
return CONTINUE;
}

msg.getHeader().setValue(name, evaluateExpression(new ExchangeEvaluationContext(exchange, msg).getStandardEvaluationContext()));
return CONTINUE;
}

Expand Down

0 comments on commit 0eaa9e5

Please sign in to comment.