Commit Graph

1935 Commits

Author SHA1 Message Date
Sebastien Deleuze 1c256a112b Parse correctly ContentDisposition header with semicolons
Issue: SPR-16091
2017-10-23 23:09:14 +02:00
Juergen Hoeller ecea82d3a5 Polishing 2017-10-23 17:14:09 +02:00
Rossen Stoyanchev 1cc5afe24b Fix lines over 120 characters
https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Code-Style#line-wrapping
2017-10-20 16:42:26 -04:00
Andy Wilkinson 07eee05d1d Add missing "be" in Part's javadoc
Closes gh-1570
2017-10-20 16:43:48 +02:00
Rossen Stoyanchev ab92754a2e @MatrixVariable resolvers for WebFlux
The information was already parsed and available in a request attribute
but until now there were no argument resolvers to expose it.

Issue: SPR-16005
2017-10-19 21:01:38 -04:00
Arjen Poutsma c7a15260d6 Various DataBuffer improvements
This commit introduces various improvements in DataBuffer:

- DataBuffer now exposes its read and write position, as well as its
capacity and writable byte count.
- Added DataBuffer.asByteBuffer(int, int)
- DataBufferUtils.read now reads directly into a DataBuffer, rather than
copying a ByteBuffer into a DataBuffer
- TomcatHttpHandler now reads directly into a DataBuffer

Issues: SPR-16068 SPR-16070
2017-10-19 10:38:52 +02:00
Juergen Hoeller 9df6f3e6b8 Polishing 2017-10-18 20:21:49 +02:00
Juergen Hoeller bec1fc1852 ModelAttributeMethodProcessor detects re-enabled binding declaration
Issue: SPR-16083
2017-10-18 12:31:22 +02:00
Juergen Hoeller ea00c7c6c8 Explicit notes on ExceptionHandler root vs cause resolution
Issue: SPR-16074
2017-10-18 12:18:30 +02:00
Rossen Stoyanchev 94c4a7f941 Shortcut factory method in MockServerWebExchange
MockServerWebExchange now has a second factory method that accepts a
MockServerHttpRequest.BaseBuilder.

Issue: SPR-16079
2017-10-17 12:23:12 -04:00
Rossen Stoyanchev 2d05e538fb Set path in CookieWebSessionIdResolver
Issue: SPR-16030
2017-10-16 09:55:58 -04:00
Rossen Stoyanchev 4831d38db2 Lower log level for ResponseStatusException
Issue: SPR-16049
2017-10-16 09:55:58 -04:00
Juergen Hoeller 3890d4c9eb AbstractServerHttpResponse stores HTTP status code as integer value
Issue: SPR-16073
2017-10-16 15:34:09 +02:00
Juergen Hoeller 43b5e21947 Consistent alias declarations for value attribute on stereotypes
Issue: SPR-16066
2017-10-13 18:18:12 +02:00
Juergen Hoeller 682186a20d Refactored CodecConfigurer creation for clearer subpackage interdependencies
Includes redeclaration of CodecConfigurer.DefaultCodecs without concrete Jackson decoder/encoder references in order to avoid hard Jackson dependency.

Issue: SPR-16064
2017-10-13 14:23:22 +02:00
Sebastien Deleuze 2962f085e5 Relax type check in FormHttpMessage(Reader|Writer)
Issue: SPR-16055
2017-10-12 17:48:42 +02:00
Juergen Hoeller 0d3fa4eb70 Upgrade to Apache Johnzon 1.1.4 2017-10-10 20:35:47 +02:00
Juergen Hoeller cc6e6490d2 Polishing 2017-10-09 13:59:29 +02:00
Rossen Stoyanchev 48c41049b1 Correct package for MockServerWebExchange
Discovered late, but not too late. MockServerWebExchange is now in the
proper package matching to the location of ServerWebExchange.
2017-09-29 17:03:23 -04:00
Rossen Stoyanchev 223e27d53d Package private request and response implementations
Concrete server and client, reactive request and response
implementations should not have to be accessed outside their package.
They could be seen as private to their HttpHandler adapters and
ClientHttpConnector's respectively.

The one exception, WebSocket upgrades in spring-webflux, is an internal
framework use case, accommodated via downcast + accessors in the
abstract base classes.
2017-09-29 13:04:03 -04:00
Rossen Stoyanchev 13c959296a Polish 2017-09-27 22:04:07 -04:00
Brian Clozel 126ac849e5 Fix behavior of ClientResponse#bodyTo** with Void
Prior to this commit, asking for a `Void` type using any of the
`ClientResponse#bodyTo*` methods would immediately return an empty
`Publisher` without consuming the response body.

Not doing so can lead to HTTP connection pool inconsistencies and/or
memory leaks, since:

* a connection that still has a response body being written to it cannot
be properly recycled in the connection pool
* incoming `DataBuffer` might not be released

This commit detects when `Void` types are asked as body types and in
those cases does the following:

1. Subscribe to the response body `Publisher` to allow the connection to
be returned to the connection pool
2. `cancel()` the body `Publisher` if the response body is not empty; in
that case, we choose to close the connection vs. consume the whole
response body

Those changes imply that `ClientHttpResponse` and other related
contracts don't need a `close()` method anymore.

Issue: SPR-16018
2017-09-28 00:58:38 +02:00
Juergen Hoeller ec345bf162 Revised handling of missing data class arguments
Includes unified detection of Kotlin's optional parameters in MethodParameter.isOptional(), reduces BeanUtils.findPrimaryConstructor to Kotlin semantics (for reuse in AutowiredAnnotationBeanPostProcessor), and finally introduces a common KotlinDetector delegate with an isKotlinType(Class) check.

Issue: SPR-15877
Issue: SPR-16020
2017-09-28 00:31:12 +02:00
Rossen Stoyanchev 6ee1af27c6 WebFlux supports HTTP HEAD
Issue: SPR-15994
2017-09-27 15:25:29 -04:00
Juergen Hoeller a1a7c62127 Consistent configurer access in WebMvcConfigurationSupport
Issue: SPR-16017

(cherry picked from commit 40ba95f)
2017-09-27 19:52:48 +02:00
Brian Clozel 10139d42fc Revisit meaning of response.close() in HTTP client
Prior to this issue, SPR-15920 added this new `close()` method which was
supposed to be called to clean resources after response processing.

This commit changes the meaning of that method: calling `close()` will
close the underlying HTTP connection. This has to be called if the
response body is not consumed by the application, since at that point
the underlying connection might be in an inconsistent state if shared in
a connection pool.

Issue: SPR-15993
2017-09-27 14:03:55 +02:00
Rossen Stoyanchev ec5969c578 InMemoryWebSession cleans up expired sessions
Issue: SPR-15963
2017-09-27 01:43:11 -04:00
Rossen Stoyanchev 15cc44e6e8 Add WebSession.invalidate()
Issue: SPR-15960
2017-09-27 00:10:38 -04:00
Rossen Stoyanchev 6da3518a66 WebSessionStore updates lastAccessTime on retrieve
Now that WebSessionStore is in charge of expiration checks on retrieve
it makes sense to also update the lastAccessTime on retrieve at the
same time, saving the need to call it after a retrieve.

Issue: SPR-15963
2017-09-26 23:12:58 -04:00
Rossen Stoyanchev cb2deccb2d WebSessionStore performs expiration check on retrieve
Issue: SPR-15963
2017-09-26 23:12:12 -04:00
Juergen Hoeller efce7902c4 Polishing 2017-09-27 01:34:11 +02:00
Rossen Stoyanchev eb6bd2d7b8 Remove args and return value lists from @RequestMapping
It is no longer adequate to list supported arguments and return values
-- between Web MVC and WebFlux, directly on the annotation.

Instead we have tables in the respective chapters in the reference with
cross references to each other.

Issue: SPR-15149
2017-09-26 15:29:58 -04:00
Eddú Meléndez 6f2d58fac6 Remove jackson-datatype-jdk7 auto registration
`jackson-datatype-jdk7` is not provided anymore. It's handlers are
incorporated in core databind.
2017-09-26 14:48:34 +02:00
Brian Clozel 95b83fe1ba Add zero copy support in reactor-based WebClient
This commit makes Reactor Netty `WebClient` instances
support zero-copy requests by implementing `ZeroCopyHttpOutputMessage`.

The implementation leverages the optimized `sendFile` mechanism if
available.
2017-09-26 11:05:48 +02:00
Andy Clement 07b961caa6 Empty path should match the "/" PathPattern
This commit makes both slash "/" and empty "" request paths match the
"/" `PathPattern`.

Issue: SPR-15653
2017-09-26 10:59:13 +02:00
Sebastien Deleuze 74120ef00f Add custom deserializers support to AbstractJackson2Decoder
Issue: SPR-15975
2017-09-25 23:21:50 +02:00
Juergen Hoeller e2882fe1db Build against EE 8 API level wherever possible
Upgrade to JAXB 2.3, JAX-WS 2.3, Annotations 1.3.1, Interceptor 1.2.1.
Also includes Log4J 2.9.1 and Asciidoctor 1.5.6.
2017-09-24 17:18:21 +02:00
Juergen Hoeller 9190b76ab9 Latest dependency updates (POI 3.17, Rome 1.8, EhCache 3.4, Caffeine 2.5.6, RxJava 2.1.4, Tomcat 8.5.21, JRuby 9.1.13, Rhino 1.7.7.2) 2017-09-23 11:28:19 +02:00
Stephane Maldini 21203921f0 sync with reactor-core snapshot 2017-09-22 13:56:39 -07:00
Juergen Hoeller 7ae59d0c2a Nullability refinements on private and static methods
Based on IntelliJ IDEA 2017.3 introspection results.

Issue: SPR-15756
2017-09-22 18:22:14 +02:00
Brian Clozel 60f47f4489 Fix memory leak in reactive multipart parser 2017-09-22 17:03:38 +02:00
Andreas Ahlenstorf b30f6fd991 Ensure that JSON is written to response body
Issue: SPR-15988
2017-09-21 12:19:35 +02:00
Juergen Hoeller 15c82afc1c Consistent conversion of Optional array/list arrangements
Issue: SPR-15918
Issue: SPR-15919
Issue: SPR-15676
2017-09-20 18:28:49 +02:00
Juergen Hoeller ea01c4113a Revisit MockPart constructors
Issue: SPR-15854
2017-09-20 10:55:06 +02:00
Juergen Hoeller 4cbef27f90 Consistent tolerance of unknown HTTP status codes behind RestTemplate
Issue: SPR-15978
2017-09-20 10:54:58 +02:00
Juergen Hoeller 3bd2154046 Polishing 2017-09-19 00:02:40 +02:00
areshetnikov 0f0b8dc745 Fix class name in javadoc
Closes gh-1530
2017-09-18 14:28:37 +02:00
Sebastien Deleuze 1bc93e3d0f Revisit nullability annotations
This commit introduces the following changes.

1) It adds a new Spring @NonNull annotation which allows to apply
@NonNullApi semantic on a specific element, like @Nullable does.
Combined with @Nullable, it allows partial null-safety support when
package granularity is too broad.

2) @Nullable and @NonNull can apply to ElementType.TYPE_USE in order
to be used on generic type arguments (SPR-15942).

3) Annotations does not apply to ElementType.TYPE_PARAMETER anymore
since it is not supported yet (applicability for such use case is
controversial and need to be discussed).

4) @NonNullApi does not apply to ElementType.FIELD anymore since in a
lot of use cases (private, protected) it is not part for the public API
+ its usage should remain opt-in. A dedicated @NonNullFields annotation
has been added in order to set fields default to non-nullable.

5) Updated Javadoc and reference documentation.

Issue: SPR-15756
2017-09-15 13:26:41 +02:00
Violeta Georgieva ec2218c967 AbstractListenerWriteFlushProcessor: Ensure the last flush will be performed
When writing Publisher<Publisher<T>>, a flush operation is performed onComplete
for every Publisher. If the flush operation is not able to be performed immediately
it will be retried before starting to process data provided by the next Publisher.
For the last Publisher the implementation needs to ensure that the flush will
be performed only then whole operation will complete.

Issue: SPR-15949
2017-09-15 08:53:00 +02:00
Arjen Poutsma 2510db0683 Javadoc 2017-09-14 17:23:25 +02:00