Skip to content

Use consistent style for Nested/Collection/Map properties in @ConfigurationProperties #43919

Description

@quaff

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

  1. implicit initialized with null and expose getter and setter
  2. explicit initialized and expose getter and setter
  3. 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

  1. initialized with HashSet/HashMap
  2. initialized with LinkedHashSet/LinkedHashMap

I think option 2 is meaningless since the Binder will create ordered Set/Map.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions