Skip to content

Commit c472a38

Browse files
GH-10083: Apply Nullability to core history and filter packages
Related to: #10083 Signed-off-by: Tran Ngoc Nhan <[email protected]>
1 parent 52c00e7 commit c472a38

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

spring-integration-core/src/main/java/org/springframework/integration/filter/MessageFilter.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.integration.filter;
1818

19+
import org.jspecify.annotations.Nullable;
20+
1921
import org.springframework.beans.factory.BeanFactory;
2022
import org.springframework.beans.factory.BeanFactoryAware;
2123
import org.springframework.context.Lifecycle;
@@ -53,9 +55,9 @@ public class MessageFilter extends AbstractReplyProducingPostProcessingMessageHa
5355

5456
private boolean throwExceptionOnRejection;
5557

56-
private MessageChannel discardChannel;
58+
private @Nullable MessageChannel discardChannel;
5759

58-
private String discardChannelName;
60+
private @Nullable String discardChannelName;
5961

6062
/**
6163
* Create a MessageFilter that will delegate to the given {@link MessageSelector}.
@@ -111,7 +113,7 @@ public void setDiscardWithinAdvice(boolean discardWithinAdvice) {
111113
}
112114

113115
@Override
114-
public MessageChannel getDiscardChannel() {
116+
public @Nullable MessageChannel getDiscardChannel() {
115117
String channelName = this.discardChannelName;
116118
if (channelName != null) {
117119
this.discardChannel = getChannelResolver().resolveDestination(channelName);
@@ -166,7 +168,7 @@ public boolean isRunning() {
166168
}
167169

168170
@Override
169-
protected Object doHandleRequestMessage(Message<?> message) {
171+
protected @Nullable Object doHandleRequestMessage(Message<?> message) {
170172
if (this.selector.accept(message)) {
171173
return message;
172174
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/**
22
* Provides classes supporting the filter pattern.
33
*/
4+
@org.jspecify.annotations.NullMarked
45
package org.springframework.integration.filter;

spring-integration-core/src/main/java/org/springframework/integration/history/HistoryWritingMessagePostProcessor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.integration.history;
1818

19+
import org.jspecify.annotations.Nullable;
20+
1921
import org.springframework.integration.support.DefaultMessageBuilderFactory;
2022
import org.springframework.integration.support.MessageBuilderFactory;
2123
import org.springframework.integration.support.management.TrackableComponent;
@@ -29,7 +31,7 @@
2931
*/
3032
public class HistoryWritingMessagePostProcessor implements MessagePostProcessor {
3133

32-
private volatile TrackableComponent trackableComponent;
34+
private volatile @Nullable TrackableComponent trackableComponent;
3335

3436
private volatile boolean shouldTrack;
3537

spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistoryConfigurer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public class MessageHistoryConfigurer implements ManageableSmartLifecycle, BeanF
6363

6464
private String[] componentNamePatterns = {"*"};
6565

66+
@SuppressWarnings("NullAway.Init")
6667
private ListableBeanFactory beanFactory;
6768

6869
private boolean autoStartup = true;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/**
22
* Provides classes supporting the capture of message history.
33
*/
4+
@org.jspecify.annotations.NullMarked
45
package org.springframework.integration.history;

0 commit comments

Comments
 (0)