1
1
/*
2
- * Copyright 2002-2016 the original author or authors.
2
+ * Copyright 2002-2018 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.
37
37
* <pre class="code">
38
38
* ConfigurableEnvironment environment = new StandardEnvironment();
39
39
* MutablePropertySources propertySources = environment.getPropertySources();
40
- * Map< String, String> myMap = new HashMap<String, String> ();
40
+ * Map< String, String> myMap = new HashMap<> ();
41
41
* myMap.put("xyz", "myValue");
42
42
* propertySources.addFirst(new MapPropertySource("MY_MAP", myMap));
43
43
* </pre>
@@ -78,26 +78,26 @@ public interface ConfigurableEnvironment extends Environment, ConfigurableProper
78
78
* <p>Any existing active profiles will be replaced with the given arguments; call
79
79
* with zero arguments to clear the current set of active profiles. Use
80
80
* {@link #addActiveProfile} to add a profile while preserving the existing set.
81
+ * @throws IllegalArgumentException if any profile is null, empty or whitespace-only
81
82
* @see #addActiveProfile
82
83
* @see #setDefaultProfiles
83
84
* @see org.springframework.context.annotation.Profile
84
85
* @see AbstractEnvironment#ACTIVE_PROFILES_PROPERTY_NAME
85
- * @throws IllegalArgumentException if any profile is null, empty or whitespace-only
86
86
*/
87
87
void setActiveProfiles (String ... profiles );
88
88
89
89
/**
90
90
* Add a profile to the current set of active profiles.
91
- * @see #setActiveProfiles
92
91
* @throws IllegalArgumentException if the profile is null, empty or whitespace-only
92
+ * @see #setActiveProfiles
93
93
*/
94
94
void addActiveProfile (String profile );
95
95
96
96
/**
97
97
* Specify the set of profiles to be made active by default if no other profiles
98
98
* are explicitly made active through {@link #setActiveProfiles}.
99
- * @see AbstractEnvironment#DEFAULT_PROFILES_PROPERTY_NAME
100
99
* @throws IllegalArgumentException if any profile is null, empty or whitespace-only
100
+ * @see AbstractEnvironment#DEFAULT_PROFILES_PROPERTY_NAME
101
101
*/
102
102
void setDefaultProfiles (String ... profiles );
103
103
@@ -119,34 +119,34 @@ public interface ConfigurableEnvironment extends Environment, ConfigurableProper
119
119
MutablePropertySources getPropertySources ();
120
120
121
121
/**
122
- * Return the value of {@link System#getenv ()} if allowed by the current
122
+ * Return the value of {@link System#getProperties ()} if allowed by the current
123
123
* {@link SecurityManager}, otherwise return a map implementation that will attempt
124
- * to access individual keys using calls to {@link System#getenv (String)}.
125
- * <p>Note that most {@link Environment} implementations will include this system
126
- * environment map as a default {@link PropertySource} to be searched. Therefore, it
127
- * is recommended that this method not be used directly unless bypassing other
128
- * property sources is expressly intended.
124
+ * to access individual keys using calls to {@link System#getProperty (String)}.
125
+ * <p>Note that most {@code Environment} implementations will include this system
126
+ * properties map as a default {@link PropertySource} to be searched. Therefore, it is
127
+ * recommended that this method not be used directly unless bypassing other property
128
+ * sources is expressly intended.
129
129
* <p>Calls to {@link Map#get(Object)} on the Map returned will never throw
130
130
* {@link IllegalAccessException}; in cases where the SecurityManager forbids access
131
131
* to a property, {@code null} will be returned and an INFO-level log message will be
132
132
* issued noting the exception.
133
133
*/
134
- Map <String , Object > getSystemEnvironment ();
134
+ Map <String , Object > getSystemProperties ();
135
135
136
136
/**
137
- * Return the value of {@link System#getProperties ()} if allowed by the current
137
+ * Return the value of {@link System#getenv ()} if allowed by the current
138
138
* {@link SecurityManager}, otherwise return a map implementation that will attempt
139
- * to access individual keys using calls to {@link System#getProperty (String)}.
140
- * <p>Note that most {@code Environment} implementations will include this system
141
- * properties map as a default {@link PropertySource} to be searched. Therefore, it is
142
- * recommended that this method not be used directly unless bypassing other property
143
- * sources is expressly intended.
139
+ * to access individual keys using calls to {@link System#getenv (String)}.
140
+ * <p>Note that most {@link Environment} implementations will include this system
141
+ * environment map as a default {@link PropertySource} to be searched. Therefore, it
142
+ * is recommended that this method not be used directly unless bypassing other
143
+ * property sources is expressly intended.
144
144
* <p>Calls to {@link Map#get(Object)} on the Map returned will never throw
145
145
* {@link IllegalAccessException}; in cases where the SecurityManager forbids access
146
146
* to a property, {@code null} will be returned and an INFO-level log message will be
147
147
* issued noting the exception.
148
148
*/
149
- Map <String , Object > getSystemProperties ();
149
+ Map <String , Object > getSystemEnvironment ();
150
150
151
151
/**
152
152
* Append the given parent environment's active profiles, default profiles and
0 commit comments