Skip to content

Commit

Permalink
assign variable with instanceof and remove cast
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
  • Loading branch information
dguggemos authored and desislava-marinova committed Jul 11, 2022
1 parent 2d3c6d3 commit 55eb64d
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -193,14 +193,14 @@ protected void handleDittoRuntimeException(final DittoRuntimeException dittoRunt

private void handleMatched(final SourceQueue<T> sourceQueue, final M match) {
final ThreadSafeDittoLoggingAdapter loggerWithCID;
if (match instanceof WithDittoHeaders) {
loggerWithCID = logger.withCorrelationId((WithDittoHeaders) match);
if (match instanceof final WithDittoHeaders withDittoHeaders) {
loggerWithCID = logger.withCorrelationId(withDittoHeaders);
} else {
loggerWithCID = logger;
}
if (match instanceof WithEntityId) {
if (match instanceof final WithEntityId withEntityId) {
loggerWithCID.debug("Received <{}> with ID <{}>.", match.getClass().getSimpleName(),
((WithEntityId) match).getEntityId());
withEntityId.getEntityId());
} else {
loggerWithCID.debug("Received match: <{}>.", match);
}
Expand Down

0 comments on commit 55eb64d

Please sign in to comment.