diff --git a/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java b/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java index 622c8aead9d..6be02e76d2b 100644 --- a/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java +++ b/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java @@ -129,8 +129,8 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { * {@link #customizePropertySources(MutablePropertySources)} during * construction to allow subclasses to contribute or manipulate * {@link PropertySource} instances as appropriate. - * @see #customizePropertySources(MutablePropertySources) * @since 5.3.4 + * @see #customizePropertySources(MutablePropertySources) */ protected AbstractEnvironment(MutablePropertySources propertySources) { this.propertySources = propertySources; @@ -142,17 +142,17 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { /** * Factory method used to create the {@link ConfigurablePropertyResolver} * instance used by the Environment. - * @see #getPropertyResolver() * @since 5.3.4 + * @see #getPropertyResolver() */ - protected ConfigurablePropertyResolver createPropertyResolver( - MutablePropertySources propertySources) { + protected ConfigurablePropertyResolver createPropertyResolver(MutablePropertySources propertySources) { return new PropertySourcesPropertyResolver(propertySources); } /** * Return the {@link ConfigurablePropertyResolver} being used by the * {@link Environment}. + * @since 5.3.4 * @see #createPropertyResolver(MutablePropertySources) */ protected final ConfigurablePropertyResolver getPropertyResolver() { diff --git a/spring-core/src/main/java/org/springframework/core/env/StandardEnvironment.java b/spring-core/src/main/java/org/springframework/core/env/StandardEnvironment.java index a3b46456b80..5b6c60ada23 100644 --- a/spring-core/src/main/java/org/springframework/core/env/StandardEnvironment.java +++ b/spring-core/src/main/java/org/springframework/core/env/StandardEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-core/src/test/java/org/springframework/core/env/CustomEnvironmentTests.java b/spring-core/src/test/java/org/springframework/core/env/CustomEnvironmentTests.java index 2aa5ef7ef30..a1666abcfb1 100644 --- a/spring-core/src/test/java/org/springframework/core/env/CustomEnvironmentTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/CustomEnvironmentTests.java @@ -131,18 +131,15 @@ class CustomEnvironmentTests { @Test public void withCustomMutablePropertySources() { - class CustomMutablePropertySources extends MutablePropertySources { - } + class CustomMutablePropertySources extends MutablePropertySources {} MutablePropertySources propertySources = new CustomMutablePropertySources(); - ConfigurableEnvironment env = new AbstractEnvironment(propertySources) { - }; + ConfigurableEnvironment env = new AbstractEnvironment(propertySources) {}; assertThat(env.getPropertySources()).isInstanceOf(CustomMutablePropertySources.class); } @Test void withCustomPropertyResolver() { class CustomPropertySourcesPropertyResolver extends PropertySourcesPropertyResolver { - public CustomPropertySourcesPropertyResolver( PropertySources propertySources) { super(propertySources); @@ -152,16 +149,13 @@ class CustomEnvironmentTests { public String getProperty(String key) { return super.getProperty(key)+"-test"; } - } ConfigurableEnvironment env = new AbstractEnvironment() { - @Override protected ConfigurablePropertyResolver createPropertyResolver( MutablePropertySources propertySources) { return new CustomPropertySourcesPropertyResolver(propertySources); } - }; Map values = new LinkedHashMap<>(); values.put("spring", "framework"); diff --git a/spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java b/spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java index 9bc6fd7dc5b..00b09095e37 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.