Modernize code for diamond, isEmpty & pattern matching

This commit is contained in:
Tran Ngoc Nhan
2024-09-24 01:42:38 +07:00
committed by GitHub
parent 40faaa0c15
commit fc377126de
107 changed files with 550 additions and 454 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ import org.springframework.messaging.support.ErrorMessage;
* Base support class for inbound channel adapters. The default port is 514.
*
* @author Gary Russell
* @author Ngoc Nhan
* @since 3.0
*
*/
@@ -79,9 +80,9 @@ public abstract class SyslogReceivingChannelAdapterSupport extends MessageProduc
protected void convertAndSend(Message<?> message) {
try {
if (message instanceof ErrorMessage) {
if (message instanceof ErrorMessage errorMessage) {
if (this.logger.isDebugEnabled()) {
this.logger.debug("Error on syslog socket:" + ((ErrorMessage) message).getPayload().getMessage());
this.logger.debug("Error on syslog socket:" + errorMessage.getPayload().getMessage());
}
}
else {