You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previous to 3.4.0 (tested in 3.3.5), scoped beans using ScopedProxyMode.INTERFACES or ScopedProxyMode.TARGET_CLASS were being matched by any OnBeanCondition that checked for annotations. (e.g. @ConditionOnMissingBean(annotation = SomeAnnotation.class)). With 3.4.0 adding a check for autowire candidates and default candidates, this results in these beans no longer being matched.
Example
In this example testConditionalOnMissingBean() passes in both 3.4.0 and 3.3.5, but testConditionalOnMissingBean_Scoped() fails in 3.4.0 and passes in 3.3.5.
Note: In 3.3.5 the condition @ConditionalOnMissingBean(value = Void.class, annotation = AnnotationConditionQualifier.class) was used to effectively disable type based matching.
philwebb
changed the title
OnBeanCondition Annotation Processing of Scoped Proxies
OnBeanCondition fails to match on annotations when using Scoped Proxies
Dec 5, 2024
Description
Previous to 3.4.0 (tested in 3.3.5), scoped beans using
ScopedProxyMode.INTERFACES
orScopedProxyMode.TARGET_CLASS
were being matched by anyOnBeanCondition
that checked for annotations. (e.g.@ConditionOnMissingBean(annotation = SomeAnnotation.class)
). With 3.4.0 adding a check for autowire candidates and default candidates, this results in these beans no longer being matched.Example
In this example
testConditionalOnMissingBean()
passes in both3.4.0
and3.3.5
, buttestConditionalOnMissingBean_Scoped()
fails in3.4.0
and passes in3.3.5
.Note: In
3.3.5
the condition@ConditionalOnMissingBean(value = Void.class, annotation = AnnotationConditionQualifier.class)
was used to effectively disable type based matching.Source
Test
The text was updated successfully, but these errors were encountered: