Skip to content

Property placeholder with colon now considered as default value since 6.2 #34141

@multanis63

Description

@multanis63

Prior to Spring 6.2 I used to have a property like:
my.prop: ${safestore:///my/path}

With a custom property source:

public Object getProperty(String name) {
        if(name.startsWith("safestore:/")) {
              return ...
        } else {
             return null;
       }
}

With Spring 6.2, 'name' doesn't contain the full placeholder 'safestore:///my/path' anymore but only 'safestore'.
I guess this is now considered as a default value as it resolves to '///my/path'.

Is this expected behavior with Spring 6.2? If so, how could I achieve the same behavior as before?

Note: my property source is recorded with

environment.getPropertySources().addAfter(
                StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME,
                new KhanPropertySource(PROPERTY_SOURCE_NAME));

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions