Add ReactiveSortHandlerMethodArgumentResolver and extract shared code from imperative SortHandlerMethodArgumentResolver into SortHandlerMethodArgumentResolverSupport.
Original pull request: #264.
We now explicitly rejects null values for the Sort parameters in the constructor of PageRequest to avoid the creation of invalid instances if the IDE validation of nullability constraints is not in use.
We now remove partially populated PersistentEntity instances from the cache held in AbstractMappingContext as the creation could fail for other RuntimeExceptions other than a MappingException and we wouldn't want to keep the instances around in any case.
Slight refactorings in the unit tests so that we can easily create MappingContext instances that reject certain types with certain exceptions.
DATACMNS-783 introduced code to specialize a raw type containing generics with the type information from it's context so that it can be established if only the raw type has been e.g. stored as type hint in a store (SomeType<T> stored as SomeType and T needing to be reestablished from the context). That application of the context unfortunately did not consider that the raw type might carry generics information itself, like `SomeType extends Foo<String, Integer>`.
We've now changed the specialization algorithm so that the the target type is being looked at in the context of the type used for the assignment (e.g. `Foo<T, ID> foo`). If that assignment fully resolves the declared type, we just outright use the given type as it by definition carries all generics information plus better type information in the first place.
If the type to specialize on is only partially expanding the generics we now create a synthetic type to merge the generics information. I.e. a `SomeType<T> extends Foo<T, Integer>` stored as SomeType would still resolve ID to Integer but capture T from the context including all potentially declared bounds.
Related tickets: DATACMNS-783, DATACMNS-1138.
To resolve XSD files properly from the classpath, their HTTPS reference must be present in the spring.schemas to avoid internet interaction for resolving an XSD file.
We now inspect returned Collections whether we need to convert these at all. If not, we skip conversion.
Also, allocate GenericConversionService only once for memory-efficiency.
We now avoid the allocation of an Optional instance in the lookup of a dynamic projection in ParameterAccessor. Also, Lazy now exposes a ….getNullable() to be favored over ….getOptional() for hot code paths.
Replaced Stream and Optional usage with for-loops and nullable return values. Reuse parameter names to avoid repeated annotation lookups. Reuse result from Parameters.getBindable(). Introduce ParametersParameterAccessor.getValues() to consistently reuse a single accessor instance allowing access to the unwrapped values. Introduce type cache to QueryExecutionConverters to quickly reject types that do not require wrapping. Avoid recalculation of QueryMethod.isCollectionQuery().
PersistentPropertyAccessor now has an overloaded method to pass in a TraversalContext that can be prepared to property handlers for PersistentProperties. During the traversal, the handler is called with the value for the property so that it can e.g. extract list elements, map values etc.
Replace AtTest(expected = …) and ExpectedException with the corresponding AssertJ assertThatExceptionOfType(…) and assertThatIllegalArgumentException().isThrownBy(…).
A side effect of the fix for DATACMNS-1482 trigged source objects that already perfectly match the desired return type would still be subject to detailed inspection of potential conversions, which – by definition – will not kick in.
The code has now been changed to only trigger detailed inspection for collection values.
Related tickets: DATACMNS-1482.
If plain dots were submitted as elements in a Sort expression to be parsed by SortHandlerMethodArgumentResolver, those dots would be considered a property of the sort expression, which is of course wrong. We now drop property candidates solely consisting of dots and whitespace.