From 49ffb833a3fa53977afc9ebc7e055b217e73d7ee Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Sun, 11 May 2025 15:48:00 +0200 Subject: [PATCH] Sort methods to align with PropertySource declaration order See gh-34861 --- .../PropertySourcesPlaceholderConfigurer.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java b/spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java index 2686ba5764..11563360da 100644 --- a/spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java +++ b/spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java @@ -232,6 +232,16 @@ public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerS } + @Override + public boolean containsProperty(String name) { + for (PropertySource propertySource : super.source.getPropertySources()) { + if (propertySource.containsProperty(name)) { + return true; + } + } + return false; + } + @Override @Nullable public Object getProperty(String name) { @@ -244,16 +254,6 @@ public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerS return null; } - @Override - public boolean containsProperty(String name) { - for (PropertySource propertySource : super.source.getPropertySources()) { - if (propertySource.containsProperty(name)) { - return true; - } - } - return false; - } - @Override public String toString() { return "ConfigurableEnvironmentPropertySource {propertySources=" + super.source.getPropertySources() + "}"; @@ -274,14 +274,14 @@ public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerS @Override - @Nullable - public Object getProperty(String name) { - return super.source.getProperty(name); + public boolean containsProperty(String name) { + return super.source.containsProperty(name); } @Override - public boolean containsProperty(String name) { - return super.source.containsProperty(name); + @Nullable + public Object getProperty(String name) { + return super.source.getProperty(name); } @Override