Skip to content

Conditions evaluation report mistakenly prints '@ConditionalOnBean' for negative matches #19169

@xak2000

Description

@xak2000

Conditions evaluation report wrongly reports @ConditionalOnMissingBean conditions as if it was @ConditionalOnBean condition for negative matches.

Example:

============================
CONDITIONS EVALUATION REPORT
============================

... skipped text ...

Negative matches:
-----------------

... skipped text ...

   UserDetailsServiceAutoConfiguration:
      Did not match:
         - @ConditionalOnBean (types: org.springframework.security.authentication.AuthenticationManager,org.springframework.security.authentication.AuthenticationProvider,org.springframework.security.core.userdetails.UserDetailsService,org.springframework.security.oauth2.jwt.JwtDecoder,org.springframework.security.oauth2.server.resource.introspection.OpaqueTokenIntrospector; SearchStrategy: all) found beans of type 'org.springframework.security.authentication.AuthenticationManager' authenticationManager and found beans of type 'org.springframework.security.core.userdetails.UserDetailsService' myUserDetailsService and found beans of type 'org.springframework.security.authentication.AuthenticationProvider' anonymousUserAuthenticationProvider, myAuthenticationProvider (OnBeanCondition)
      Matched:
         - @ConditionalOnClass found required class 'org.springframework.security.authentication.AuthenticationManager' (OnClassCondition)

Here, we see in the report Did not match: @ConditionalOnBean... where it is actually a report for @ConditionalOnMissingBean condition from UserDetailsServiceAutoConfiguration class.

So, it works right, but mistakenly prints @ConditionalOnBean instead of @ConditionalOnMissingBean.


Spring Boot 2.2.1.RELEASE

Metadata

Metadata

Labels

status: supersededAn issue that has been superseded by anothertype: bugA general bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions