From 5aeafc07616b9adcf0f37f6dd81f18ecf5faba6c Mon Sep 17 00:00:00 2001 From: rstoyanchev Date: Tue, 25 Oct 2022 12:27:53 +0100 Subject: [PATCH] Fix ISE in [Http|RSocket]ServiceProxyFactory Closes gh-29376 --- .../rsocket/service/RSocketServiceProxyFactory.java | 5 +++-- .../web/service/invoker/HttpServiceProxyFactory.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/spring-messaging/src/main/java/org/springframework/messaging/rsocket/service/RSocketServiceProxyFactory.java b/spring-messaging/src/main/java/org/springframework/messaging/rsocket/service/RSocketServiceProxyFactory.java index 832f4be2c89..0e663386e3f 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/rsocket/service/RSocketServiceProxyFactory.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/rsocket/service/RSocketServiceProxyFactory.java @@ -115,8 +115,9 @@ public final class RSocketServiceProxyFactory implements InitializingBean, Embed @Deprecated(since = "6.0.0-RC2", forRemoval = true) @Override public void setEmbeddedValueResolver(StringValueResolver resolver) { - Assert.state(this.beanStyleFactory != null, "RSocketServiceProxyFactory was created through the builder"); - this.beanStyleFactory.setEmbeddedValueResolver(resolver); + if (this.beanStyleFactory != null) { + this.beanStyleFactory.setEmbeddedValueResolver(resolver); + } } /** diff --git a/spring-web/src/main/java/org/springframework/web/service/invoker/HttpServiceProxyFactory.java b/spring-web/src/main/java/org/springframework/web/service/invoker/HttpServiceProxyFactory.java index 7e23fb4c408..f0783963891 100644 --- a/spring-web/src/main/java/org/springframework/web/service/invoker/HttpServiceProxyFactory.java +++ b/spring-web/src/main/java/org/springframework/web/service/invoker/HttpServiceProxyFactory.java @@ -131,8 +131,9 @@ public final class HttpServiceProxyFactory implements InitializingBean, Embedded @Deprecated(since = "6.0.0-RC2", forRemoval = true) @Override public void setEmbeddedValueResolver(StringValueResolver resolver) { - Assert.state(this.beanStyleFactory != null, "HttpServiceProxyFactory was created through the builder"); - this.beanStyleFactory.setEmbeddedValueResolver(resolver); + if (this.beanStyleFactory != null) { + this.beanStyleFactory.setEmbeddedValueResolver(resolver); + } } /**