File tree Expand file tree Collapse file tree 4 files changed +8
-14
lines changed
main/java/org/springframework/core/env
test/java/org/springframework/core/env
spring-web/src/main/java/org/springframework/web/context/support Expand file tree Collapse file tree 4 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -129,8 +129,8 @@ public AbstractEnvironment() {
129129 * {@link #customizePropertySources(MutablePropertySources)} during
130130 * construction to allow subclasses to contribute or manipulate
131131 * {@link PropertySource} instances as appropriate.
132- * @see #customizePropertySources(MutablePropertySources)
133132 * @since 5.3.4
133+ * @see #customizePropertySources(MutablePropertySources)
134134 */
135135 protected AbstractEnvironment (MutablePropertySources propertySources ) {
136136 this .propertySources = propertySources ;
@@ -142,17 +142,17 @@ protected AbstractEnvironment(MutablePropertySources propertySources) {
142142 /**
143143 * Factory method used to create the {@link ConfigurablePropertyResolver}
144144 * instance used by the Environment.
145- * @see #getPropertyResolver()
146145 * @since 5.3.4
146+ * @see #getPropertyResolver()
147147 */
148- protected ConfigurablePropertyResolver createPropertyResolver (
149- MutablePropertySources propertySources ) {
148+ protected ConfigurablePropertyResolver createPropertyResolver (MutablePropertySources propertySources ) {
150149 return new PropertySourcesPropertyResolver (propertySources );
151150 }
152151
153152 /**
154153 * Return the {@link ConfigurablePropertyResolver} being used by the
155154 * {@link Environment}.
155+ * @since 5.3.4
156156 * @see #createPropertyResolver(MutablePropertySources)
157157 */
158158 protected final ConfigurablePropertyResolver getPropertyResolver () {
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2019 the original author or authors.
2+ * Copyright 2002-2021 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change @@ -131,18 +131,15 @@ protected String doGetDefaultProfilesProperty() {
131131
132132 @ Test
133133 public void withCustomMutablePropertySources () {
134- class CustomMutablePropertySources extends MutablePropertySources {
135- }
134+ class CustomMutablePropertySources extends MutablePropertySources {}
136135 MutablePropertySources propertySources = new CustomMutablePropertySources ();
137- ConfigurableEnvironment env = new AbstractEnvironment (propertySources ) {
138- };
136+ ConfigurableEnvironment env = new AbstractEnvironment (propertySources ) {};
139137 assertThat (env .getPropertySources ()).isInstanceOf (CustomMutablePropertySources .class );
140138 }
141139
142140 @ Test
143141 void withCustomPropertyResolver () {
144142 class CustomPropertySourcesPropertyResolver extends PropertySourcesPropertyResolver {
145-
146143 public CustomPropertySourcesPropertyResolver (
147144 PropertySources propertySources ) {
148145 super (propertySources );
@@ -152,16 +149,13 @@ public CustomPropertySourcesPropertyResolver(
152149 public String getProperty (String key ) {
153150 return super .getProperty (key )+"-test" ;
154151 }
155-
156152 }
157153 ConfigurableEnvironment env = new AbstractEnvironment () {
158-
159154 @ Override
160155 protected ConfigurablePropertyResolver createPropertyResolver (
161156 MutablePropertySources propertySources ) {
162157 return new CustomPropertySourcesPropertyResolver (propertySources );
163158 }
164-
165159 };
166160 Map <String , Object > values = new LinkedHashMap <>();
167161 values .put ("spring" , "framework" );
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2018 the original author or authors.
2+ * Copyright 2002-2021 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
You can’t perform that action at this time.
0 commit comments