Extended DefaultAopProxyFactory to create Objenesis based proxies if the
library is on the classpath. This allows classes without a default
constructor being CGLib proxied. We're now falling back to original CGLib
based behavior in case the proxy creation using Objenesis fails.
Objenesis 2.0 is now inlined into spring-core to avoid interfering with
other Objenesis versions on the classpath.
Issue: SPR-10594
Also, DefaultListableBeanFactory logs a warning when overriding an application definition with a framework-generated definition now, which is expected to be an accident.
Issue: SPR-10607
We're using the same subtle PriorityOrdered/Ordered/non-ordered separation as for regular BeanFactoryPostProcessors and BeanPostProcessors now. Additionally, we're re-detecting BeanDefinitionRegistryPostProcessor bean names after every invocation phase, up until no further ones appear.
Issue: SPR-10630
This turned into a rather huge affair since it led to the introduction of a new AutowireCandidateResolver implementation in the spring-context module. That ACR impl is now being set through AnnotationConfigUtils; GenericApplicationContext and co do not set a default QualifierAnnotationAutowireCandidateResolver anymore (which has always been a smell anyway). At the same time, dependency ordering has moved from AutowiredAnnotationBeanPostProcessor to DefaultListableBeanFactory itself through a "dependencyComparator" strategy, applying to constructor dependencies and lazy resolution proxies as well.
Issue: SPR-10353
Fix @Condition evaluation to also consider super classes for both
@Configuration classes and regular @Components. This change allows
@Conditional annotations to be inherited and restores the previous
behavior of @Profile.
Issue: SPR-10840
Also fixing an old XmlBeanFactory test that relies on "ref local" which is gone in the 4.0 xsd now, redeclaring the affected file to an older xsd version.
Also, StandardReflectionParameterNameDiscoverer calls "Parameter.isNamePresent()" now to return null (and pass on to the next discoverer) if no JDK 8 parameters are available. Note that this requires OpenJDK 8 b100 or higher to compile now.
Issue: SPR-10532
When headers are being removed based on pattern matching, both the
new header names and the original header names need to be matched
against the pattern. Previously, only new headers were being
considered resulting in any matching original headers not being
removed.
When a header is being set, verify that the type that's provided is
legal for the header that's been set. For example, the error channel's
type must be a MessageChannel or a String.
The method that performs type verification is protected so that it
can be overriden by sub-classes. It is expected that an overriding
method will call the super method.
A new type MessageHeaderAccesssor provides read/write access to
MessageHeaders along with typed getter/setter methods along the lines
of the existing MessageBuilder methods (internally MessageBuilder
merely delegates to MessageHeaderAccessor). This class is extensible
with sub-classes expected to provide typed getter/setter methods for
specific categories of message headers.
NativeMessageHeaderAccessor is one specific sub-class that further
provides read/write access to headers from some external message
source (e.g. STOMP headers). Native headers are stored in a separate
MultiValueMap and kept under a specific key.
Update MethodValidationPostProcessor.setValidator(...) to use
LocalValidatorFactoryBean.getValidator() when possible.
This is required because LocalValidatorFactoryBean does not directly
implement the forExecutables() method introduced in bean validation v1.1.
Issue: SPR-10644