doGetActiveProfiles method

  1. @protected
Set<String> doGetActiveProfiles()

Resolves Active Profiles

Computes the effective set of active profiles, reading from the ACTIVE_PROFILES_PROPERTY_NAME if necessary.

Behavior

  • If _activeProfiles is empty, attempts to read the active profiles property.
  • Parses and applies the property value as a comma-delimited list.
  • Updates the internal _activeProfiles set.

Returns

A synchronized Set of active profile names.

Example

final activeProfiles = doGetActiveProfiles();
print(activeProfiles);

Notes

  • Thread-safe: access is synchronized on _activeProfiles.
  • Avoids repeated property lookups once populated.

Implementation

@protected
Set<String> doGetActiveProfiles() {
  return synchronized(_activeProfiles, () {
    if (_activeProfiles.isEmpty) {
      String? profiles = doGetActiveProfilesProperty();
      if (profiles?.isNotEmpty ?? false) {
        setActiveProfiles(StringUtils.commaDelimitedListToStringList(StringUtils.trimAllWhitespace(profiles!)));
      }
    }
    return _activeProfiles;
  });
}