Commit Graph

15100 Commits

Author SHA1 Message Date
Juergen Hoeller a0cea9a86f Polishing 2017-06-13 14:20:33 +02:00
Sebastien Deleuze aa28b6cb54 Upgrade to Kotlin 1.1.2-5
Changelog: https://github.com/JetBrains/kotlin/releases/tag/v1.1.2-5
2017-06-13 12:22:52 +02:00
Juergen Hoeller 779deb0fa7 Cleanup of duplicate semicolons
Issue: SPR-15654
2017-06-13 11:38:05 +02:00
Juergen Hoeller 7dd8dc62a5 Fixes for ignored tests after last week's nullability commit
Issue: SPR-15540
2017-06-13 11:37:58 +02:00
Stephane Nicoll 58242f2249 Polish 2017-06-13 10:13:14 +02:00
Stephane Nicoll 40df48fd95 Merge pull request #1454 from diguage:lambda
* pr/1454:
  Polish "Replace relevant code with lambda"
  Replace relevant code with lambda
2017-06-13 10:09:57 +02:00
Stephane Nicoll fc64b8040f Polish "Replace relevant code with lambda"
Closes gh-1454
2017-06-13 09:42:20 +02:00
diguage 4b1478d830 Replace relevant code with lambda
See gh-1454
2017-06-13 08:55:38 +02:00
Juergen Hoeller 738160538e TargetSource.getTarget() is nullable again (for compatibility with MethodInvocation.getThis)
Issue: SPR-15651
2017-06-13 03:11:36 +02:00
Juergen Hoeller 47ec966757 TargetSource.getTarget() is nullable again (for compatibility with MethodInvocation.getThis)
Issue: SPR-15651
2017-06-12 22:54:18 +02:00
Brian Clozel 233c15b80e Add PathPatternRegistry for handler mapping matching
Previously `HandlerMapping` implementation were heavily relying on
`String` path patterns, `PathMatcher` implementations and dedicated maps
for matching incoming request URL to an actual request handler.

This commit adds the `PathPatternRegistry` that holds `PathPattern`
instances and the associated request handler — matching results are then
shared as `PathMatchResult` instances. `AbstractUrlHandlerMapping` will
use this registry directly, but other components dealing with request
matching (like `PatternsRequestCondition`) will directly use ordered
`PathPattern` collections since ordering is important there.

This opens the door for faster request matching and simplifies the
design of this part.

Issue: SPR-15608
2017-06-12 18:53:05 +02:00
Brian Clozel 1f0d107d37 Enable trailing slash matching by default
This commit enables trailing slash matching in `PathPatternParser` by
default - this mirrors the default configuration in `PathMatcher`
implementations in MVC.
2017-06-12 16:17:18 +02:00
Juergen Hoeller 3ae84d6dd8 Consistent support for Charset/StandardCharsets in UriUtils etc
Issue: SPR-15613
2017-06-12 15:51:45 +02:00
Juergen Hoeller 14161d1dbf Protected applyLifecycleMethods in UrlBasedViewResolver
Issue: SPR-15219
2017-06-12 15:48:59 +02:00
Juergen Hoeller 6320976669 Latest dependency updates (H2 1.4.196, Apache JSTL 1.2.5, HtmlUnit 2.27) 2017-06-12 15:27:57 +02:00
Stephane Nicoll aca5eb7393 Merge pull request #1449 from diguage:dev
* pr/1449:
  Polish "Use Map#forEach instead of Map#entrySet#forEach"
  Use Map#forEach instead of Map#entrySet#forEach
2017-06-12 14:37:52 +02:00
Stephane Nicoll 451b419624 Polish "Use Map#forEach instead of Map#entrySet#forEach"
Closes gh-1449
2017-06-12 14:37:33 +02:00
diguage 2efa06237a Use Map#forEach instead of Map#entrySet#forEach
See gh-1449
2017-06-12 14:37:33 +02:00
Arjen Poutsma 424bc75fb1 Remove headers(HttpHeaders)
This commit removes the headers(HttpHeaders) method on ClientRequest and
ServerResponse, in favor of headers(Consumer<HttpHeaders>), which is
more flexible.
2017-06-12 14:14:40 +02:00
Arjen Poutsma 9bf82dc18f Add addAll(MultiValueMap)
This commit introduces a new method for MultiValueMap: addAll, which
adds all values of a given map (cf putAll, which replaces existing
values).
2017-06-12 14:12:12 +02:00
Arjen Poutsma 7085a30382 Improve capacity calculcation in DefaultDataBuffer
This commit improves the capacity calculation for the DefaultDataBuffer,
so that the capacity typically doubles instead of improving by the
minimal required amount.

Issue: SPR-15647
2017-06-12 11:04:19 +02:00
Sebastien Deleuze 3373a3f7ef Add Kotlin extensions for WebTestClient API
Issue: SPR-15622
2017-06-12 10:42:56 +02:00
Stephane Nicoll a665da415a Merge pull request #1450 from diguage:diamond
* pr/1450:
  Use the diamond syntax
2017-06-12 09:19:22 +02:00
diguage c1d44d9a34 Use the diamond syntax
Closes gh-1450
2017-06-12 09:19:06 +02:00
Stephane Nicoll ca1e682dc4 Merge pull request #1451 from diguage:lambda-map
* pr/1451:
  Polish "Refact iterator of Map with Java 8 forEach"
  Refact iterator of Map with Java 8 forEach
2017-06-12 08:58:33 +02:00
Stephane Nicoll 27aabb15f9 Polish "Refact iterator of Map with Java 8 forEach"
Closes gh-1451
2017-06-12 08:53:56 +02:00
diguage dab7a7f0ee Refact iterator of Map with Java 8 forEach
See gh-1451
2017-06-12 08:11:32 +02:00
Stephane Nicoll 5df053c44b Merge pull request #1455 from diguage:editor-config
* pr/1455:
  Add EditorConfig
2017-06-12 08:08:14 +02:00
diguage d33764353e Add EditorConfig
Closes gh-1455
2017-06-12 08:07:54 +02:00
Rossen Stoyanchev 38a12ed4ba Expose RequestPath in ServerHttpRequest
The new structured getPath() method replaces the existing
getContextPath() + getPathWithinApplication().

Issue: SPR-15648
2017-06-11 21:59:24 -04:00
Rossen Stoyanchev 2d17411ec4 Add RequestPath to http/server/reactive
Issue: SPR-15648
2017-06-11 21:59:24 -04:00
Juergen Hoeller e2e0410570 Method-level javadoc on XmlReaderContext etc 2017-06-11 12:03:05 +02:00
Juergen Hoeller f43ea96dd9 Upgrade to Apache Johnzon 1.1.1
Issue: SPR-15590
2017-06-11 12:02:57 +02:00
Rossen Stoyanchev 01a92517bd Refactor RequestedContentTypeResolverBuilder
The revised builder emphasizes creating a list of resolvers either
built-in or custom with each top-level builder method resulting in
adding a resolver.

By default only the Header resolver is configured.

The path extension resolver is removed altogether to discourage its use
but is trivial to create manually with the helpf of
UriUtils#extractFileExtension + MediaTypeFactory.

Issue: SPR-15639
2017-06-09 16:15:38 -04:00
Rossen Stoyanchev b0e8e7f536 Refactor MappingContentTypeResolver implementations
After the removal of suffix pattern matches, there is no longer a need
to expose the list of registered file extensions.

Also polish, refactor, and simplify the abstract base class
AbstractMappingContentTypeResolver and its sub-classes.

Issue: SPR-15639
2017-06-09 16:15:38 -04:00
Rossen Stoyanchev cb604738cf ResourceWebHandler uses MediaTypeFactory directly
There is no need for ResourceWebHandler to go through the
PathExtensionContentTypeResolver when MediaTypeFactory makes it easy to
perform such lookups for a given Resource.

This does not support any extensions explicitly registered through a
WebFluxConfigurer but it would be easy enough to pass those into
ResourceWebHandler as a simple Map<String, MediaType>, should the need
arise.

Issue: SPR-15639
2017-06-09 16:15:38 -04:00
Rossen Stoyanchev b65bfdb979 Remove HttpRequestPathHelper
The use of the undecoded URL path by default and the removal of suffix
pattern matching effectively means HttpRequestPathHelper is no longer
needed.

Issue: SPR-15640, SPR-15639
2017-06-09 16:15:38 -04:00
Rossen Stoyanchev 95196e1aee Use undecoded pathWithinApplication in WebFlux
Introduce pathWithinApplication() in ServerHttpRequest and use it for
request mapping purposes instead of LookupPath.

In turn this means that for request mapping purposes:
1) the path is not decoded
2) suffix pattern matching is not supported

Issue: SPR-15640
2017-06-09 16:15:38 -04:00
Andy Clement ff2af660cf PathPatternParser encodes patterns as it parses them
Before this commit there was no special handling for URL encoding
of the path pattern string coming into the path pattern parser. No
assumptions were made about it being in an encoded form or not.

With this change it is assumed incoming path patterns are not
encoded and as part of parsing the parser builds PathPattern
objects that include encoded elements. For example parsing "/f o"
will create a path pattern of the form "/f%20o". In this form
it can then be used to match against encoded paths.

Handling encoded characters is not trivial and has resulted in
some loss in matching speed but care has been taken to
avoid unnecessary creation of additional heap objects.  When
matching variables the variable values are return in a
decoded form. It is hoped the speed can be recovered, at least
for the common case of non-encoded incoming paths.

Issue: SPR-15640
2017-06-09 13:08:07 -07:00
Juergen Hoeller c0550f7eb6 Documented AbstractBeanFactory nullability warning
Issue: SPR-15540
2017-06-09 20:46:15 +02:00
Juergen Hoeller a1ce3244b0 Latest dependency updates (EclipseLink 2.6.5 RC2, JSON-B 1.0 RC2, Gson 2.8.1, Jetty 9.4.6, Netty 4.1.12) 2017-06-09 20:43:15 +02:00
Rob Winch b1345014b9 Update to Reactor Bismuth-M2
Issue: SPR-15646
2017-06-09 09:49:31 -05:00
Arjen Poutsma 5e954dcba0 Use ParameterizedTypeReference in public-facing WebFlux APIs
This commit changes the use of `ResolvableType` to
`ParameterizedTypeReference` in all public-facing WebFlux APIs. This
change removes the necessity for providing the parameterized type
information twice: once for creating the `ResolvableType`, and once for
specifying a `BodyExtractor`.

Issue: SPR-15636
2017-06-09 13:29:15 +02:00
Sebastien Deleuze b6c09fa76a Disambiguate BodyExtractors/Inserters Kotlin function names 2017-06-09 01:51:28 +03:00
Sebastien Deleuze 86580b2358 Polishing 2017-06-09 01:49:56 +03:00
Sebastien Deleuze 736bf1c502 Fix Kotlin dependencies
Avoid importing Kotlin 1.0.x from Mockito Kotlin and only depends on
kotlin-stdlib instead of kotlin-stdlib-jre8 since we don't use
additional jre7 or jre8 API.
2017-06-09 01:24:47 +03:00
Sebastien Deleuze 8579ae66fc Add comprehensive tests of Kotlin extensions
This commit also removes extensions hidden by Java API (varargs).
2017-06-09 01:01:16 +03:00
Juergen Hoeller fd53d2a51a Consistent use of @Nullable in spring-test
This commit also removes nullability from two common spots: ResolvableType.getType() and TargetSource.getTarget(), both of which are never effectively null with any regular implementation. For such scenarios, a non-null empty type/target is the cleaner contract.

Issue: SPR-15540
2017-06-08 22:52:59 +02:00
Juergen Hoeller ee5fa2633a Protect against null return value from DataSource.getConnection()
Issue: SPR-15641
2017-06-08 22:51:41 +02:00
Arjen Poutsma bf66f45283 Support overriding, removing headers in ClientRequest
This commit adds two Consumer based methods to ClientRequest that allow
for direct manipulation of the underlying headers or cookies map. As
such, these methods can be used to override or remove existing entries.

Issue: SPR-15635
2017-06-08 14:00:39 +02:00