Skip to content

Support early class filtering for @ConditionalOnBean, @ConditionalOnSingleCandidate and @ConditionalOnWebApplication #13328

Closed
@YannCebron

Description

@YannCebron

Proposal:

For known Condition implementations, we "know" that they technically contain a "virtual" @ConditionalOnClass condition.

Sample:
org.springframework.boot.autoconfigure.condition.OnWebApplicationCondition#isServletWebApplication effectively equals @ConditionalOnClass("org.springframework.web.context.support.GenericWebApplicationContext") performed by corresponding ClassUtils.isPresent() call.

Benefits:

  1. Improved startup time for application
  2. Improved performance in IDEs using such metadata (as IntelliJ IDEA already does)

TBD: How can such knowledge be provided/maintained for any custom Condition implementation wishing to participate in this metadata generation.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions