Skip to content

Declared defaults do not get property references replace #29495

Open
@odrotbohm

Description

@odrotbohm

Assume you declare a configuration properties class like this:

@ConstructorBinding
@ConfigurationProperties("sample")
class SampleProperties {

  SampleProperties(@DefaultValue("${user.home}/foo") String location) { … }
}

If the application now configures the property sample.location to ${user.home}/bar, the constructor is called with /Users/…/bar, i.e. the dynamic reference to the user home folder has been replaced with the actual value. If the application does not configure an explicit value, the value handed into constructor is literally ${user.home}/foo, i.e. the reference to the user's home directory is not resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions