spring-projects / spring-projects/spring-framework
consider return a distincted value of MultiValueMap for AnnotatedTypeMetadata.getAllAnnotationAttributes
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 60.2k
- Forks
- 38.8k
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 27
Description
Here is a simple code sample:
@Configuration(proxyBeanMethods = false)
public class FooAutoConfiguration {
@ConditionalOnBean(FooProperties.class)
@ConditionalOnMissingBean
@Bean
public FooService fooService(FooProperties fooProperties) {
return new FooService();
}
}
pom.xml
...
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
...
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
</dependencies>
While evaluator conditional of FooService, It will be evaluated twice for OnBeanCondition because the AnnotatedTypeMetadata.getAllAnnotationAttributes returned value contains same className array org.springframework.boot.autoconfigure.condition.OnBeanCondition.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing AnnotatedTypeMetadata.getAllAnnotationAttributes and the OnBeanCondition evaluation path described in the sample. Confirm where the repeated org.springframework.boot.autoconfigure.condition.OnBeanCondition value is produced, then add a regression test showing the intended distinct result and that the condition is evaluated only once.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100