diff --git a/build.gradle b/build.gradle index b19a2307da..7c47ea41af 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlinVersion = '1.9.0' + ext.kotlinVersion = '1.9.10' ext.isCI = System.getenv('GITHUB_ACTION') || System.getenv('bamboo_buildKey') repositories { gradlePluginPortal() @@ -16,12 +16,12 @@ buildscript { plugins { id 'base' - id 'org.sonarqube' version '4.3.0.3225' + id 'org.sonarqube' version '4.3.1.3277' id 'io.spring.nohttp' version '0.0.11' apply false id 'org.ajoberstar.grgit' version '4.1.1' id 'io.spring.dependency-management' version '1.1.3' - id 'com.jfrog.artifactory' version '5.0.3' apply false - id 'org.jetbrains.dokka' version '1.8.20' + id 'com.jfrog.artifactory' version '5.1.6' apply false + id 'org.jetbrains.dokka' version '1.9.0' id 'org.antora' version '1.0.0' id 'io.spring.antora.generate-antora-yml' version '0.0.1' } @@ -51,14 +51,14 @@ ext { } apacheSshdVersion = '2.10.0' - artemisVersion = '2.29.0' - aspectjVersion = '1.9.19' + artemisVersion = '2.30.0' + aspectjVersion = '1.9.20.1' assertjVersion = '3.24.2' - assertkVersion = '0.26.1' + assertkVersion = '0.27.0' avroVersion = '1.11.2' awaitilityVersion = '4.2.0' - camelVersion = '4.0.0-RC2' - commonsDbcp2Version = '2.9.0' + camelVersion = '4.0.0' + commonsDbcp2Version = '2.10.0' commonsIoVersion = '2.13.0' commonsNetVersion = '3.9.0' curatorVersion = '5.5.0' @@ -66,17 +66,17 @@ ext { derbyVersion = '10.16.1.1' findbugsVersion = '3.0.1' ftpServerVersion = '1.2.0' - graalvmVersion = '23.0.0' + graalvmVersion = '23.0.1' greenmailVersion = '2.1.0-alpha-2' - groovyVersion = '4.0.13' + groovyVersion = '4.0.15' hamcrestVersion = '2.2' - hazelcastVersion = '5.3.1' + hazelcastVersion = '5.3.2' hibernateVersion = '6.2.8.Final' hsqldbVersion = '2.7.2' - h2Version = '2.2.220' + h2Version = '2.2.224' jacksonVersion = '2.15.2' jaxbVersion = '4.0.3' - jcifsVersion = '2.1.35' + jcifsVersion = '2.1.36' jeroMqVersion = '0.5.3' jmsApiVersion = '3.1.0' jpaApiVersion = '3.1.0' @@ -85,39 +85,39 @@ ext { junit4Version = '4.13.2' junitJupiterVersion = '5.10.0' jythonVersion = '2.7.3' - kotlinCoroutinesVersion = '1.7.2' + kotlinCoroutinesVersion = '1.7.3' kryoVersion = '5.5.0' lettuceVersion = '6.2.6.RELEASE' log4jVersion = '2.20.0' mailVersion = '2.0.2' - micrometerTracingVersion = '1.2.0-M2' - micrometerVersion = '1.12.0-M2' + micrometerTracingVersion = '1.2.0-M3' + micrometerVersion = '1.12.0-M3' mockitoVersion = '5.5.0' mongoDriverVersion = '4.10.2' mysqlVersion = '8.0.33' pahoMqttClientVersion = '1.2.5' postgresVersion = '42.6.0' - protobufVersion = '3.24.1' + protobufVersion = '3.24.3' r2dbch2Version = '1.0.0.RELEASE' - reactorVersion = '2023.0.0-M2' + reactorVersion = '2023.0.0-M3' resilience4jVersion = '2.1.0' romeToolsVersion = '2.1.0' rsocketVersion = '1.1.4' servletApiVersion = '6.0.0' smackVersion = '4.4.6' - springAmqpVersion = '3.0.6' - springDataVersion = '2023.1.0-M2' - springGraphqlVersion = '1.2.2' - springKafkaVersion = '3.0.10' - springRetryVersion = '2.0.2' - springSecurityVersion = '6.2.0-M2' - springVersion = '6.1.0-M4' - springWsVersion = '4.0.4' - testcontainersVersion = '1.18.3' - tomcatVersion = '10.1.11' + springAmqpVersion = '3.1.0-M1' + springDataVersion = '2023.1.0-M3' + springGraphqlVersion = '1.2.3' + springKafkaVersion = '3.1.0-M1' + springRetryVersion = '2.0.3' + springSecurityVersion = '6.2.0-M3' + springVersion = '6.1.0-M5' + springWsVersion = '4.0.6' + testcontainersVersion = '1.19.0' + tomcatVersion = '10.1.13' xmlUnitVersion = '2.9.1' xstreamVersion = '1.4.20' - ztZipVersion = '1.15' + ztZipVersion = '1.16' javaProjects = subprojects - project(':spring-integration-bom') } @@ -365,7 +365,7 @@ configure(javaProjects) { subproject -> checkstyle { configDirectory.set(rootProject.file('src/checkstyle')) - toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '10.12.1' + toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '10.12.3' } jar { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/Transformers.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/Transformers.java index 76b583f587..3060b7fc05 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/Transformers.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/Transformers.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2023 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. @@ -49,7 +49,7 @@ import org.springframework.lang.Nullable; import org.springframework.messaging.Message; /** - * An utility class to provide methods for out-of-the-box + * A utility class to provide methods for out-of-the-box * {@link org.springframework.integration.transformer.Transformer}s. * * @author Artem Bilan @@ -336,7 +336,7 @@ public abstract class Transformers { @SuppressWarnings("serial") - private static class RequestMessageHolder extends AtomicReference> { + private static final class RequestMessageHolder extends AtomicReference> { } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java index 229b6527e9..5c9f17e39f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java @@ -73,7 +73,6 @@ import org.springframework.integration.support.channel.ChannelResolverUtils; import org.springframework.integration.support.management.IntegrationManagement; import org.springframework.integration.support.management.TrackableComponent; import org.springframework.integration.support.management.metrics.MetricsCaptor; -import org.springframework.integration.util.CoroutinesUtils; import org.springframework.lang.Nullable; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; @@ -597,6 +596,7 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint int paramCount = method.getParameterTypes().length; Object response; boolean hasPayloadExpression = findPayloadExpression(method); + if (paramCount == 0 && !hasPayloadExpression) { response = receive(gateway, method, !oneWay, shouldReturnMessage); } @@ -604,28 +604,20 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint response = sendOrSendAndReceive(invocation, gateway, shouldReturnMessage, !oneWay); } - Object continuation = null; if (gateway.isSuspendingFunction) { - for (Object argument : invocation.getArguments()) { - if (argument != null && CoroutinesUtils.isContinuation(argument)) { - continuation = argument; - break; - } - } + return response; } - return response(gateway.returnType, shouldReturnMessage, response, continuation); + return response(gateway.returnType, shouldReturnMessage, response); } @Nullable - private Object response(Class returnType, boolean shouldReturnMessage, - @Nullable Object response, @Nullable Object continuation) { - + private Object response(Class returnType, boolean shouldReturnMessage, @Nullable Object response) { if (shouldReturnMessage) { return response; } else { - return response != null ? convert(response, returnType, continuation) : null; + return response != null ? convert(response, returnType) : null; } } @@ -1041,23 +1033,19 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint @Nullable @SuppressWarnings("unchecked") - private T convert(Object source, Class expectedReturnType, @Nullable Object continuation) { - if (continuation != null) { - return CoroutinesUtils.monoAwaitSingleOrNull((Mono) source, continuation); - } + private

P convert(Object source, Class

expectedReturnType) { if (Future.class.isAssignableFrom(expectedReturnType)) { - return (T) source; + return (P) source; } if (Mono.class.isAssignableFrom(expectedReturnType)) { - return (T) source; + return (P) source; } - return doConvert(source, expectedReturnType); } @Nullable - private T doConvert(Object source, Class expectedReturnType) { + private

P doConvert(Object source, Class

expectedReturnType) { ConversionService conversionService = getConversionService(); if (conversionService != null) { return conversionService.convert(source, expectedReturnType); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageSplitter.java b/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageSplitter.java index 4722460918..92f1a61620 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageSplitter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageSplitter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 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. @@ -349,7 +349,7 @@ public abstract class AbstractMessageSplitter extends AbstractReplyProducingMess protected abstract Object splitMessage(Message message); - private static class JacksonNodeHelper { + private static final class JacksonNodeHelper { private static boolean isNode(Object object) { return object instanceof TreeNode; diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java b/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java index 07890600e7..d0815f4205 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java @@ -435,7 +435,7 @@ public class FileReadingMessageSource extends AbstractMessageSource implem } - private class WatchServiceDirectoryScanner extends DefaultDirectoryScanner implements ManageableLifecycle { + private final class WatchServiceDirectoryScanner extends DefaultDirectoryScanner implements ManageableLifecycle { private final ConcurrentMap pathKeys = new ConcurrentHashMap<>(); diff --git a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastEventDrivenMessageProducer.java b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastEventDrivenMessageProducer.java index 05a5eca15e..788f7b16a2 100644 --- a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastEventDrivenMessageProducer.java +++ b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastEventDrivenMessageProducer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2023 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,7 +27,6 @@ import com.hazelcast.collection.ItemListener; import com.hazelcast.core.DistributedObject; import com.hazelcast.instance.EndpointQualifier; import com.hazelcast.map.IMap; -import com.hazelcast.map.listener.MapListener; import com.hazelcast.multimap.MultiMap; import com.hazelcast.replicatedmap.ReplicatedMap; import com.hazelcast.topic.ITopic; @@ -67,7 +66,7 @@ public class HazelcastEventDrivenMessageProducer extends AbstractHazelcastMessag protected void doStart() { if (this.distributedObject instanceof IMap) { setHazelcastRegisteredEventListenerId(((IMap) this.distributedObject) - .addEntryListener((MapListener) new HazelcastEntryListener(), true)); + .addEntryListener(new HazelcastEntryListener(), true)); } else if (this.distributedObject instanceof MultiMap) { setHazelcastRegisteredEventListenerId(((MultiMap) this.distributedObject) @@ -125,7 +124,7 @@ public class HazelcastEventDrivenMessageProducer extends AbstractHazelcastMessag return "hazelcast:inbound-channel-adapter"; } - private class HazelcastItemListener extends AbstractHazelcastEventListener> + private final class HazelcastItemListener extends AbstractHazelcastEventListener> implements ItemListener { @Override @@ -145,9 +144,7 @@ public class HazelcastEventDrivenMessageProducer extends AbstractHazelcastMessag event.getMember().getSocketAddress(EndpointQualifier.MEMBER), getCacheListeningPolicy()); } - if (logger.isDebugEnabled()) { - logger.debug("Received ItemEvent : " + event); - } + logger.debug(() -> "Received ItemEvent : " + event); } @Override @@ -161,7 +158,7 @@ public class HazelcastEventDrivenMessageProducer extends AbstractHazelcastMessag } - private class HazelcastMessageListener extends AbstractHazelcastEventListener> + private final class HazelcastMessageListener extends AbstractHazelcastEventListener> implements MessageListener { @Override @@ -174,9 +171,7 @@ public class HazelcastEventDrivenMessageProducer extends AbstractHazelcastMessag sendMessage(event, event.getPublishingMember().getSocketAddress(EndpointQualifier.MEMBER), getCacheListeningPolicy()); - if (logger.isDebugEnabled()) { - logger.debug("Received Message : " + event); - } + logger.debug(() -> "Received Message : " + event); } @Override diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcMessageStore.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcMessageStore.java index 2f9b2150b2..b2f6eb2a6d 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcMessageStore.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcMessageStore.java @@ -750,7 +750,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore * Convenience class to be used to unpack a message from a result set row. Uses column named in the result set to * extract the required data, so that select clause ordering is unimportant. */ - private class MessageMapper implements RowMapper> { + private final class MessageMapper implements RowMapper> { @Override public Message mapRow(ResultSet rs, int rowNum) throws SQLException { diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests.java index 5976824b54..d77dd1effd 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests.java @@ -20,6 +20,7 @@ import java.io.BufferedReader; import java.io.InputStreamReader; import java.lang.reflect.Method; import java.sql.Timestamp; +import java.time.Duration; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -552,7 +553,7 @@ public class JdbcMessageStoreTests { PoolableConnectionFactory poolFactory = new PoolableConnectionFactory(connFactory, null); GenericObjectPoolConfig config = new GenericObjectPoolConfig<>(); config.setMaxTotal(2); - config.setMaxWaitMillis(500); + config.setMaxWait(Duration.ofMillis(500)); ObjectPool connPool = new GenericObjectPool<>(poolFactory, config); poolFactory.setPool(connPool); PoolingDataSource poolingDataSource = new PoolingDataSource<>(connPool); diff --git a/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageSourceIntegrationTests.java b/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageSourceIntegrationTests.java index 573cbd1259..904eebcf12 100644 --- a/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageSourceIntegrationTests.java +++ b/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageSourceIntegrationTests.java @@ -133,7 +133,7 @@ class MessageSourceIntegrationTests { assertThat(messageHistory.toString()).isEqualTo("myNullChannel"); received = source.receive(); assertThat(received).isNull(); - assertThat(KafkaTestUtils.getPropertyValue(source, "consumer.fetcher.minBytes")).isEqualTo(2); + assertThat(KafkaTestUtils.getPropertyValue(source, "consumer.fetcher.fetchConfig.minBytes")).isEqualTo(2); source.destroy(); template.destroy(); } diff --git a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapter.java b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapter.java index 8d09b96719..30847da281 100644 --- a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapter.java +++ b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2021 the original author or authors. + * Copyright 2015-2023 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. @@ -266,7 +266,7 @@ public class StompInboundChannelAdapter extends MessageProducerSupport implement } } - private class IntegrationInboundStompSessionHandler extends StompSessionHandlerAdapter { + private final class IntegrationInboundStompSessionHandler extends StompSessionHandlerAdapter { @Override public void afterConnected(StompSession session, StompHeaders connectedHeaders) { diff --git a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/leader/LeaderInitiator.java b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/leader/LeaderInitiator.java index b1ae7b1106..bddf3a2f37 100644 --- a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/leader/LeaderInitiator.java +++ b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/leader/LeaderInitiator.java @@ -344,7 +344,7 @@ public class LeaderInitiator implements SmartLifecycle { } - private class NullCuratorContext extends CuratorContext { + private final class NullCuratorContext extends CuratorContext { @Override public boolean isLeader() {