Browse Source

Conventions lazily retrieves shared ReactiveAdapterRegistry

Issue: SPR-16981

(cherry picked from commit b68e692)
pull/1884/head
Juergen Hoeller 6 years ago
parent
commit
3e64388b20
  1. 5
      spring-core/src/main/java/org/springframework/core/Conventions.java

5
spring-core/src/main/java/org/springframework/core/Conventions.java

@ -41,8 +41,6 @@ public abstract class Conventions { @@ -41,8 +41,6 @@ public abstract class Conventions {
*/
private static final String PLURAL_SUFFIX = "List";
private static final ReactiveAdapterRegistry reactiveAdapterRegistry = ReactiveAdapterRegistry.getSharedInstance();
/**
* Determine the conventional variable name for the supplied {@code Object}
@ -116,7 +114,7 @@ public abstract class Conventions { @@ -116,7 +114,7 @@ public abstract class Conventions {
}
else {
valueClass = parameter.getParameterType();
ReactiveAdapterRegistry reactiveAdapterRegistry = ReactiveAdapterRegistry.getSharedInstance();
if (reactiveAdapterRegistry.hasAdapters()) {
ReactiveAdapter adapter = reactiveAdapterRegistry.getAdapter(valueClass);
if (adapter != null && !adapter.getDescriptor().isNoValue()) {
@ -205,6 +203,7 @@ public abstract class Conventions { @@ -205,6 +203,7 @@ public abstract class Conventions {
}
else {
valueClass = resolvedType;
ReactiveAdapterRegistry reactiveAdapterRegistry = ReactiveAdapterRegistry.getSharedInstance();
if (reactiveAdapterRegistry.hasAdapters()) {
ReactiveAdapter adapter = reactiveAdapterRegistry.getAdapter(valueClass);
if (adapter != null && !adapter.getDescriptor().isNoValue()) {

Loading…
Cancel
Save