Skip to content

Commit 05ff0e6

Browse files
GH-10083: Apply Nullability to feed module
Related to: #10083 Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
1 parent c481b93 commit 05ff0e6

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/**
22
* Provides classes for configuration - parsers, namespace handlers.
33
*/
4+
@org.jspecify.annotations.NullMarked
45
package org.springframework.integration.feed.config;
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
22
* Provides Feed Components support for Spring Integration Java DSL.
33
*/
4-
@org.springframework.lang.NonNullApi
5-
@org.springframework.lang.NonNullFields
4+
@org.jspecify.annotations.NullMarked
65
package org.springframework.integration.feed.dsl;

spring-integration-feed/src/main/java/org/springframework/integration/feed/inbound/FeedEntryMessageSource.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.rometools.rome.io.FeedException;
3737
import com.rometools.rome.io.SyndFeedInput;
3838
import com.rometools.rome.io.XmlReader;
39+
import org.jspecify.annotations.Nullable;
3940

4041
import org.springframework.beans.factory.BeanFactory;
4142
import org.springframework.core.io.Resource;
@@ -64,9 +65,9 @@
6465
*/
6566
public class FeedEntryMessageSource extends AbstractMessageSource<SyndEntry> {
6667

67-
private final URL feedUrl;
68+
private final @Nullable URL feedUrl;
6869

69-
private final Resource feedResource;
70+
private final @Nullable Resource feedResource;
7071

7172
private final String metadataKey;
7273

@@ -84,6 +85,7 @@ public class FeedEntryMessageSource extends AbstractMessageSource<SyndEntry> {
8485

8586
private boolean syndFeedInputSet;
8687

88+
@SuppressWarnings("NullAway.Init")
8789
private MetadataStore metadataStore;
8890

8991
private volatile long lastTime = -1;
@@ -152,6 +154,7 @@ public String getComponentType() {
152154
return "feed:inbound-channel-adapter";
153155
}
154156

157+
@SuppressWarnings("NullAway")
155158
@Override
156159
protected void onInit() {
157160
if (this.metadataStore == null) {
@@ -173,6 +176,7 @@ protected void onInit() {
173176
this.initialized = true;
174177
}
175178

179+
@Nullable
176180
@Override
177181
protected SyndEntry doReceive() {
178182
Assert.isTrue(this.initialized,
@@ -193,6 +197,7 @@ protected SyndEntry doReceive() {
193197
return nextEntry;
194198
}
195199

200+
@Nullable
196201
private SyndEntry getNextEntry() {
197202
SyndEntry next = this.entries.poll();
198203
if (next == null) {
@@ -249,6 +254,7 @@ private SyndFeed getFeed() {
249254
}
250255
}
251256

257+
@SuppressWarnings("NullAway")
252258
private SyndFeed buildSyndFeed() throws IOException, URISyntaxException, InterruptedException, FeedException {
253259
InputStream inputStream;
254260
if (this.feedResource != null) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/**
22
* Provides classes supporting inbound endpoints.
33
*/
4+
@org.jspecify.annotations.NullMarked
45
package org.springframework.integration.feed.inbound;

0 commit comments

Comments
 (0)