In particular, the specified object name may use a placeholder for its domain part now, allowing for several instances of the MBean to be registered against the same MBeanServer from different applications.
Issue: SPR-8244
Remove canBypassConvert() methods from the ConversionService SPI
interface, restoring it to the previous Spring 3.1 incarnation.
Bypassing conversion is now only supported when using a
GenericConversionService.
Issue: SPR-9566
Bypass ObjectToObject conversion when source and object types are
identical and protect against a null source object.
Prior to this commit the TypeDescriptor was used to determine if
conversion was necessary. This caused issues when comparing a
descriptor with annotations to one without. The updated code
now compares using TypeDescriptor.getType().
The ObjectToObject converter will now no longer attempt to convert
null source objects.
Issue: SPR-9933
TypeDescriptor.valueOf now uses GenericCollectionTypeResolver to resolve
Collection and Map element types whereas previously this information was
simply not supported, i.e. null.
Issue: SPR-9257
Expand the kinds of tokens considered when parsing qualified type names.
This allows previously reserved words (for example 'mod') to be used as
part of a package name.
Issue: SPR-9862
This commit refactors changes introduced in 21760a8 as follows:
- Introduce top-level MessageCodeFormatter interface and
DefaultMessageCodesResolver#setMessageCodeFormatter property to allow
for user-defined message code formatting strategies
- Rename DefaultMessageCodesResolver.Style enum => DMCR.Format
- Refactor DefaultMessageCodesResolver.Format to implement the new
MessageCodeFormatter interface
The result is that users have convenient access to common formatting
strategies via the Format enum, while retaining the flexibility to
provide their own custom MessageCodeFormatter implementation if desired.
See DefaultMessageCodesResolverTests#shouldSupport*Format tests for
usage examples.
Issue: SPR-9707
Introduce new 'style' property to DefaultMessageCodesResolver allowing
for alternative message styles. Current styles are PREFIX_ERROR_CODE
and POSTFIX_ERROR_CODE. The default style retains existing behavior.
Issue: SPR-9707
# By Phillip Webb (6) and Chris Beams (1)
* SPR-9692:
Review and polish pull request #132
Support conversion from Enum Interface
Test SpEL unconditional argument conversion
Bypass conversion when possible
Extend conditional conversion support
Refactor GenericConversionService
Additional GenericConversionService Tests
Prior to this commit conversion between like types would often result in
a copy of the object. This can be problematic in the case of large byte
arrays and objects that do not have a default constructor.
The ConversionService SPI now includes canBypassConvert methods that can
be used to deduce when conversion is not needed. Several existing
converters have been updated to ensure they only apply when source and
target types differ.
This change introduces new methods to the ConversionService that will
break existing implementations. However, it anticipated that most users
are consuming the ConversionService interface rather then extending it.
Issue: SPR-9566
Introduce new ConditionalConversion interface that can be applied to
Converter, ConverterFactory or GenericConverter interfaces to make
them conditional. Prior to this commit the only
ConditionalGenericConverter could be conditional.
Issue: SPR-9928
Refactor internal workings of GenericConversionService in order to
better support future enhancements. This commit should not affect
existing behavior.
Issue: SPR-9927
The servlet spec recommends removing path parameters from the
contextPath, servletPath, and pathInfo but not from the requestURI.
This poses a challenge for the UrlPathHelper, which determines the
lookup path by comparing the above.
This change introduces a method that matches the requestURI to the
contextPath and servletPath ignoring path parameters (i.e. matrix
variables) for comparison purposes while also preserving them in the
resulting lookup path.
Allow the body of 'arg-type' XML elements to be used as an alternative to
'match' attribute when defining a 'replace-method' in XML configuration.
This change has been introduced primarily to support the samples printed
in the Apress 'Pro Spring' book.
Issue: SPR-9812
Code introduced in conjunction with SPR-5243 introduced package cycles
between the ~.test.context and ~.test.context.web packages. This was
caused by the fact that ContextLoaderUtils worked directly with the
@WebAppConfiguration and WebMergedContextConfiguration types.
To address this, the following methods have been introduced in
ContextLoaderUtils. These methods use reflection to circumvent hard
dependencies on the @WebAppConfiguration and
WebMergedContextConfiguration types.
- loadWebAppConfigurationClass()
- buildWebMergedContextConfiguration()
Issue: SPR-9924
Prior to this commit, the following two methods in ContextLoaderUtils
contained almost identical loops for traversing the test class
hierarchy:
- resolveContextLoaderClass(Class<?>, String)
- resolveContextConfigurationAttributes(Class<?>)
With this commit, resolveContextLoaderClass() no longer traverses the
class hierarchy. Instead, it now works directly with the resolved list
of ContextConfigurationAttributes, thereby removing code duplication.
Issue: SPR-9918
Code introduced in conjunction with SPR-5243 introduced package cycles
between the ~.test.context.web and ~.test.context.support packages. This
was caused by the fact that ServletTestExecutionListener extended
AbstractTestExecutionListener.
To address this, ServletTestExecutionListener now implements
TestExecutionListener directly.
Issue: SPR-9924
Prior to this commit the MockHttpServletRequest constructor chain set
the preferred local to Locale.ENGLISH. Furthermore, it was possible to
add additional preferred locales "in front" of ENGLISH; however, it was
not possible to delete ENGLISH from the list of preferred locales.
This commit documents the fact that ENGLISH is the default preferred
locale and makes it possible to set the list of preferred locales via a
new setPreferredLocales(List<Locale> locales) method.
Issue: SPR-9724