From d68ff29e9b1b991ea1b7d64119603f524c9084f6 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Wed, 10 Feb 2016 23:16:48 +0100 Subject: [PATCH] Use default buffer allocator in RequestMappingHandlerAdapter This commit removes RequestMappingHandlerAdapter's hard dependency on Netty by switching to the DefaultDataBufferAllocator. --- .../method/annotation/RequestMappingHandlerAdapter.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/method/annotation/RequestMappingHandlerAdapter.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/method/annotation/RequestMappingHandlerAdapter.java index 5a81e4de7a..bd19cc446e 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/method/annotation/RequestMappingHandlerAdapter.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/method/annotation/RequestMappingHandlerAdapter.java @@ -23,7 +23,6 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import io.netty.buffer.UnpooledByteBufAllocator; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import reactor.core.publisher.Mono; @@ -37,7 +36,7 @@ import org.springframework.core.codec.support.StringDecoder; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.core.io.buffer.DataBufferAllocator; -import org.springframework.core.io.buffer.NettyDataBufferAllocator; +import org.springframework.core.io.buffer.DefaultDataBufferAllocator; import org.springframework.ui.ExtendedModelMap; import org.springframework.ui.ModelMap; import org.springframework.util.ObjectUtils; @@ -62,8 +61,7 @@ public class RequestMappingHandlerAdapter implements HandlerAdapter, Initializin private ConversionService conversionService = new DefaultConversionService(); - private DataBufferAllocator allocator = - new NettyDataBufferAllocator(new UnpooledByteBufAllocator(false)); + private DataBufferAllocator allocator = new DefaultDataBufferAllocator(); private final Map, ExceptionHandlerMethodResolver> exceptionHandlerCache = new ConcurrentHashMap<>(64);