Skip to content

Commit d5181bf

Browse files
committed
Add Nullability support into Java DSL
1 parent 053cc00 commit d5181bf

File tree

105 files changed

+514
-366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+514
-366
lines changed

spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AbstractMessageListenerContainerSpec.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2022 the original author or authors.
2+
* Copyright 2017-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -290,7 +290,7 @@ public S recoveryBackOff(BackOff recoveryBackOff) {
290290

291291
/**
292292
* Set the {@link MessagePropertiesConverter} for this listener container.
293-
* @param messagePropertiesConverter The properties converter.
293+
* @param messagePropertiesConverter the converter for AMQP properties.
294294
* @return the spec.
295295
* @see AbstractMessageListenerContainer#setMessagePropertiesConverter(MessagePropertiesConverter)
296296
*/

spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AmqpInboundChannelAdapterDMLCSpec.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2020 the original author or authors.
2+
* Copyright 2017-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,7 +36,9 @@ protected AmqpInboundChannelAdapterDMLCSpec(DirectMessageListenerContainer liste
3636
super(new DirectMessageListenerContainerSpec(listenerContainer));
3737
}
3838

39-
public AmqpInboundChannelAdapterDMLCSpec configureContainer(Consumer<DirectMessageListenerContainerSpec> configurer) {
39+
public AmqpInboundChannelAdapterDMLCSpec configureContainer(
40+
Consumer<DirectMessageListenerContainerSpec> configurer) {
41+
4042
configurer.accept((DirectMessageListenerContainerSpec) this.listenerContainerSpec);
4143
return this;
4244
}

spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AmqpInboundChannelAdapterSMLCSpec.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2020 the original author or authors.
2+
* Copyright 2017-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,7 +37,9 @@ protected AmqpInboundChannelAdapterSMLCSpec(SimpleMessageListenerContainer liste
3737
super(new SimpleMessageListenerContainerSpec(listenerContainer));
3838
}
3939

40-
public AmqpInboundChannelAdapterSMLCSpec configureContainer(Consumer<SimpleMessageListenerContainerSpec> configurer) {
40+
public AmqpInboundChannelAdapterSMLCSpec configureContainer(
41+
Consumer<SimpleMessageListenerContainerSpec> configurer) {
42+
4143
configurer.accept((SimpleMessageListenerContainerSpec) this.listenerContainerSpec);
4244
return this;
4345
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/**
22
* Provides AMQP Component support for the Java DSL.
33
*/
4+
@org.springframework.lang.NonNullApi
45
package org.springframework.integration.amqp.dsl;
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/**
22
* Provides Apache Cassandra Components support for the Java DSL.
33
*/
4+
@org.springframework.lang.NonNullApi
5+
@org.springframework.lang.NonNullFields
46
package org.springframework.integration.cassandra.dsl;

spring-integration-cassandra/src/main/java/org/springframework/integration/cassandra/outbound/CassandraMessageHandler.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 the original author or authors.
2+
* Copyright 2022-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -50,6 +50,7 @@
5050
import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
5151
import org.springframework.integration.handler.ExpressionEvaluatingMessageProcessor;
5252
import org.springframework.integration.handler.MessageProcessor;
53+
import org.springframework.lang.Nullable;
5354
import org.springframework.messaging.Message;
5455
import org.springframework.util.Assert;
5556

@@ -75,6 +76,7 @@ public class CassandraMessageHandler extends AbstractReplyProducingMessageHandle
7576
/**
7677
* Prepared statement to use in association with high throughput ingestion.
7778
*/
79+
@Nullable
7880
private String ingestQuery;
7981

8082
/**
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
/*
2-
* Copyright 2022 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
/**
182
* Provides classes supporting Cassandra outbound endpoints.
193
*/
4+
@org.springframework.lang.NonNullApi
205
package org.springframework.integration.cassandra.outbound;

spring-integration-core/src/main/java/org/springframework/integration/config/CorrelationStrategyFactoryBean.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
2525
import org.springframework.integration.aggregator.HeaderAttributeCorrelationStrategy;
2626
import org.springframework.integration.aggregator.MethodInvokingCorrelationStrategy;
2727
import org.springframework.integration.util.MessagingAnnotationUtils;
28+
import org.springframework.lang.NonNull;
2829
import org.springframework.util.StringUtils;
2930

3031
/**
@@ -75,6 +76,7 @@ public void afterPropertiesSet() {
7576
}
7677
}
7778

79+
@NonNull
7880
@Override
7981
public CorrelationStrategy getObject() {
8082
return this.strategy;

spring-integration-core/src/main/java/org/springframework/integration/config/ReleaseStrategyFactoryBean.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@
2727
import org.springframework.integration.aggregator.ReleaseStrategy;
2828
import org.springframework.integration.aggregator.SimpleSequenceSizeReleaseStrategy;
2929
import org.springframework.integration.util.MessagingAnnotationUtils;
30+
import org.springframework.lang.NonNull;
3031
import org.springframework.util.StringUtils;
3132

3233
/**
@@ -87,6 +88,7 @@ public void afterPropertiesSet() {
8788
}
8889
}
8990

91+
@NonNull
9092
@Override
9193
public ReleaseStrategy getObject() {
9294
return this.strategy;

spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationObjectSupport.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public abstract class IntegrationObjectSupport implements BeanNameAware, NamedCo
9898
private boolean initialized;
9999

100100
@Override
101-
public final void setBeanName(String beanName) {
101+
public final void setBeanName(@Nullable String beanName) {
102102
this.beanName = beanName;
103103
}
104104

spring-integration-core/src/main/java/org/springframework/integration/dsl/AggregatorSpec.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 the original author or authors.
2+
* Copyright 2016-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@
2727
import org.springframework.integration.aggregator.MessageGroupProcessor;
2828
import org.springframework.integration.aggregator.MethodInvokingMessageGroupProcessor;
2929
import org.springframework.integration.store.MessageGroup;
30+
import org.springframework.lang.Nullable;
3031

3132
/**
3233
* A {@link CorrelationHandlerSpec} for an {@link AggregatingMessageHandler}.
@@ -65,7 +66,7 @@ public AggregatorSpec processor(Object target) {
6566
* target object must have an {@link org.springframework.integration.annotation.Aggregator} annotation).
6667
* @return the handler spec.
6768
*/
68-
public AggregatorSpec processor(Object target, String methodName) {
69+
public AggregatorSpec processor(Object target, @Nullable String methodName) {
6970
return super.processor(target)
7071
.outputProcessor(methodName != null
7172
? new MethodInvokingMessageGroupProcessor(target, methodName)

0 commit comments

Comments
 (0)