From 7f83f5f74a02c5e5111411f6998c8ea20649f8d8 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Wed, 10 Nov 2021 16:35:04 -0500 Subject: [PATCH] Revert `AnnotationGatewayProxyFactoryBean` logic The `AnnotationGatewayProxyFactoryBean` can be configured via setters and via annotation in the provided interface. * Override `setProxyDefaultMethods()` to `true` only if annotation explicitly provides `true` --- .../gateway/AnnotationGatewayProxyFactoryBean.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/AnnotationGatewayProxyFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/AnnotationGatewayProxyFactoryBean.java index 28ca0b3f8a..64b3e039f7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/AnnotationGatewayProxyFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/AnnotationGatewayProxyFactoryBean.java @@ -95,7 +95,10 @@ public class AnnotationGatewayProxyFactoryBean extends GatewayProxyFactoryBean { populateAsyncExecutorIfAny(); - setProxyDefaultMethods(this.gatewayAttributes.getBoolean("proxyDefaultMethods")); + boolean proxyDefaultMethods = this.gatewayAttributes.getBoolean("proxyDefaultMethods"); + if (proxyDefaultMethods) { // Override only if annotation attribute is different + setProxyDefaultMethods(true); + } super.onInit(); }