Skip to content

Commit d8e3415

Browse files
committed
Complete ZeroMQ module migration to JSpecify
- Migrate `package-info.java` files to use `@NullMarked` annotation - Add `@SuppressWarnings("NullAway.Init")` for fields initialized in lifecycle methods Signed-off-by: Jooyoung Pyoung <[email protected]>
1 parent 6d512d9 commit d8e3415

File tree

9 files changed

+15
-7
lines changed

9 files changed

+15
-7
lines changed

spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/ZeroMqProxy.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ public class ZeroMqProxy implements InitializingBean, SmartLifecycle, BeanNameAw
8282

8383
private final AtomicInteger backendPort = new AtomicInteger();
8484

85+
@SuppressWarnings("NullAway.Init")
8586
private String controlAddress;
8687

88+
@SuppressWarnings("NullAway.Init")
8789
private Executor proxyExecutor;
8890

8991
@Nullable
@@ -97,6 +99,7 @@ public class ZeroMqProxy implements InitializingBean, SmartLifecycle, BeanNameAw
9799
@Nullable
98100
private String captureAddress;
99101

102+
@SuppressWarnings("NullAway.Init")
100103
private String beanName;
101104

102105
private boolean autoStartup = true;

spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/channel/ZeroMqChannel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public ZeroMqChannel(ZContext context, boolean pubSub) {
142142
this.subscriberData = prepareSubscriberDataFlux();
143143
}
144144

145-
@SuppressWarnings("this-escape")
145+
@SuppressWarnings({"this-escape", "NullAway"})
146146
private Mono<Integer> prepareProxyMono() {
147147
return Mono.defer(() -> {
148148
if (this.zeroMqProxy != null) {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
22
* Provides classes for message channels support over ZeroMQ.
33
*/
4-
@org.springframework.lang.NonNullApi
4+
@org.jspecify.annotations.NullMarked
55
package org.springframework.integration.zeromq.channel;
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
22
* Provides classes for supporting ZeroMQ component via Java DSL.
33
*/
4-
@org.springframework.lang.NonNullApi
5-
@org.springframework.lang.NonNullFields
4+
@org.jspecify.annotations.NullMarked
65
package org.springframework.integration.zeromq.dsl;

spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/inbound/ZeroMqMessageProducer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public class ZeroMqMessageProducer extends MessageProducerSupport {
7777

7878
private final SocketType socketType;
7979

80+
@SuppressWarnings("NullAway.Init")
8081
private InboundMessageMapper<byte[]> messageMapper;
8182

8283
private Consumer<ZMQ.Socket> socketConfigurer = (socket) -> {
@@ -91,6 +92,7 @@ public class ZeroMqMessageProducer extends MessageProducerSupport {
9192
@Nullable
9293
private String connectUrl;
9394

95+
@SuppressWarnings("NullAway.Init")
9496
private volatile Mono<ZMQ.Socket> socketMono;
9597

9698
private volatile boolean unwrapTopic = true;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
22
* Provides classes for inbound channel adapters over ZeroMQ.
33
*/
4-
@org.springframework.lang.NonNullApi
4+
@org.jspecify.annotations.NullMarked
55
package org.springframework.integration.zeromq.inbound;

spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/outbound/ZeroMqMessageHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,23 @@ public class ZeroMqMessageHandler extends AbstractReactiveMessageHandler
7777

7878
private final Scheduler publisherScheduler = Schedulers.newSingle("zeroMqMessageHandlerScheduler");
7979

80+
@SuppressWarnings("NullAway.Init")
8081
private volatile Mono<ZMQ.Socket> socketMono;
8182

83+
@SuppressWarnings("NullAway.Init")
8284
private OutboundMessageMapper<byte[]> messageMapper;
8385

8486
private Consumer<ZMQ.Socket> socketConfigurer = (socket) -> {
8587
};
8688

8789
private Expression topicExpression = new SupplierExpression<>(() -> null);
8890

91+
@SuppressWarnings("NullAway.Init")
8992
private EvaluationContext evaluationContext;
9093

9194
private volatile boolean initialized;
9295

96+
@SuppressWarnings("NullAway.Init")
9397
private volatile Disposable socketMonoSubscriber;
9498

9599
private volatile boolean wrapTopic = true;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
22
* Provides classes for outbound channel adapters over ZeroMQ.
33
*/
4-
@org.springframework.lang.NonNullApi
4+
@org.jspecify.annotations.NullMarked
55
package org.springframework.integration.zeromq.outbound;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
22
* Provides common classes for supporting ZeroMQ components.
33
*/
4-
@org.springframework.lang.NonNullApi
4+
@org.jspecify.annotations.NullMarked
55
package org.springframework.integration.zeromq;

0 commit comments

Comments
 (0)