diff --git a/spring-web-reactive/src/main/java/org/springframework/http/server/ReactiveServerHttpResponse.java b/spring-web-reactive/src/main/java/org/springframework/http/server/ReactiveServerHttpResponse.java index 514592df514..3563b7b07b2 100644 --- a/spring-web-reactive/src/main/java/org/springframework/http/server/ReactiveServerHttpResponse.java +++ b/spring-web-reactive/src/main/java/org/springframework/http/server/ReactiveServerHttpResponse.java @@ -16,8 +16,9 @@ package org.springframework.http.server; -import org.springframework.http.HttpStatus; import org.reactivestreams.Publisher; + +import org.springframework.http.HttpStatus; import org.springframework.http.ReactiveHttpOutputMessage; /** diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/JacksonJsonDecoder.java b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/JacksonJsonDecoder.java index 0562653bdc3..3b98fbfa5b5 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/JacksonJsonDecoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/JacksonJsonDecoder.java @@ -16,18 +16,19 @@ package org.springframework.reactive.codec.decoder; +import java.io.IOException; +import java.nio.ByteBuffer; + import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectReader; import org.reactivestreams.Publisher; +import reactor.Publishers; + import org.springframework.core.ResolvableType; import org.springframework.http.MediaType; import org.springframework.reactive.codec.CodecException; import org.springframework.reactive.codec.encoder.JacksonJsonEncoder; import org.springframework.reactive.io.ByteBufferInputStream; -import reactor.Publishers; - -import java.io.IOException; -import java.nio.ByteBuffer; /** * Decode from a bytes stream of JSON objects to a stream of {@code Object} (POJO). diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/Jaxb2Decoder.java b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/Jaxb2Decoder.java index bff1ef03341..c1c0dc1883a 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/Jaxb2Decoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/Jaxb2Decoder.java @@ -16,27 +16,32 @@ package org.springframework.reactive.codec.decoder; +import java.nio.ByteBuffer; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; +import javax.xml.bind.UnmarshalException; +import javax.xml.bind.Unmarshaller; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.transform.Source; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamSource; + import org.reactivestreams.Publisher; -import org.springframework.core.ResolvableType; -import org.springframework.http.MediaType; -import org.springframework.reactive.codec.CodecException; -import org.springframework.reactive.codec.encoder.Jaxb2Encoder; -import org.springframework.reactive.io.ByteBufferPublisherInputStream; -import org.springframework.util.Assert; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory; import reactor.Publishers; -import javax.xml.bind.*; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.transform.Source; -import javax.xml.transform.sax.SAXSource; -import javax.xml.transform.stream.StreamSource; -import java.nio.ByteBuffer; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; +import org.springframework.core.ResolvableType; +import org.springframework.http.MediaType; +import org.springframework.reactive.codec.CodecException; +import org.springframework.reactive.codec.encoder.Jaxb2Encoder; +import org.springframework.reactive.io.ByteBufferPublisherInputStream; +import org.springframework.util.Assert; /** * Decode from a bytes stream of XML elements to a stream of {@code Object} (POJO). diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/JsonObjectDecoder.java b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/JsonObjectDecoder.java index 9831b4035f4..e3346d97934 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/JsonObjectDecoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/JsonObjectDecoder.java @@ -16,20 +16,20 @@ package org.springframework.reactive.codec.decoder; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; + import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufUtil; import io.netty.buffer.Unpooled; import org.reactivestreams.Publisher; -import org.springframework.core.ResolvableType; -import org.springframework.http.MediaType; -import org.springframework.reactive.codec.encoder.JsonObjectEncoder; - import reactor.Publishers; import reactor.fn.Function; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; +import org.springframework.core.ResolvableType; +import org.springframework.http.MediaType; +import org.springframework.reactive.codec.encoder.JsonObjectEncoder; /** * Decode an arbitrary split byte stream representing JSON objects to a byte stream diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/StringDecoder.java b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/StringDecoder.java index 91742a84b7f..152cb6cf34d 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/StringDecoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/decoder/StringDecoder.java @@ -16,17 +16,18 @@ package org.springframework.reactive.codec.decoder; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + import org.reactivestreams.Publisher; +import reactor.Publishers; +import reactor.io.buffer.Buffer; + import org.springframework.core.ResolvableType; import org.springframework.http.MediaType; import org.springframework.reactive.codec.encoder.StringEncoder; import org.springframework.reactive.codec.support.HintUtils; -import reactor.Publishers; -import reactor.io.buffer.Buffer; - -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; /** * Decode from a bytes stream to a String stream. diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/JacksonJsonEncoder.java b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/JacksonJsonEncoder.java index efdb652be0f..f24f7d76d15 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/JacksonJsonEncoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/JacksonJsonEncoder.java @@ -16,18 +16,19 @@ package org.springframework.reactive.codec.encoder; +import java.io.IOException; +import java.nio.ByteBuffer; + import com.fasterxml.jackson.databind.ObjectMapper; import org.reactivestreams.Publisher; +import reactor.Publishers; +import reactor.io.buffer.Buffer; + import org.springframework.core.ResolvableType; import org.springframework.http.MediaType; import org.springframework.reactive.codec.CodecException; import org.springframework.reactive.codec.decoder.JacksonJsonDecoder; import org.springframework.reactive.io.BufferOutputStream; -import reactor.Publishers; -import reactor.io.buffer.Buffer; - -import java.io.IOException; -import java.nio.ByteBuffer; /** * Encode from an {@code Object} stream to a byte stream of JSON objects. diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/Jaxb2Encoder.java b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/Jaxb2Encoder.java index 3a2887e21f7..6533e5fe904 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/Jaxb2Encoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/Jaxb2Encoder.java @@ -16,7 +16,19 @@ package org.springframework.reactive.codec.encoder; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.MarshalException; +import javax.xml.bind.Marshaller; + import org.reactivestreams.Publisher; +import reactor.Publishers; +import reactor.io.buffer.Buffer; + import org.springframework.core.ResolvableType; import org.springframework.http.MediaType; import org.springframework.reactive.codec.CodecException; @@ -24,17 +36,6 @@ import org.springframework.reactive.codec.decoder.Jaxb2Decoder; import org.springframework.reactive.io.BufferOutputStream; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; -import reactor.Publishers; -import reactor.io.buffer.Buffer; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.MarshalException; -import javax.xml.bind.Marshaller; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; /** * Encode from an {@code Object} stream to a byte stream of XML elements. diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/JsonObjectEncoder.java b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/JsonObjectEncoder.java index d39e530f732..e6a070642af 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/JsonObjectEncoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/JsonObjectEncoder.java @@ -16,23 +16,22 @@ package org.springframework.reactive.codec.encoder; -import org.reactivestreams.Publisher; -import org.reactivestreams.Subscriber; -import org.springframework.core.ResolvableType; -import org.springframework.http.MediaType; -import org.springframework.reactive.codec.decoder.JsonObjectDecoder; - -import reactor.core.subscriber.SubscriberBarrier; - import java.nio.ByteBuffer; import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; import java.util.concurrent.atomic.AtomicLongFieldUpdater; -import static reactor.Publishers.*; - +import org.reactivestreams.Publisher; +import org.reactivestreams.Subscriber; +import reactor.core.subscriber.SubscriberBarrier; import reactor.core.support.BackpressureUtils; import reactor.io.buffer.Buffer; +import org.springframework.core.ResolvableType; +import org.springframework.http.MediaType; +import org.springframework.reactive.codec.decoder.JsonObjectDecoder; + +import static reactor.Publishers.lift; + /** * Encode a byte stream of individual JSON element to a byte stream representing a single * JSON array when if it contains more than one element. diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/StringEncoder.java b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/StringEncoder.java index ac267de1c1a..f7bc6699fcf 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/StringEncoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/codec/encoder/StringEncoder.java @@ -16,16 +16,17 @@ package org.springframework.reactive.codec.encoder; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + import org.reactivestreams.Publisher; +import reactor.Publishers; + import org.springframework.core.ResolvableType; import org.springframework.http.MediaType; import org.springframework.reactive.codec.decoder.StringDecoder; import org.springframework.reactive.codec.support.HintUtils; -import reactor.Publishers; - -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; /** * Encode from a String stream to a bytes stream. diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/io/ByteBufferPublisherInputStream.java b/spring-web-reactive/src/main/java/org/springframework/reactive/io/ByteBufferPublisherInputStream.java index 647e6887126..a4eace4e866 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/io/ByteBufferPublisherInputStream.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/io/ByteBufferPublisherInputStream.java @@ -16,16 +16,17 @@ package org.springframework.reactive.io; -import org.reactivestreams.Publisher; -import org.reactivestreams.Subscription; -import org.springframework.util.Assert; -import reactor.Publishers; - import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; import java.util.concurrent.BlockingQueue; +import org.reactivestreams.Publisher; +import org.reactivestreams.Subscription; +import reactor.Publishers; + +import org.springframework.util.Assert; + /** * {@code InputStream} implementation based on a byte array {@link Publisher}. * diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/web/dispatch/method/annotation/RequestBodyArgumentResolver.java b/spring-web-reactive/src/main/java/org/springframework/reactive/web/dispatch/method/annotation/RequestBodyArgumentResolver.java index 0dea573a221..e14be9ee214 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/web/dispatch/method/annotation/RequestBodyArgumentResolver.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/web/dispatch/method/annotation/RequestBodyArgumentResolver.java @@ -21,19 +21,8 @@ import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeUnit; import org.reactivestreams.Publisher; -import reactor.Publishers; -import reactor.core.publisher.convert.CompletableFutureConverter; -import reactor.core.publisher.convert.RxJava1Converter; -import reactor.core.publisher.convert.RxJava1SingleConverter; -import reactor.rx.Promise; -import reactor.rx.Stream; -import reactor.rx.Streams; -import rx.Observable; -import rx.Single; import org.springframework.core.MethodParameter; import org.springframework.core.ResolvableType; diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/web/dispatch/method/annotation/RequestMappingHandlerAdapter.java b/spring-web-reactive/src/main/java/org/springframework/reactive/web/dispatch/method/annotation/RequestMappingHandlerAdapter.java index a24859915bd..3ffa44d83c3 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/web/dispatch/method/annotation/RequestMappingHandlerAdapter.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/web/dispatch/method/annotation/RequestMappingHandlerAdapter.java @@ -22,10 +22,10 @@ import java.util.Arrays; import java.util.List; import org.springframework.beans.factory.InitializingBean; -import org.springframework.reactive.codec.decoder.ByteBufferDecoder; -import org.springframework.reactive.codec.decoder.ByteToMessageDecoder; import org.springframework.http.server.ReactiveServerHttpRequest; import org.springframework.http.server.ReactiveServerHttpResponse; +import org.springframework.reactive.codec.decoder.ByteBufferDecoder; +import org.springframework.reactive.codec.decoder.ByteToMessageDecoder; import org.springframework.reactive.codec.decoder.JacksonJsonDecoder; import org.springframework.reactive.codec.decoder.JsonObjectDecoder; import org.springframework.reactive.codec.decoder.StringDecoder; diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/web/dispatch/method/annotation/ResponseBodyResultHandler.java b/spring-web-reactive/src/main/java/org/springframework/reactive/web/dispatch/method/annotation/ResponseBodyResultHandler.java index 2fa6eb650a1..0bfd9cdd479 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/web/dispatch/method/annotation/ResponseBodyResultHandler.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/web/dispatch/method/annotation/ResponseBodyResultHandler.java @@ -16,22 +16,14 @@ package org.springframework.reactive.web.dispatch.method.annotation; -import java.lang.reflect.Type; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.concurrent.CompletableFuture; import org.reactivestreams.Publisher; import reactor.Publishers; -import reactor.core.publisher.convert.CompletableFutureConverter; -import reactor.core.publisher.convert.RxJava1Converter; -import reactor.core.publisher.convert.RxJava1SingleConverter; -import reactor.rx.Promise; -import rx.Observable; -import rx.Single; import org.springframework.core.MethodParameter; import org.springframework.core.Ordered; diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/reactor/ReactorServerHttpRequest.java b/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/reactor/ReactorServerHttpRequest.java index b79763bd332..b0a7512d92f 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/reactor/ReactorServerHttpRequest.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/reactor/ReactorServerHttpRequest.java @@ -21,18 +21,6 @@ import reactor.io.buffer.Buffer; import reactor.io.net.http.HttpChannel; import reactor.rx.Stream; import reactor.rx.Streams; -import java.net.URI; -import java.net.URISyntaxException; -import java.nio.ByteBuffer; - -import org.reactivestreams.Publisher; -import reactor.io.buffer.Buffer; -import reactor.io.net.http.HttpChannel; - -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.server.ReactiveServerHttpRequest; -import org.springframework.util.Assert; /** * @author Stephane Maldini diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/rxnetty/RxNettyHttpServer.java b/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/rxnetty/RxNettyHttpServer.java index d07cc78c840..f1526d1a3bb 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/rxnetty/RxNettyHttpServer.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/rxnetty/RxNettyHttpServer.java @@ -20,7 +20,6 @@ import io.netty.buffer.ByteBuf; import org.springframework.beans.factory.InitializingBean; import org.springframework.reactive.web.http.HttpServer; import org.springframework.reactive.web.http.HttpServerSupport; -import org.springframework.reactive.web.http.rxnetty.RequestHandlerAdapter; import org.springframework.util.Assert; diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/rxnetty/RxNettyServerHttpResponse.java b/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/rxnetty/RxNettyServerHttpResponse.java index b19180dd892..241d76fa59b 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/rxnetty/RxNettyServerHttpResponse.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/rxnetty/RxNettyServerHttpResponse.java @@ -21,10 +21,6 @@ import java.nio.ByteBuffer; import io.netty.handler.codec.http.HttpResponseStatus; import io.reactivex.netty.protocol.http.server.HttpServerResponse; import org.reactivestreams.Publisher; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.util.Assert; - import reactor.Publishers; import reactor.core.publisher.convert.RxJava1Converter; import reactor.io.buffer.Buffer; diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/servlet/AsyncContextSynchronizer.java b/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/servlet/AsyncContextSynchronizer.java index 98811b67a21..65240b963c3 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/servlet/AsyncContextSynchronizer.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/servlet/AsyncContextSynchronizer.java @@ -18,7 +18,6 @@ package org.springframework.reactive.web.http.servlet; import java.io.IOException; import java.util.concurrent.atomic.AtomicInteger; - import javax.servlet.AsyncContext; import javax.servlet.ServletInputStream; import javax.servlet.ServletOutputStream; diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/servlet/HttpHandlerServlet.java b/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/servlet/HttpHandlerServlet.java index 9bcddbfd6f8..5a6b7c2155a 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/servlet/HttpHandlerServlet.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/servlet/HttpHandlerServlet.java @@ -17,7 +17,6 @@ package org.springframework.reactive.web.http.servlet; import java.io.IOException; - import javax.servlet.AsyncContext; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; diff --git a/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/servlet/RequestBodyPublisher.java b/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/servlet/RequestBodyPublisher.java index c685882a094..12368fc1836 100644 --- a/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/servlet/RequestBodyPublisher.java +++ b/spring-web-reactive/src/main/java/org/springframework/reactive/web/http/servlet/RequestBodyPublisher.java @@ -18,9 +18,7 @@ package org.springframework.reactive.web.http.servlet; import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.charset.Charset; import java.util.Arrays; - import javax.servlet.ReadListener; import javax.servlet.ServletInputStream;