diff --git a/spring-context/src/main/java/org/springframework/jndi/support/SimpleJndiBeanFactory.java b/spring-context/src/main/java/org/springframework/jndi/support/SimpleJndiBeanFactory.java index 5413f7b201..13b0f751d7 100644 --- a/spring-context/src/main/java/org/springframework/jndi/support/SimpleJndiBeanFactory.java +++ b/spring-context/src/main/java/org/springframework/jndi/support/SimpleJndiBeanFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -254,13 +254,12 @@ public class SimpleJndiBeanFactory extends JndiLocatorSupport implements BeanFac @SuppressWarnings("unchecked") private T doGetSingleton(String name, @Nullable Class requiredType) throws NamingException { synchronized (this.singletonObjects) { - if (this.singletonObjects.containsKey(name)) { - Object jndiObject = this.singletonObjects.get(name); - if (requiredType != null && !requiredType.isInstance(jndiObject)) { - throw new TypeMismatchNamingException( - convertJndiName(name), requiredType, (jndiObject != null ? jndiObject.getClass() : null)); + Object singleton = this.singletonObjects.get(name); + if (singleton != null) { + if (requiredType != null && !requiredType.isInstance(singleton)) { + throw new TypeMismatchNamingException(convertJndiName(name), requiredType, singleton.getClass()); } - return (T) jndiObject; + return (T) singleton; } T jndiObject = lookup(name, requiredType); this.singletonObjects.put(name, jndiObject); @@ -274,14 +273,12 @@ public class SimpleJndiBeanFactory extends JndiLocatorSupport implements BeanFac } else { synchronized (this.resourceTypes) { - if (this.resourceTypes.containsKey(name)) { - return this.resourceTypes.get(name); - } - else { - Class type = lookup(name, null).getClass(); + Class type = this.resourceTypes.get(name); + if (type == null) { + type = lookup(name, null).getClass(); this.resourceTypes.put(name, type); - return type; } + return type; } } } diff --git a/spring-core/src/main/java/org/springframework/core/codec/AbstractDecoder.java b/spring-core/src/main/java/org/springframework/core/codec/AbstractDecoder.java index 8ab00206d9..7810d20681 100644 --- a/spring-core/src/main/java/org/springframework/core/codec/AbstractDecoder.java +++ b/spring-core/src/main/java/org/springframework/core/codec/AbstractDecoder.java @@ -40,10 +40,10 @@ import org.springframework.util.MimeType; */ public abstract class AbstractDecoder implements Decoder { - protected Log logger = LogFactory.getLog(getClass()); - private final List decodableMimeTypes; + protected Log logger = LogFactory.getLog(getClass()); + protected AbstractDecoder(MimeType... supportedMimeTypes) { this.decodableMimeTypes = Arrays.asList(supportedMimeTypes); diff --git a/spring-core/src/main/java/org/springframework/core/codec/AbstractEncoder.java b/spring-core/src/main/java/org/springframework/core/codec/AbstractEncoder.java index 452b4ed5ca..5a2633d773 100644 --- a/spring-core/src/main/java/org/springframework/core/codec/AbstractEncoder.java +++ b/spring-core/src/main/java/org/springframework/core/codec/AbstractEncoder.java @@ -36,10 +36,10 @@ import org.springframework.util.MimeType; */ public abstract class AbstractEncoder implements Encoder { - protected Log logger = LogFactory.getLog(getClass()); - private final List encodableMimeTypes; + protected Log logger = LogFactory.getLog(getClass()); + protected AbstractEncoder(MimeType... supportedMimeTypes) { this.encodableMimeTypes = Arrays.asList(supportedMimeTypes); diff --git a/spring-core/src/main/java/org/springframework/core/log/CompositeLog.java b/spring-core/src/main/java/org/springframework/core/log/CompositeLog.java index 1cdd419416..9279180b1e 100644 --- a/spring-core/src/main/java/org/springframework/core/log/CompositeLog.java +++ b/spring-core/src/main/java/org/springframework/core/log/CompositeLog.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,38 +63,43 @@ final class CompositeLog implements Log { } private static Log initLogger(List loggers, Predicate predicate) { - return loggers.stream().filter(predicate).findFirst().orElse(NO_OP_LOG); + for (Log logger : loggers) { + if (predicate.test(logger)) { + return logger; + } + } + return NO_OP_LOG; } @Override public boolean isFatalEnabled() { - return this.fatalLogger != NO_OP_LOG; + return (this.fatalLogger != NO_OP_LOG); } @Override public boolean isErrorEnabled() { - return this.errorLogger != NO_OP_LOG; + return (this.errorLogger != NO_OP_LOG); } @Override public boolean isWarnEnabled() { - return this.warnLogger != NO_OP_LOG; + return (this.warnLogger != NO_OP_LOG); } @Override public boolean isInfoEnabled() { - return this.infoLogger != NO_OP_LOG; + return (this.infoLogger != NO_OP_LOG); } @Override public boolean isDebugEnabled() { - return this.debugLogger != NO_OP_LOG; + return (this.debugLogger != NO_OP_LOG); } @Override public boolean isTraceEnabled() { - return this.traceLogger != NO_OP_LOG; + return (this.traceLogger != NO_OP_LOG); } @Override diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/HandlerMethod.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/HandlerMethod.java index e31e560a78..41871e08f9 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/HandlerMethod.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/HandlerMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,8 +58,6 @@ public class HandlerMethod { public static final Log defaultLogger = LogFactory.getLog(HandlerMethod.class); - protected Log logger = defaultLogger; - private final Object bean; @Nullable @@ -76,6 +74,8 @@ public class HandlerMethod { @Nullable private HandlerMethod resolvedFromHandlerMethod; + protected Log logger = defaultLogger; + /** * Create an instance from a bean instance and a method. diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AsyncHandlerMethodReturnValueHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AsyncHandlerMethodReturnValueHandler.java index 506ec711cc..f7627b25a0 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AsyncHandlerMethodReturnValueHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AsyncHandlerMethodReturnValueHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,8 +43,8 @@ public interface AsyncHandlerMethodReturnValueHandler extends HandlerMethodRetur * {@link #supportsReturnType(org.springframework.core.MethodParameter)} * is called and it returns {@code true}. * @param returnValue the value returned from the handler method - * @param returnType the type of the return value. - * @return true if the return value type represents an async value. + * @param returnType the type of the return value + * @return {@code true} if the return value type represents an async value */ boolean isAsyncReturnValue(Object returnValue, MethodParameter returnType); @@ -58,9 +58,9 @@ public interface AsyncHandlerMethodReturnValueHandler extends HandlerMethodRetur * {@link #supportsReturnType(org.springframework.core.MethodParameter)} * is called and it returns {@code true}. * @param returnValue the value returned from the handler method - * @param returnType the type of the return value. - * @return the resulting ListenableFuture or {@code null} in which case no - * further handling will be performed. + * @param returnType the type of the return value + * @return the resulting ListenableFuture, or {@code null} in which case + * no further handling will be performed */ @Nullable ListenableFuture toListenableFuture(Object returnValue, MethodParameter returnType); diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/ReactiveReturnValueHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/ReactiveReturnValueHandler.java index 524b1d8719..7fb0f66964 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/ReactiveReturnValueHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/ReactiveReturnValueHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ public class ReactiveReturnValueHandler extends AbstractAsyncReturnValueHandler @Override public boolean supportsReturnType(MethodParameter returnType) { - return this.adapterRegistry.getAdapter(returnType.getParameterType()) != null; + return (this.adapterRegistry.getAdapter(returnType.getParameterType()) != null); } @Override diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java b/spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java index 61fdccdc0a..c933757d33 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,10 +42,10 @@ public abstract class AbstractMessageChannel implements MessageChannel, Intercep protected Log logger = LogFactory.getLog(getClass()); - private final List interceptors = new ArrayList<>(5); - private String beanName; + private final List interceptors = new ArrayList<>(5); + public AbstractMessageChannel() { this.beanName = getClass().getSimpleName() + "@" + ObjectUtils.getIdentityHexString(this); diff --git a/spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/ReactorNettyTcpClient.java b/spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/ReactorNettyTcpClient.java index 647b768ecc..078ec12c1e 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/ReactorNettyTcpClient.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/ReactorNettyTcpClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,8 +70,6 @@ public class ReactorNettyTcpClient

implements TcpOperations

{ private static final int PUBLISH_ON_BUFFER_SIZE = 16; - private Log logger = LogFactory.getLog(ReactorNettyTcpClient.class); - private final TcpClient tcpClient; @@ -81,13 +79,15 @@ public class ReactorNettyTcpClient

implements TcpOperations

{ private final ChannelGroup channelGroup; @Nullable - private LoopResources loopResources; + private final LoopResources loopResources; @Nullable - private ConnectionProvider poolResources; + private final ConnectionProvider poolResources; private final Scheduler scheduler = Schedulers.newParallel("tcp-client-scheduler"); + private Log logger = LogFactory.getLog(ReactorNettyTcpClient.class); + private volatile boolean stopping = false; diff --git a/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java index 0cce38e0df..9ce94ca173 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java @@ -415,7 +415,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi } /** - * Indicates whether DTD parsing should be supported. + * Indicate whether DTD parsing should be supported. *

Default is {@code false} meaning that DTD is disabled. */ public void setSupportDtd(boolean supportDtd) { @@ -423,14 +423,14 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi } /** - * Whether DTD parsing is supported. + * Return whether DTD parsing is supported. */ public boolean isSupportDtd() { return this.supportDtd; } /** - * Indicates whether external XML entities are processed when unmarshalling. + * Indicate whether external XML entities are processed when unmarshalling. *

Default is {@code false}, meaning that external entities are not resolved. * Note that processing of external entities will only be enabled/disabled when the * {@code Source} passed to {@link #unmarshal(Source)} is a {@link SAXSource} or @@ -442,12 +442,12 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi public void setProcessExternalEntities(boolean processExternalEntities) { this.processExternalEntities = processExternalEntities; if (processExternalEntities) { - setSupportDtd(true); + this.supportDtd = true; } } /** - * Returns the configured value for whether XML external entities are allowed. + * Return whether XML external entities are allowed. */ public boolean isProcessExternalEntities() { return this.processExternalEntities; diff --git a/spring-oxm/src/main/java/org/springframework/oxm/support/AbstractMarshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/support/AbstractMarshaller.java index 236dda465c..94315a9f59 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/support/AbstractMarshaller.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/support/AbstractMarshaller.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,7 +86,7 @@ public abstract class AbstractMarshaller implements Marshaller, Unmarshaller { /** - * Indicates whether DTD parsing should be supported. + * Indicate whether DTD parsing should be supported. *

Default is {@code false} meaning that DTD is disabled. */ public void setSupportDtd(boolean supportDtd) { @@ -94,14 +94,14 @@ public abstract class AbstractMarshaller implements Marshaller, Unmarshaller { } /** - * Whether DTD parsing is supported. + * Return whether DTD parsing is supported. */ public boolean isSupportDtd() { return this.supportDtd; } /** - * Indicates whether external XML entities are processed when unmarshalling. + * Indicate whether external XML entities are processed when unmarshalling. *

Default is {@code false}, meaning that external entities are not resolved. * Note that processing of external entities will only be enabled/disabled when the * {@code Source} passed to {@link #unmarshal(Source)} is a {@link SAXSource} or @@ -113,12 +113,12 @@ public abstract class AbstractMarshaller implements Marshaller, Unmarshaller { public void setProcessExternalEntities(boolean processExternalEntities) { this.processExternalEntities = processExternalEntities; if (processExternalEntities) { - setSupportDtd(true); + this.supportDtd = true; } } /** - * Returns the configured value for whether XML external entities are allowed. + * Return whether XML external entities are allowed. * @see #createXmlReader() */ public boolean isProcessExternalEntities() { diff --git a/spring-test/src/test/java/org/springframework/test/web/client/DefaultRequestExpectationTests.java b/spring-test/src/test/java/org/springframework/test/web/client/DefaultRequestExpectationTests.java index 6e9f729c41..002f31d4f5 100644 --- a/spring-test/src/test/java/org/springframework/test/web/client/DefaultRequestExpectationTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/client/DefaultRequestExpectationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,15 +26,11 @@ import org.junit.rules.ExpectedException; import org.springframework.http.HttpMethod; import org.springframework.http.client.ClientHttpRequest; -import static junit.framework.TestCase.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.springframework.http.HttpMethod.GET; -import static org.springframework.http.HttpMethod.POST; -import static org.springframework.test.web.client.ExpectedCount.once; -import static org.springframework.test.web.client.ExpectedCount.twice; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; -import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; +import static org.junit.Assert.*; +import static org.springframework.http.HttpMethod.*; +import static org.springframework.test.web.client.ExpectedCount.*; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.*; +import static org.springframework.test.web.client.response.MockRestResponseCreators.*; /** * Unit tests for {@link DefaultRequestExpectation}. @@ -86,7 +82,6 @@ public class DefaultRequestExpectationTests { } - @SuppressWarnings("deprecation") private ClientHttpRequest createRequest(HttpMethod method, String url) { try { diff --git a/spring-test/src/test/java/org/springframework/test/web/client/MockRestServiceServerTests.java b/spring-test/src/test/java/org/springframework/test/web/client/MockRestServiceServerTests.java index 45462658d5..cae4a088bd 100644 --- a/spring-test/src/test/java/org/springframework/test/web/client/MockRestServiceServerTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/client/MockRestServiceServerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ import org.junit.Test; import org.springframework.test.web.client.MockRestServiceServer.MockRestServiceServerBuilder; import org.springframework.web.client.RestTemplate; +import static org.junit.Assert.*; import static org.springframework.http.HttpMethod.*; import static org.springframework.test.web.client.match.MockRestRequestMatchers.*; import static org.springframework.test.web.client.response.MockRestResponseCreators.*; @@ -124,6 +125,7 @@ public class MockRestServiceServerTests { try { this.restTemplate.getForEntity("/some-service/some-endpoint", String.class); + fail("Expected exception"); } catch (Exception ex) { this.restTemplate.postForEntity("/reporting-service/report-error", ex.toString(), String.class); diff --git a/spring-web/src/main/java/org/springframework/http/codec/HttpMessageWriter.java b/spring-web/src/main/java/org/springframework/http/codec/HttpMessageWriter.java index 56f28982c0..0b1b94b714 100644 --- a/spring-web/src/main/java/org/springframework/http/codec/HttpMessageWriter.java +++ b/spring-web/src/main/java/org/springframework/http/codec/HttpMessageWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ public interface HttpMessageWriter { /** * Whether the given object type is supported by this writer. * @param elementType the type of object to check - * @param mediaType the media type for the write, possibly {@code null} + * @param mediaType the media type for the write (possibly {@code null}) * @return {@code true} if writable, {@code false} otherwise */ boolean canWrite(ResolvableType elementType, @Nullable MediaType mediaType); @@ -60,8 +60,8 @@ public interface HttpMessageWriter { * @param inputStream the objects to write * @param elementType the type of objects in the stream which must have been * previously checked via {@link #canWrite(ResolvableType, MediaType)} - * @param mediaType the content type for the write, possibly {@code null} to - * indicate that the default content type of the writer must be used. + * @param mediaType the content type for the write (possibly {@code null} to + * indicate that the default content type of the writer must be used) * @param message the message to write to * @param hints additional information about how to encode and write * @return indicates completion or error @@ -77,8 +77,8 @@ public interface HttpMessageWriter { * value; for annotated controllers, the {@link MethodParameter} can be * accessed via {@link ResolvableType#getSource()}. * @param elementType the type of Objects in the input stream - * @param mediaType the content type to use, possibly {@code null} indicating - * the default content type of the writer should be used. + * @param mediaType the content type to use (possibly {@code null} indicating + * the default content type of the writer should be used) * @param request the current request * @param response the current response * @return a {@link Mono} that indicates completion of writing or error diff --git a/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverter.java index c516224a9e..57dd85cf26 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,7 @@ public class Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessa /** - * Indicates whether DTD parsing should be supported. + * Indicate whether DTD parsing should be supported. *

Default is {@code false} meaning that DTD is disabled. */ public void setSupportDtd(boolean supportDtd) { @@ -76,14 +76,14 @@ public class Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessa } /** - * Whether DTD parsing is supported. + * Return whether DTD parsing is supported. */ public boolean isSupportDtd() { return this.supportDtd; } /** - * Indicates whether external XML entities are processed when converting to a Source. + * Indicate whether external XML entities are processed when converting to a Source. *

Default is {@code false}, meaning that external entities are not resolved. *

Note: setting this option to {@code true} also * automatically sets {@link #setSupportDtd} to {@code true}. @@ -91,12 +91,12 @@ public class Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessa public void setProcessExternalEntities(boolean processExternalEntities) { this.processExternalEntities = processExternalEntities; if (processExternalEntities) { - setSupportDtd(true); + this.supportDtd = true; } } /** - * Returns the configured value for whether XML external entities are allowed. + * Return whether XML external entities are allowed. */ public boolean isProcessExternalEntities() { return this.processExternalEntities; diff --git a/spring-web/src/main/java/org/springframework/http/converter/xml/SourceHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/xml/SourceHttpMessageConverter.java index cca1cd706b..91835fe930 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/xml/SourceHttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/xml/SourceHttpMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -100,7 +100,7 @@ public class SourceHttpMessageConverter extends AbstractHttpMe /** - * Indicates whether DTD parsing should be supported. + * Indicate whether DTD parsing should be supported. *

Default is {@code false} meaning that DTD is disabled. */ public void setSupportDtd(boolean supportDtd) { @@ -108,14 +108,14 @@ public class SourceHttpMessageConverter extends AbstractHttpMe } /** - * Whether DTD parsing is supported. + * Return whether DTD parsing is supported. */ public boolean isSupportDtd() { return this.supportDtd; } /** - * Indicates whether external XML entities are processed when converting to a Source. + * Indicate whether external XML entities are processed when converting to a Source. *

Default is {@code false}, meaning that external entities are not resolved. *

Note: setting this option to {@code true} also * automatically sets {@link #setSupportDtd} to {@code true}. @@ -123,12 +123,12 @@ public class SourceHttpMessageConverter extends AbstractHttpMe public void setProcessExternalEntities(boolean processExternalEntities) { this.processExternalEntities = processExternalEntities; if (processExternalEntities) { - setSupportDtd(true); + this.supportDtd = true; } } /** - * Returns the configured value for whether XML external entities are allowed. + * Return whether XML external entities are allowed. */ public boolean isProcessExternalEntities() { return this.processExternalEntities; diff --git a/spring-web/src/main/java/org/springframework/web/client/RestTemplate.java b/spring-web/src/main/java/org/springframework/web/client/RestTemplate.java index b37a792d8d..a1444b05d9 100644 --- a/spring-web/src/main/java/org/springframework/web/client/RestTemplate.java +++ b/spring-web/src/main/java/org/springframework/web/client/RestTemplate.java @@ -950,9 +950,9 @@ public class RestTemplate extends InterceptingHttpAccessor implements RestOperat return; } } - String message = "No HttpMessageConverter for [" + requestBodyClass.getName() + "]"; + String message = "No HttpMessageConverter for " + requestBodyClass.getName(); if (requestContentType != null) { - message += " and content type [" + requestContentType + "]"; + message += " and content type \"" + requestContentType + "\""; } throw new RestClientException(message); } @@ -964,8 +964,7 @@ public class RestTemplate extends InterceptingHttpAccessor implements RestOperat logger.debug("Writing [" + body + "] as \"" + mediaType + "\""); } else { - String classname = converter.getClass().getName(); - logger.debug("Writing [" + body + "] with " + classname); + logger.debug("Writing [" + body + "] with " + converter.getClass().getName()); } } } diff --git a/spring-web/src/main/java/org/springframework/web/method/support/AsyncHandlerMethodReturnValueHandler.java b/spring-web/src/main/java/org/springframework/web/method/support/AsyncHandlerMethodReturnValueHandler.java index 9e6fb61040..c43de97316 100644 --- a/spring-web/src/main/java/org/springframework/web/method/support/AsyncHandlerMethodReturnValueHandler.java +++ b/spring-web/src/main/java/org/springframework/web/method/support/AsyncHandlerMethodReturnValueHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,9 +38,9 @@ public interface AsyncHandlerMethodReturnValueHandler extends HandlerMethodRetur /** * Whether the given return value represents asynchronous computation. - * @param returnValue the return value + * @param returnValue the value returned from the handler method * @param returnType the return type - * @return {@code true} if the return value is asynchronous + * @return {@code true} if the return value type represents an async value */ boolean isAsyncReturnValue(@Nullable Object returnValue, MethodParameter returnType); diff --git a/spring-web/src/main/java/org/springframework/web/server/NotAcceptableStatusException.java b/spring-web/src/main/java/org/springframework/web/server/NotAcceptableStatusException.java index c9bbb1f841..a93651f972 100644 --- a/spring-web/src/main/java/org/springframework/web/server/NotAcceptableStatusException.java +++ b/spring-web/src/main/java/org/springframework/web/server/NotAcceptableStatusException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,10 +43,10 @@ public class NotAcceptableStatusException extends ResponseStatusException { } /** - * Constructor for when requested Content-Type is not supported. + * Constructor for when the requested Content-Type is not supported. */ public NotAcceptableStatusException(List supportedMediaTypes) { - super(HttpStatus.NOT_ACCEPTABLE, "Could not find acceptable representation", null); + super(HttpStatus.NOT_ACCEPTABLE, "Could not find acceptable representation"); this.supportedMediaTypes = Collections.unmodifiableList(supportedMediaTypes); } diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/HandlerResultHandlerSupport.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/HandlerResultHandlerSupport.java index 292bb74cae..e974f42703 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/HandlerResultHandlerSupport.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/HandlerResultHandlerSupport.java @@ -117,8 +117,8 @@ public abstract class HandlerResultHandlerSupport implements Ordered { * @return the selected media type, or {@code null} if none */ @Nullable - protected MediaType selectMediaType(ServerWebExchange exchange, - Supplier> producibleTypesSupplier) { + protected MediaType selectMediaType( + ServerWebExchange exchange, Supplier> producibleTypesSupplier) { MediaType contentType = exchange.getResponse().getHeaders().getContentType(); if (contentType != null && contentType.isConcrete()) { @@ -157,8 +157,8 @@ public abstract class HandlerResultHandlerSupport implements Ordered { if (selected != null) { if (logger.isDebugEnabled()) { - logger.debug("Using '" + selected + "' given " + - acceptableTypes + " and supported " + producibleTypes); + logger.debug("Using '" + selected + "' given " + acceptableTypes + + " and supported " + producibleTypes); } } else if (logger.isDebugEnabled()) { @@ -173,9 +173,8 @@ public abstract class HandlerResultHandlerSupport implements Ordered { return getContentTypeResolver().resolveMediaTypes(exchange); } - @SuppressWarnings("unchecked") - private List getProducibleTypes(ServerWebExchange exchange, - Supplier> producibleTypesSupplier) { + private List getProducibleTypes( + ServerWebExchange exchange, Supplier> producibleTypesSupplier) { Set mediaTypes = exchange.getAttribute(HandlerMapping.PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE); return (mediaTypes != null ? new ArrayList<>(mediaTypes) : producibleTypesSupplier.get()); diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java index 5d29ce6cdd..ac1ecb50d2 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ package org.springframework.web.reactive.result.method.annotation; +import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; import org.reactivestreams.Publisher; import reactor.core.publisher.Mono; @@ -29,8 +29,6 @@ import org.springframework.core.ResolvableType; import org.springframework.core.codec.Hints; import org.springframework.http.MediaType; import org.springframework.http.codec.HttpMessageWriter; -import org.springframework.http.server.reactive.ServerHttpRequest; -import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.web.reactive.accept.RequestedContentTypeResolver; @@ -135,8 +133,6 @@ public abstract class AbstractMessageWriterResultHandler extends HandlerResultHa return Mono.from((Publisher) publisher); } - ServerHttpRequest request = exchange.getRequest(); - ServerHttpResponse response = exchange.getResponse(); MediaType bestMediaType = selectMediaType(exchange, () -> getMediaTypesFor(elementType)); if (bestMediaType != null) { String logPrefix = exchange.getLogPrefix(); @@ -146,18 +142,18 @@ public abstract class AbstractMessageWriterResultHandler extends HandlerResultHa } for (HttpMessageWriter writer : getMessageWriters()) { if (writer.canWrite(elementType, bestMediaType)) { - return writer.write((Publisher) publisher, actualType, elementType, bestMediaType, - request, response, Hints.from(Hints.LOG_PREFIX_HINT, logPrefix)); + return writer.write((Publisher) publisher, actualType, elementType, + bestMediaType, exchange.getRequest(), exchange.getResponse(), + Hints.from(Hints.LOG_PREFIX_HINT, logPrefix)); } } } - else { - if (getMediaTypesFor(elementType).isEmpty()) { - return Mono.error(new IllegalStateException("No writer for : " + elementType)); - } - } - return Mono.error(new NotAcceptableStatusException(getMediaTypesFor(elementType))); + List mediaTypes = getMediaTypesFor(elementType); + if (bestMediaType == null && mediaTypes.isEmpty()) { + return Mono.error(new IllegalStateException("No HttpMessageWriter for " + elementType)); + } + return Mono.error(new NotAcceptableStatusException(mediaTypes)); } private ResolvableType getElementType(ReactiveAdapter adapter, ResolvableType genericType) { @@ -173,10 +169,13 @@ public abstract class AbstractMessageWriterResultHandler extends HandlerResultHa } private List getMediaTypesFor(ResolvableType elementType) { - return getMessageWriters().stream() - .filter(converter -> converter.canWrite(elementType, null)) - .flatMap(converter -> converter.getWritableMediaTypes().stream()) - .collect(Collectors.toList()); + List writableMediaTypes = new ArrayList<>(); + for (HttpMessageWriter converter : getMessageWriters()) { + if (converter.canWrite(elementType, null)) { + writableMediaTypes.addAll(converter.getWritableMediaTypes()); + } + } + return writableMediaTypes; } } diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ControllerMethodResolver.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ControllerMethodResolver.java index 82762e2d09..68951775d8 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ControllerMethodResolver.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ControllerMethodResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -112,56 +112,56 @@ class ControllerMethodResolver { private final Map, SessionAttributesHandler> sessionAttributesHandlerCache = new ConcurrentHashMap<>(64); - ControllerMethodResolver(ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry reactiveRegistry, + ControllerMethodResolver(ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry adapterRegistry, ConfigurableApplicationContext context, List> readers) { Assert.notNull(customResolvers, "ArgumentResolverConfigurer is required"); - Assert.notNull(readers, "'messageReaders' is required"); - Assert.notNull(reactiveRegistry, "ReactiveAdapterRegistry is required"); + Assert.notNull(adapterRegistry, "ReactiveAdapterRegistry is required"); Assert.notNull(context, "ApplicationContext is required"); + Assert.notNull(readers, "HttpMessageReader List is required"); - this.initBinderResolvers = initBinderResolvers(customResolvers, reactiveRegistry, context); - this.modelAttributeResolvers = modelMethodResolvers(customResolvers, reactiveRegistry, context); - this.requestMappingResolvers = requestMappingResolvers(customResolvers, reactiveRegistry, context, readers); - this.exceptionHandlerResolvers = exceptionHandlerResolvers(customResolvers, reactiveRegistry, context); - this.reactiveAdapterRegistry = reactiveRegistry; + this.initBinderResolvers = initBinderResolvers(customResolvers, adapterRegistry, context); + this.modelAttributeResolvers = modelMethodResolvers(customResolvers, adapterRegistry, context); + this.requestMappingResolvers = requestMappingResolvers(customResolvers, adapterRegistry, context, readers); + this.exceptionHandlerResolvers = exceptionHandlerResolvers(customResolvers, adapterRegistry, context); + this.reactiveAdapterRegistry = adapterRegistry; initControllerAdviceCaches(context); } private List initBinderResolvers( - ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry reactiveRegistry, + ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry adapterRegistry, ConfigurableApplicationContext context) { - return initResolvers(customResolvers, reactiveRegistry, context, false, Collections.emptyList()).stream() + return initResolvers(customResolvers, adapterRegistry, context, false, Collections.emptyList()).stream() .filter(resolver -> resolver instanceof SyncHandlerMethodArgumentResolver) .map(resolver -> (SyncHandlerMethodArgumentResolver) resolver) .collect(Collectors.toList()); } private static List modelMethodResolvers( - ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry reactiveRegistry, + ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry adapterRegistry, ConfigurableApplicationContext context) { - return initResolvers(customResolvers, reactiveRegistry, context, true, Collections.emptyList()); + return initResolvers(customResolvers, adapterRegistry, context, true, Collections.emptyList()); } private static List requestMappingResolvers( - ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry reactiveRegistry, + ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry adapterRegistry, ConfigurableApplicationContext context, List> readers) { - return initResolvers(customResolvers, reactiveRegistry, context, true, readers); + return initResolvers(customResolvers, adapterRegistry, context, true, readers); } private static List exceptionHandlerResolvers( - ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry reactiveRegistry, + ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry adapterRegistry, ConfigurableApplicationContext context) { - return initResolvers(customResolvers, reactiveRegistry, context, false, Collections.emptyList()); + return initResolvers(customResolvers, adapterRegistry, context, false, Collections.emptyList()); } private static List initResolvers(ArgumentResolverConfigurer customResolvers, - ReactiveAdapterRegistry reactiveRegistry, ConfigurableApplicationContext context, + ReactiveAdapterRegistry adapterRegistry, ConfigurableApplicationContext context, boolean supportDataBinding, List> readers) { ConfigurableListableBeanFactory beanFactory = context.getBeanFactory(); @@ -169,48 +169,48 @@ class ControllerMethodResolver { // Annotation-based... List result = new ArrayList<>(); - result.add(new RequestParamMethodArgumentResolver(beanFactory, reactiveRegistry, false)); - result.add(new RequestParamMapMethodArgumentResolver(reactiveRegistry)); - result.add(new PathVariableMethodArgumentResolver(beanFactory, reactiveRegistry)); - result.add(new PathVariableMapMethodArgumentResolver(reactiveRegistry)); - result.add(new MatrixVariableMethodArgumentResolver(beanFactory, reactiveRegistry)); - result.add(new MatrixVariableMapMethodArgumentResolver(reactiveRegistry)); + result.add(new RequestParamMethodArgumentResolver(beanFactory, adapterRegistry, false)); + result.add(new RequestParamMapMethodArgumentResolver(adapterRegistry)); + result.add(new PathVariableMethodArgumentResolver(beanFactory, adapterRegistry)); + result.add(new PathVariableMapMethodArgumentResolver(adapterRegistry)); + result.add(new MatrixVariableMethodArgumentResolver(beanFactory, adapterRegistry)); + result.add(new MatrixVariableMapMethodArgumentResolver(adapterRegistry)); if (!readers.isEmpty()) { - result.add(new RequestBodyArgumentResolver(readers, reactiveRegistry)); - result.add(new RequestPartMethodArgumentResolver(readers, reactiveRegistry)); + result.add(new RequestBodyArgumentResolver(readers, adapterRegistry)); + result.add(new RequestPartMethodArgumentResolver(readers, adapterRegistry)); } if (supportDataBinding) { - result.add(new ModelAttributeMethodArgumentResolver(reactiveRegistry, false)); + result.add(new ModelAttributeMethodArgumentResolver(adapterRegistry, false)); } - result.add(new RequestHeaderMethodArgumentResolver(beanFactory, reactiveRegistry)); - result.add(new RequestHeaderMapMethodArgumentResolver(reactiveRegistry)); - result.add(new CookieValueMethodArgumentResolver(beanFactory, reactiveRegistry)); - result.add(new ExpressionValueMethodArgumentResolver(beanFactory, reactiveRegistry)); - result.add(new SessionAttributeMethodArgumentResolver(beanFactory, reactiveRegistry)); - result.add(new RequestAttributeMethodArgumentResolver(beanFactory, reactiveRegistry)); + result.add(new RequestHeaderMethodArgumentResolver(beanFactory, adapterRegistry)); + result.add(new RequestHeaderMapMethodArgumentResolver(adapterRegistry)); + result.add(new CookieValueMethodArgumentResolver(beanFactory, adapterRegistry)); + result.add(new ExpressionValueMethodArgumentResolver(beanFactory, adapterRegistry)); + result.add(new SessionAttributeMethodArgumentResolver(beanFactory, adapterRegistry)); + result.add(new RequestAttributeMethodArgumentResolver(beanFactory, adapterRegistry)); // Type-based... if (!readers.isEmpty()) { - result.add(new HttpEntityArgumentResolver(readers, reactiveRegistry)); + result.add(new HttpEntityArgumentResolver(readers, adapterRegistry)); } - result.add(new ModelArgumentResolver(reactiveRegistry)); + result.add(new ModelArgumentResolver(adapterRegistry)); if (supportDataBinding) { - result.add(new ErrorsMethodArgumentResolver(reactiveRegistry)); + result.add(new ErrorsMethodArgumentResolver(adapterRegistry)); } - result.add(new ServerWebExchangeArgumentResolver(reactiveRegistry)); - result.add(new PrincipalArgumentResolver(reactiveRegistry)); + result.add(new ServerWebExchangeArgumentResolver(adapterRegistry)); + result.add(new PrincipalArgumentResolver(adapterRegistry)); if (requestMappingMethod) { result.add(new SessionStatusMethodArgumentResolver()); } - result.add(new WebSessionArgumentResolver(reactiveRegistry)); + result.add(new WebSessionArgumentResolver(adapterRegistry)); // Custom... result.addAll(customResolvers.getCustomResolvers()); // Catch-all... - result.add(new RequestParamMethodArgumentResolver(beanFactory, reactiveRegistry, true)); + result.add(new RequestParamMethodArgumentResolver(beanFactory, adapterRegistry, true)); if (supportDataBinding) { - result.add(new ModelAttributeMethodArgumentResolver(reactiveRegistry, true)); + result.add(new ModelAttributeMethodArgumentResolver(adapterRegistry, true)); } return result; diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ModelAttributeMethodArgumentResolver.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ModelAttributeMethodArgumentResolver.java index d05e55a3d2..8022b3c26a 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ModelAttributeMethodArgumentResolver.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ModelAttributeMethodArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -160,10 +160,10 @@ public class ModelAttributeMethodArgumentResolver extends HandlerMethodArgumentR return createAttribute(attributeName, attributeType.toClass(), context, exchange); } - ReactiveAdapter adapterFrom = getAdapterRegistry().getAdapter(null, attribute); - if (adapterFrom != null) { - Assert.isTrue(!adapterFrom.isMultiValue(), "Data binding only supports single-value async types"); - return Mono.from(adapterFrom.toPublisher(attribute)); + ReactiveAdapter adapter = getAdapterRegistry().getAdapter(null, attribute); + if (adapter != null) { + Assert.isTrue(!adapter.isMultiValue(), "Data binding only supports single-value async types"); + return Mono.from(adapter.toPublisher(attribute)); } else { return Mono.justOrEmpty(attribute); diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/AbstractView.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/AbstractView.java index 8fbabc2e38..9a32fb19ca 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/AbstractView.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/AbstractView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ public abstract class AbstractView implements View, BeanNameAware, ApplicationCo private static final Object NO_VALUE = new Object(); - private final ReactiveAdapterRegistry reactiveAdapterRegistry; + private final ReactiveAdapterRegistry adapterRegistry; private final List mediaTypes = new ArrayList<>(4); @@ -78,7 +78,7 @@ public abstract class AbstractView implements View, BeanNameAware, ApplicationCo } public AbstractView(ReactiveAdapterRegistry reactiveAdapterRegistry) { - this.reactiveAdapterRegistry = reactiveAdapterRegistry; + this.adapterRegistry = reactiveAdapterRegistry; this.mediaTypes.add(ViewResolverSupport.DEFAULT_CONTENT_TYPE); } @@ -240,7 +240,7 @@ public abstract class AbstractView implements View, BeanNameAware, ApplicationCo if (value == null) { continue; } - ReactiveAdapter adapter = this.reactiveAdapterRegistry.getAdapter(null, value); + ReactiveAdapter adapter = this.adapterRegistry.getAdapter(null, value); if (adapter != null) { names.add(entry.getKey()); if (adapter.isMultiValue()) { diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterReturnValueHandler.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterReturnValueHandler.java index 5031995180..42fb9eef02 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterReturnValueHandler.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterReturnValueHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,17 +77,17 @@ public class ResponseBodyEmitterReturnValueHandler implements HandlerMethodRetur /** * Complete constructor with pluggable "reactive" type support. * @param messageConverters converters to write emitted objects with - * @param reactiveRegistry for reactive return value type support + * @param registry for reactive return value type support * @param executor for blocking I/O writes of items emitted from reactive types * @param manager for detecting streaming media types * @since 5.0 */ public ResponseBodyEmitterReturnValueHandler(List> messageConverters, - ReactiveAdapterRegistry reactiveRegistry, TaskExecutor executor, ContentNegotiationManager manager) { + ReactiveAdapterRegistry registry, TaskExecutor executor, ContentNegotiationManager manager) { Assert.notEmpty(messageConverters, "HttpMessageConverter List must not be empty"); this.messageConverters = messageConverters; - this.reactiveHandler = new ReactiveTypeHandler(reactiveRegistry, executor, manager); + this.reactiveHandler = new ReactiveTypeHandler(registry, executor, manager); }