You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
addActiveProfile does not check if profiles are initiated using a property. This means that you have to call getActiveProfiles() before calling addActiveProfile!
See code below:
protected Set<String> doGetActiveProfiles() {
if (this.activeProfiles.isEmpty()) {
String profiles = this.getProperty(ACTIVE_PROFILES_PROPERTY_NAME);
if (StringUtils.hasText(profiles)) {
setActiveProfiles(commaDelimitedListToStringArray(trimAllWhitespace(profiles)));
}
}
return this.activeProfiles;
}
public void addActiveProfile(String profile) {
if (this.logger.isDebugEnabled()) {
this.logger.debug(format("Activating profile '%s'", profile));
}
this.validateProfile(profile);
this.activeProfiles.add(profile);
}
commit c94bc2e709ab00b154fdedc613b92b093dc0d029
Author: Chris Beams <cbeams@vmware.com>
Commit: Chris Beams <cbeams@vmware.com>
Respect spring.profiles.active in #addActiveProfile
Prior to this commit, calls to ConfigurableEnvironment#addActiveProfile
would cause any active profile values provided via the
"spring.profiles.active" property to be ignored.
Now these two mechanisms can be used in conjunction and work as
expected.
Issue: SPR-9944
Jan Kronquist opened SPR-9944 and commented
addActiveProfile does not check if profiles are initiated using a property. This means that you have to call getActiveProfiles() before calling addActiveProfile!
See code below:
Affects: 3.1.3
Referenced from: commits c94bc2e
The text was updated successfully, but these errors were encountered: