1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -227,15 +227,15 @@ public String[] getActiveProfiles() {
227
227
/**
228
228
* Return the set of active profiles as explicitly set through
229
229
* {@link #setActiveProfiles} or if the current set of active profiles
230
- * is empty, check for the presence of the {@value #ACTIVE_PROFILES_PROPERTY_NAME }
231
- * property and assign its value to the set of active profiles.
230
+ * is empty, check for the presence of {@link #doGetActiveProfilesProperty() }
231
+ * and assign its value to the set of active profiles.
232
232
* @see #getActiveProfiles()
233
- * @see #ACTIVE_PROFILES_PROPERTY_NAME
233
+ * @see #doGetActiveProfilesProperty()
234
234
*/
235
235
protected Set <String > doGetActiveProfiles () {
236
236
synchronized (this .activeProfiles ) {
237
237
if (this .activeProfiles .isEmpty ()) {
238
- String profiles = getProperty ( ACTIVE_PROFILES_PROPERTY_NAME );
238
+ String profiles = doGetActiveProfilesProperty ( );
239
239
if (StringUtils .hasText (profiles )) {
240
240
setActiveProfiles (StringUtils .commaDelimitedListToStringArray (
241
241
StringUtils .trimAllWhitespace (profiles )));
@@ -245,6 +245,15 @@ protected Set<String> doGetActiveProfiles() {
245
245
}
246
246
}
247
247
248
+ /**
249
+ * Return the property value for the active profiles.
250
+ * @since 5.3.4
251
+ * @see #ACTIVE_PROFILES_PROPERTY_NAME
252
+ */
253
+ protected String doGetActiveProfilesProperty () {
254
+ return getProperty (ACTIVE_PROFILES_PROPERTY_NAME );
255
+ }
256
+
248
257
@ Override
249
258
public void setActiveProfiles (String ... profiles ) {
250
259
Assert .notNull (profiles , "Profile array must not be null" );
@@ -282,18 +291,17 @@ public String[] getDefaultProfiles() {
282
291
* Return the set of default profiles explicitly set via
283
292
* {@link #setDefaultProfiles(String...)} or if the current set of default profiles
284
293
* consists only of {@linkplain #getReservedDefaultProfiles() reserved default
285
- * profiles}, then check for the presence of the
286
- * {@value #DEFAULT_PROFILES_PROPERTY_NAME} property and assign its value (if any)
287
- * to the set of default profiles.
294
+ * profiles}, then check for the presence of {@link #doGetActiveProfilesProperty()}
295
+ * and assign its value (if any) to the set of default profiles.
288
296
* @see #AbstractEnvironment()
289
297
* @see #getDefaultProfiles()
290
- * @see #DEFAULT_PROFILES_PROPERTY_NAME
291
298
* @see #getReservedDefaultProfiles()
299
+ * @see #doGetDefaultProfilesProperty()
292
300
*/
293
301
protected Set <String > doGetDefaultProfiles () {
294
302
synchronized (this .defaultProfiles ) {
295
303
if (this .defaultProfiles .equals (getReservedDefaultProfiles ())) {
296
- String profiles = getProperty ( DEFAULT_PROFILES_PROPERTY_NAME );
304
+ String profiles = doGetDefaultProfilesProperty ( );
297
305
if (StringUtils .hasText (profiles )) {
298
306
setDefaultProfiles (StringUtils .commaDelimitedListToStringArray (
299
307
StringUtils .trimAllWhitespace (profiles )));
@@ -303,6 +311,15 @@ protected Set<String> doGetDefaultProfiles() {
303
311
}
304
312
}
305
313
314
+ /**
315
+ * Return the property value for the default profiles.
316
+ * @since 5.3.4
317
+ * @see #DEFAULT_PROFILES_PROPERTY_NAME
318
+ */
319
+ protected String doGetDefaultProfilesProperty () {
320
+ return getProperty (DEFAULT_PROFILES_PROPERTY_NAME );
321
+ }
322
+
306
323
/**
307
324
* Specify the set of profiles to be made active by default if no other profiles
308
325
* are explicitly made active through {@link #setActiveProfiles}.
0 commit comments