From d8db91206e2193b028f8f2dd5a8f971cedf52f06 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Tue, 17 Dec 2019 17:15:49 -0500 Subject: [PATCH 1/2] Moves locateCollection impl to static method --- .../bootstrap/config/PropertySourceLocator.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceLocator.java b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceLocator.java index d6dc46cf..786d53b4 100644 --- a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceLocator.java +++ b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceLocator.java @@ -44,15 +44,20 @@ public interface PropertySourceLocator { PropertySource locate(Environment environment); default Collection> locateCollection(Environment environment) { - PropertySource propertySource = locate(environment); + return locateCollection(this, environment); + } + + static Collection> locateCollection(PropertySourceLocator locator, + Environment environment) { + PropertySource propertySource = locator.locate(environment); if (propertySource == null) { - return Collections.EMPTY_LIST; + return Collections.emptyList(); } if (CompositePropertySource.class.isInstance(propertySource)) { Collection> sources = ((CompositePropertySource) propertySource) .getPropertySources(); List> filteredSources = new ArrayList<>(); - for (PropertySource p : sources) { + for (PropertySource p : sources) { if (p != null) { filteredSources.add(p); } @@ -60,7 +65,7 @@ public interface PropertySourceLocator { return filteredSources; } else { - return (List) Arrays.asList(propertySource); + return Arrays.asList(propertySource); } } From 618d2b31bafe28d88d03ca19f2f007e51c9976c7 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Tue, 17 Dec 2019 17:16:43 -0500 Subject: [PATCH 2/2] Adds .flattened-pom.xml --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1b8abd7d..14b99f27 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ _site/ /spring-cloud-release-tools*.jar antrun .vscode/ +.flattened-pom.xml