Skip to content

Commit d28d612

Browse files
committed
Revert "GH-3697: DelegatingInvocableHandler.invoke() returning null"
This reverts commit 9e34397.
1 parent 9e34397 commit d28d612

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/DelegatingInvocableHandler.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2025 the original author or authors.
2+
* Copyright 2016-2024 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.
@@ -55,7 +55,6 @@
5555
*
5656
* @author Gary Russell
5757
* @author Wang Zhiyang
58-
* @author Ivan Malutin
5958
*
6059
*/
6160
public class DelegatingInvocableHandler {
@@ -168,7 +167,6 @@ public boolean isAsyncReplies() {
168167
* @throws Exception raised if no suitable argument resolver can be found,
169168
* or the method raised an exception.
170169
*/
171-
@Nullable
172170
public Object invoke(Message<?> message, Object... providedArgs) throws Exception { //NOSONAR
173171
Class<?> payloadClass = message.getPayload().getClass();
174172
InvocableHandlerMethod handler = getHandlerForPayload(payloadClass);
@@ -188,13 +186,8 @@ public Object invoke(Message<?> message, Object... providedArgs) throws Exceptio
188186
else {
189187
result = handler.invoke(message, providedArgs);
190188
}
191-
if (result != null) {
192-
Expression replyTo = this.handlerSendTo.get(handler);
193-
return new InvocationResult(result, replyTo, this.handlerReturnsMessage.get(handler));
194-
}
195-
else {
196-
return null;
197-
}
189+
Expression replyTo = this.handlerSendTo.get(handler);
190+
return new InvocationResult(result, replyTo, this.handlerReturnsMessage.get(handler));
198191
}
199192

200193
/**

0 commit comments

Comments
 (0)