spring-projects / spring-projects/spring-boot
Use consistent style for Nested/Collection/Map properties in @ConfigurationProperties
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
There are different styles in the codebase, even in a single source file, is it possible and worthy to force same style by ArchUnit?
Nested/Collection/Map configuration property
- implicit initialized with null and expose getter and setter
- explicit initialized and expose getter and setter
- explicit initialized and mark the field as final (no setter)
I vote for option 2, and it is more common in the codebase.
Set/Map configuration property
- initialized with
HashSet/HashMap - initialized with
LinkedHashSet/LinkedHashMap
I think option 2 is meaningless since the Binder will create ordered Set/Map.
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 reviewing the @ConfigurationProperties patterns described in the issue and how ArchUnit is used or could be used in the Spring Boot codebase. Compare the initialization and Set/Map styles, then determine whether the proposed conventions can be enforced consistently. Done means the style choice is explicit and the relevant code is consistently checked.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100