From 4e3c4395936b74a382bd6ae98ae9ccfac6febf4a Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Wed, 8 Jun 2016 15:06:27 -0400 Subject: [PATCH] Polish Encoder and Decoder --- .../springframework/core/codec/Decoder.java | 39 ++++++++++-------- .../springframework/core/codec/Encoder.java | 41 +++++++++++-------- .../core/codec/support/AbstractDecoder.java | 2 +- .../core/codec/support/AbstractEncoder.java | 2 +- .../support/AbstractSingleValueEncoder.java | 4 +- .../core/codec/support/ByteBufferDecoder.java | 8 ++-- .../core/codec/support/ByteBufferEncoder.java | 10 ++--- .../codec/support/JacksonJsonDecoder.java | 6 +-- .../codec/support/JacksonJsonEncoder.java | 12 +++--- .../core/codec/support/Jaxb2Decoder.java | 10 ++--- .../core/codec/support/Jaxb2Encoder.java | 6 +-- .../core/codec/support/JsonObjectDecoder.java | 2 +- .../core/codec/support/ResourceDecoder.java | 10 ++--- .../core/codec/support/ResourceEncoder.java | 6 +-- .../core/codec/support/StringDecoder.java | 8 ++-- .../core/codec/support/StringEncoder.java | 10 ++--- .../core/codec/support/XmlEventDecoder.java | 2 +- .../RequestBodyArgumentResolver.java | 3 -- 18 files changed, 96 insertions(+), 85 deletions(-) diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/Decoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/Decoder.java index 1b3d0410bb2..cfecb610482 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/Decoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/Decoder.java @@ -26,35 +26,42 @@ import org.springframework.core.io.buffer.DataBuffer; import org.springframework.util.MimeType; /** - * Decode a stream of bytes to a stream of type {@code T}. + * Strategy for decoding a {@link DataBuffer} input stream into an output stream + * of elements of type {@code }. * * @author Sebastien Deleuze - * @see Encoder + * @author Rossen Stoyanchev + * @param the type of elements in the output stream */ public interface Decoder { /** - * Whether the decoder supports the given Java and mime type. - * @param type the stream element type to process. - * @param mimeType the mime type to process. - * @param hints Additional information about how to do decode, optional. - * @return {@code true} if can process; {@code false} otherwise + * Whether the decoder supports the given target element type and the MIME + * type of the source stream. + * + * @param elementType the target element type for the output stream + * @param mimeType the mime type associated with the stream to decode + * @param hints additional information about how to do decode, optional + * @return {@code true} if supported, {@code false} otherwise */ - boolean canDecode(ResolvableType type, MimeType mimeType, Object... hints); + boolean canDecode(ResolvableType elementType, MimeType mimeType, Object... hints); /** - * Decode an input {@link DataBuffer} stream to an output stream of {@code T}. - * @param inputStream the input stream to process. - * @param type the stream element type to process. - * @param mimeType the mime type to process. - * @param hints Additional information about how to do decode, optional. - * @return the output stream + * Decode a {@link DataBuffer} input stream into a Flux of {@code T}. + * + * @param inputStream the {@code DataBuffer} input stream to decode + * @param elementType the expected type of elements in the output stream; + * this type must have been previously passed to the {@link #canDecode} + * method and it must have returned {@code true}. + * @param mimeType the MIME type associated with the input stream, optional + * @param hints additional information about how to do decode, optional + * @return the output stream with decoded elements */ - Flux decode(Publisher inputStream, ResolvableType type, + Flux decode(Publisher inputStream, ResolvableType elementType, MimeType mimeType, Object... hints); /** - * Return the list of mime types this decoder supports. + * Return the list of MIME types this decoder supports. */ List getSupportedMimeTypes(); diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/Encoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/Encoder.java index f7b53956598..62fa412601b 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/Encoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/Encoder.java @@ -27,34 +27,41 @@ import org.springframework.core.io.buffer.DataBufferFactory; import org.springframework.util.MimeType; /** - * Encode a stream of Objects of type {@code T} into a stream of bytes. + * Strategy to encode a stream of Objects of type {@code } into an output + * stream of bytes. * * @author Sebastien Deleuze - * @see Decoder + * @author Rossen Stoyanchev + * @param the type of elements in the input stream */ public interface Encoder { /** - * Indicate whether the given type and mime type can be processed by this encoder. - * @param type the stream element type to process. - * @param mimeType the mime type to process. - * @param hints Additional information about how to do decode, optional. - * @return {@code true} if can process; {@code false} otherwise + * Whether the encoder supports the given source element type and the MIME + * type for the output stream. + * + * @param elementType the type of elements in the source stream + * @param mimeType the MIME type for the output stream + * @param hints additional information about how to do encode, optional + * @return {@code true} if supported, {@code false} otherwise */ - boolean canEncode(ResolvableType type, MimeType mimeType, Object... hints); + boolean canEncode(ResolvableType elementType, MimeType mimeType, Object... hints); /** - * Encode an input stream of {@code T} to an output {@link DataBuffer} stream. - * @param inputStream the input stream to process. - * @param dataBufferFactory a buffer factory used to create the output - * @param type the stream element type to process. - * @param mimeType the mime type to process. - * @param hints Additional information about how to do decode, optional. + * Encode a stream of Objects of type {@code T} into a {@link DataBuffer} + * output stream. + * + * @param inputStream the input stream of Objects to encode + * @param bufferFactory for creating output stream {@code DataBuffer}'s + * @param elementType the expected type of elements in the input stream; + * this type must have been previously passed to the {@link #canEncode} + * method and it must have returned {@code true}. + * @param mimeType the MIME type for the output stream + * @param hints additional information about how to do encode, optional * @return the output stream */ - Flux encode(Publisher inputStream, - DataBufferFactory dataBufferFactory, ResolvableType type, - MimeType mimeType, Object... hints); + Flux encode(Publisher inputStream, DataBufferFactory bufferFactory, + ResolvableType elementType, MimeType mimeType, Object... hints); /** * Return the list of mime types this encoder supports. diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/AbstractDecoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/AbstractDecoder.java index fa1b0102b5d..b659b3b6d5b 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/AbstractDecoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/AbstractDecoder.java @@ -42,7 +42,7 @@ public abstract class AbstractDecoder implements Decoder { } @Override - public boolean canDecode(ResolvableType type, MimeType mimeType, Object... hints) { + public boolean canDecode(ResolvableType elementType, MimeType mimeType, Object... hints) { if (mimeType == null) { return true; } diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/AbstractEncoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/AbstractEncoder.java index 98d1c022a49..079a8beb229 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/AbstractEncoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/AbstractEncoder.java @@ -42,7 +42,7 @@ public abstract class AbstractEncoder implements Encoder { } @Override - public boolean canEncode(ResolvableType type, MimeType mimeType, Object... hints) { + public boolean canEncode(ResolvableType elementType, MimeType mimeType, Object... hints) { if (mimeType == null) { return true; } diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/AbstractSingleValueEncoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/AbstractSingleValueEncoder.java index 82264f003a3..c023670d8b3 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/AbstractSingleValueEncoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/AbstractSingleValueEncoder.java @@ -37,13 +37,13 @@ public abstract class AbstractSingleValueEncoder extends AbstractEncoder { @Override public final Flux encode(Publisher inputStream, - DataBufferFactory dataBufferFactory, ResolvableType type, MimeType mimeType, + DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Object... hints) { return Flux.from(inputStream). take(1). concatMap(t -> { try { - return encode(t, dataBufferFactory, type, mimeType); + return encode(t, bufferFactory, elementType, mimeType); } catch (Exception ex) { return Flux.error(ex); diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ByteBufferDecoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ByteBufferDecoder.java index a7fa543ad2b..3f9ead7694d 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ByteBufferDecoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ByteBufferDecoder.java @@ -40,13 +40,13 @@ public class ByteBufferDecoder extends AbstractDecoder { @Override - public boolean canDecode(ResolvableType type, MimeType mimeType, Object... hints) { - Class clazz = type.getRawClass(); - return (super.canDecode(type, mimeType, hints) && ByteBuffer.class.isAssignableFrom(clazz)); + public boolean canDecode(ResolvableType elementType, MimeType mimeType, Object... hints) { + Class clazz = elementType.getRawClass(); + return (super.canDecode(elementType, mimeType, hints) && ByteBuffer.class.isAssignableFrom(clazz)); } @Override - public Flux decode(Publisher inputStream, ResolvableType type, + public Flux decode(Publisher inputStream, ResolvableType elementType, MimeType mimeType, Object... hints) { return Flux.from(inputStream).map((dataBuffer) -> { ByteBuffer copy = ByteBuffer.allocate(dataBuffer.readableByteCount()); diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ByteBufferEncoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ByteBufferEncoder.java index fe1f0a9803a..c6e69a494e7 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ByteBufferEncoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ByteBufferEncoder.java @@ -38,17 +38,17 @@ public class ByteBufferEncoder extends AbstractEncoder { @Override - public boolean canEncode(ResolvableType type, MimeType mimeType, Object... hints) { - Class clazz = type.getRawClass(); - return (super.canEncode(type, mimeType, hints) && ByteBuffer.class.isAssignableFrom(clazz)); + public boolean canEncode(ResolvableType elementType, MimeType mimeType, Object... hints) { + Class clazz = elementType.getRawClass(); + return (super.canEncode(elementType, mimeType, hints) && ByteBuffer.class.isAssignableFrom(clazz)); } @Override public Flux encode(Publisher inputStream, - DataBufferFactory dataBufferFactory, ResolvableType type, MimeType mimeType, + DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Object... hints) { - return Flux.from(inputStream).map(dataBufferFactory::wrap); + return Flux.from(inputStream).map(bufferFactory::wrap); } } \ No newline at end of file diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/JacksonJsonDecoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/JacksonJsonDecoder.java index 3d6f406f7ea..ccf8f5be3b6 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/JacksonJsonDecoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/JacksonJsonDecoder.java @@ -61,14 +61,14 @@ public class JacksonJsonDecoder extends AbstractDecoder { } @Override - public Flux decode(Publisher inputStream, ResolvableType type, + public Flux decode(Publisher inputStream, ResolvableType elementType, MimeType mimeType, Object... hints) { - ObjectReader reader = this.mapper.readerFor(type.getRawClass()); + ObjectReader reader = this.mapper.readerFor(elementType.getRawClass()); Flux stream = Flux.from(inputStream); if (this.preProcessor != null) { - stream = this.preProcessor.decode(inputStream, type, mimeType, hints); + stream = this.preProcessor.decode(inputStream, elementType, mimeType, hints); } return stream.map(dataBuffer -> { diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/JacksonJsonEncoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/JacksonJsonEncoder.java index 7c0a9924aaa..084998b3f3c 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/JacksonJsonEncoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/JacksonJsonEncoder.java @@ -64,24 +64,24 @@ public class JacksonJsonEncoder extends AbstractEncoder { @Override public Flux encode(Publisher inputStream, - DataBufferFactory dataBufferFactory, ResolvableType type, MimeType mimeType, + DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Object... hints) { if (inputStream instanceof Mono) { // single object return Flux.from(inputStream) - .map(value -> serialize(value, dataBufferFactory)); + .map(value -> serialize(value, bufferFactory)); } else { // array Mono startArray = - Mono.just(dataBufferFactory.wrap(START_ARRAY_BUFFER)); + Mono.just(bufferFactory.wrap(START_ARRAY_BUFFER)); Flux arraySeparators = - Mono.just(dataBufferFactory.wrap(SEPARATOR_BUFFER)).repeat(); + Mono.just(bufferFactory.wrap(SEPARATOR_BUFFER)).repeat(); Mono endArray = - Mono.just(dataBufferFactory.wrap(END_ARRAY_BUFFER)); + Mono.just(bufferFactory.wrap(END_ARRAY_BUFFER)); Flux serializedObjects = Flux.from(inputStream) - .map(value -> serialize(value, dataBufferFactory)); + .map(value -> serialize(value, bufferFactory)); Flux array = Flux.zip(serializedObjects, arraySeparators) .flatMap(tuple -> Flux.just(tuple.getT1(), tuple.getT2())); diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/Jaxb2Decoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/Jaxb2Decoder.java index bcd86ff262b..0bf14b8c4ba 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/Jaxb2Decoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/Jaxb2Decoder.java @@ -69,9 +69,9 @@ public class Jaxb2Decoder extends AbstractDecoder { } @Override - public boolean canDecode(ResolvableType type, MimeType mimeType, Object... hints) { - if (super.canDecode(type, mimeType, hints)) { - Class outputClass = type.getRawClass(); + public boolean canDecode(ResolvableType elementType, MimeType mimeType, Object... hints) { + if (super.canDecode(elementType, mimeType, hints)) { + Class outputClass = elementType.getRawClass(); return outputClass.isAnnotationPresent(XmlRootElement.class) || outputClass.isAnnotationPresent(XmlType.class); } @@ -81,9 +81,9 @@ public class Jaxb2Decoder extends AbstractDecoder { } @Override - public Flux decode(Publisher inputStream, ResolvableType type, + public Flux decode(Publisher inputStream, ResolvableType elementType, MimeType mimeType, Object... hints) { - Class outputClass = type.getRawClass(); + Class outputClass = elementType.getRawClass(); Flux xmlEventFlux = this.xmlEventDecoder.decode(inputStream, null, mimeType); diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/Jaxb2Encoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/Jaxb2Encoder.java index d2d9d2f6cb7..e99c44d1d2c 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/Jaxb2Encoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/Jaxb2Encoder.java @@ -48,9 +48,9 @@ public class Jaxb2Encoder extends AbstractSingleValueEncoder { } @Override - public boolean canEncode(ResolvableType type, MimeType mimeType, Object... hints) { - if (super.canEncode(type, mimeType, hints)) { - Class outputClass = type.getRawClass(); + public boolean canEncode(ResolvableType elementType, MimeType mimeType, Object... hints) { + if (super.canEncode(elementType, mimeType, hints)) { + Class outputClass = elementType.getRawClass(); return outputClass.isAnnotationPresent(XmlRootElement.class) || outputClass.isAnnotationPresent(XmlType.class); } diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/JsonObjectDecoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/JsonObjectDecoder.java index fbcb00ab3d9..e45dc66c341 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/JsonObjectDecoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/JsonObjectDecoder.java @@ -93,7 +93,7 @@ public class JsonObjectDecoder extends AbstractDecoder { } @Override - public Flux decode(Publisher inputStream, ResolvableType type, + public Flux decode(Publisher inputStream, ResolvableType elementType, MimeType mimeType, Object... hints) { return Flux.from(inputStream) diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ResourceDecoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ResourceDecoder.java index 40ef6d0dbee..d36aba1854d 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ResourceDecoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ResourceDecoder.java @@ -43,17 +43,17 @@ public class ResourceDecoder extends AbstractDecoder { } @Override - public boolean canDecode(ResolvableType type, MimeType mimeType, Object... hints) { - Class clazz = type.getRawClass(); + public boolean canDecode(ResolvableType elementType, MimeType mimeType, Object... hints) { + Class clazz = elementType.getRawClass(); return (InputStreamResource.class.equals(clazz) || clazz.isAssignableFrom(ByteArrayResource.class)) && - super.canDecode(type, mimeType, hints); + super.canDecode(elementType, mimeType, hints); } @Override - public Flux decode(Publisher inputStream, ResolvableType type, + public Flux decode(Publisher inputStream, ResolvableType elementType, MimeType mimeType, Object... hints) { - Class clazz = type.getRawClass(); + Class clazz = elementType.getRawClass(); Mono byteArray = Flux.from(inputStream). reduce(DataBuffer::write). diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ResourceEncoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ResourceEncoder.java index 742c8de634a..5498ac153e4 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ResourceEncoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/ResourceEncoder.java @@ -52,9 +52,9 @@ public class ResourceEncoder extends AbstractSingleValueEncoder { } @Override - public boolean canEncode(ResolvableType type, MimeType mimeType, Object... hints) { - Class clazz = type.getRawClass(); - return (super.canEncode(type, mimeType, hints) && + public boolean canEncode(ResolvableType elementType, MimeType mimeType, Object... hints) { + Class clazz = elementType.getRawClass(); + return (super.canEncode(elementType, mimeType, hints) && Resource.class.isAssignableFrom(clazz)); } diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/StringDecoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/StringDecoder.java index ca477cde85b..a9673665c4c 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/StringDecoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/StringDecoder.java @@ -70,13 +70,13 @@ public class StringDecoder extends AbstractDecoder { } @Override - public boolean canDecode(ResolvableType type, MimeType mimeType, Object... hints) { - return super.canDecode(type, mimeType, hints) && - String.class.equals(type.getRawClass()); + public boolean canDecode(ResolvableType elementType, MimeType mimeType, Object... hints) { + return super.canDecode(elementType, mimeType, hints) && + String.class.equals(elementType.getRawClass()); } @Override - public Flux decode(Publisher inputStream, ResolvableType type, + public Flux decode(Publisher inputStream, ResolvableType elementType, MimeType mimeType, Object... hints) { Flux inputFlux = Flux.from(inputStream); if (this.splitOnNewline) { diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/StringEncoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/StringEncoder.java index 21c09cfc827..80e64f37a21 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/StringEncoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/StringEncoder.java @@ -43,14 +43,14 @@ public class StringEncoder extends AbstractEncoder { @Override - public boolean canEncode(ResolvableType type, MimeType mimeType, Object... hints) { - Class clazz = type.getRawClass(); - return (super.canEncode(type, mimeType, hints) && String.class.equals(clazz)); + public boolean canEncode(ResolvableType elementType, MimeType mimeType, Object... hints) { + Class clazz = elementType.getRawClass(); + return (super.canEncode(elementType, mimeType, hints) && String.class.equals(clazz)); } @Override public Flux encode(Publisher inputStream, - DataBufferFactory dataBufferFactory, ResolvableType type, MimeType mimeType, + DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Object... hints) { Charset charset; if (mimeType != null && mimeType.getCharSet() != null) { @@ -61,7 +61,7 @@ public class StringEncoder extends AbstractEncoder { } return Flux.from(inputStream).map(s -> { byte[] bytes = s.getBytes(charset); - DataBuffer dataBuffer = dataBufferFactory.allocateBuffer(bytes.length); + DataBuffer dataBuffer = bufferFactory.allocateBuffer(bytes.length); dataBuffer.write(bytes); return dataBuffer; }); diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/XmlEventDecoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/XmlEventDecoder.java index 3f27b97fb79..9dd8a1a9a44 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/XmlEventDecoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/XmlEventDecoder.java @@ -83,7 +83,7 @@ public class XmlEventDecoder extends AbstractDecoder { } @Override - public Flux decode(Publisher inputStream, ResolvableType type, + public Flux decode(Publisher inputStream, ResolvableType elementType, MimeType mimeType, Object... hints) { Flux flux = Flux.from(inputStream); if (useAalto && aaltoPresent) { diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestBodyArgumentResolver.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestBodyArgumentResolver.java index 32348e008f2..1d56999bab0 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestBodyArgumentResolver.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestBodyArgumentResolver.java @@ -19,8 +19,6 @@ package org.springframework.web.reactive.result.method.annotation; import java.util.List; import java.util.stream.Collectors; -import javax.xml.crypto.Data; - import org.reactivestreams.Publisher; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -28,7 +26,6 @@ import reactor.core.publisher.Mono; import org.springframework.core.MethodParameter; import org.springframework.core.ResolvableType; import org.springframework.core.convert.ConversionService; -import org.springframework.core.io.buffer.DataBuffer; import org.springframework.http.MediaType; import org.springframework.http.converter.reactive.HttpMessageConverter; import org.springframework.ui.ModelMap;