Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* Provides classes for supporting Debezium component via Java DSL.
*/
@org.springframework.lang.NonNullApi
@org.springframework.lang.NonNullFields
@org.jspecify.annotations.NullMarked
package org.springframework.integration.debezium.dsl;
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
import io.debezium.engine.DebeziumEngine.RecordCommitter;
import io.debezium.engine.Header;
import io.debezium.engine.format.SerializationFormat;
import org.jspecify.annotations.Nullable;

import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.core.task.TaskExecutor;
import org.springframework.integration.debezium.support.DebeziumHeaders;
import org.springframework.integration.debezium.support.DefaultDebeziumHeaderMapper;
import org.springframework.integration.endpoint.MessageProducerSupport;
import org.springframework.lang.Nullable;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.support.HeaderMapper;
Expand Down Expand Up @@ -76,6 +76,7 @@ public class DebeziumMessageProducer extends MessageProducerSupport {
* Create new Debezium message producer inbound channel adapter.
* @param debeziumBuilder - pre-configured Debezium Engine Builder instance.
*/
@SuppressWarnings("NullAway.Init")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this annotation here, but not on the property itself?
And why do we need it at all?

Copy link
Contributor Author

@ngocnhan-tran1996 ngocnhan-tran1996 Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I ran gradlew :spring-integration-debezium:check on my local machine, the following exception occurred:

DebeziumMessageProducer.java:79: error: [NullAway] initializer method does not guarantee @NonNull fields debeziumEngine (line 58), taskExecutor (line 63) are initialized along all control-flow paths (remember to check for exceptions or early returns).
        public DebeziumMessageProducer(Builder<ChangeEvent<byte[], byte[]>> debeziumBuilder) {
               ^
      (see http://t.uber.com/nullaway )
  1 error

After reviewing the related PRs, I’ve updated my PR accordingly.

public DebeziumMessageProducer(Builder<ChangeEvent<byte[], byte[]>> debeziumBuilder) {
Assert.notNull(debeziumBuilder, "'debeziumBuilder' must not be null");
this.debeziumEngineBuilder = debeziumBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Provides classes for the Debezium inbound channel adapters.
*/
@org.springframework.lang.NonNullApi
@org.jspecify.annotations.NullMarked
package org.springframework.integration.debezium.inbound;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Provides supporting classes for the Debezium channel adapters.
*/
@org.springframework.lang.NonNullApi
@org.jspecify.annotations.NullMarked
package org.springframework.integration.debezium.support;