Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
5413ad3c
Commit
5413ad3c
authored
Apr 05, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12732 from dreis2211
* pr/12732: Populate cache in ConfigFileApplicationListener Polish
parents
0ec737a0
cc66de28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
ConfigFileApplicationListener.java
...rk/boot/context/config/ConfigFileApplicationListener.java
+1
-1
PropertySourceLoader.java
...va/org/springframework/boot/env/PropertySourceLoader.java
+1
-1
No files found.
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java
View file @
5413ad3c
...
@@ -539,12 +539,12 @@ public class ConfigFileApplicationListener
...
@@ -539,12 +539,12 @@ public class ConfigFileApplicationListener
private
List
<
Document
>
loadDocuments
(
PropertySourceLoader
loader
,
String
name
,
private
List
<
Document
>
loadDocuments
(
PropertySourceLoader
loader
,
String
name
,
Resource
resource
)
throws
IOException
{
Resource
resource
)
throws
IOException
{
loader
.
load
(
name
,
resource
);
DocumentsCacheKey
cacheKey
=
new
DocumentsCacheKey
(
loader
,
resource
);
DocumentsCacheKey
cacheKey
=
new
DocumentsCacheKey
(
loader
,
resource
);
List
<
Document
>
documents
=
this
.
loadDocumentsCache
.
get
(
cacheKey
);
List
<
Document
>
documents
=
this
.
loadDocumentsCache
.
get
(
cacheKey
);
if
(
documents
==
null
)
{
if
(
documents
==
null
)
{
List
<
PropertySource
<?>>
loaded
=
loader
.
load
(
name
,
resource
);
List
<
PropertySource
<?>>
loaded
=
loader
.
load
(
name
,
resource
);
documents
=
asDocuments
(
loaded
);
documents
=
asDocuments
(
loaded
);
this
.
loadDocumentsCache
.
put
(
cacheKey
,
documents
);
}
}
return
documents
;
return
documents
;
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/PropertySourceLoader.java
View file @
5413ad3c
...
@@ -41,7 +41,7 @@ public interface PropertySourceLoader {
...
@@ -41,7 +41,7 @@ public interface PropertySourceLoader {
/**
/**
* Load the resource into one or more property sources. Implementations may either
* Load the resource into one or more property sources. Implementations may either
* return a list containing a single source, or in the case of a multi-document format
* return a list containing a single source, or in the case of a multi-document format
* such as yaml a source or each document in the resource.
* such as yaml a source
f
or each document in the resource.
* @param name the root name of the property source. If multiple documents are loaded
* @param name the root name of the property source. If multiple documents are loaded
* an additional suffix should be added to the name for each source loaded.
* an additional suffix should be added to the name for each source loaded.
* @param resource the resource to load
* @param resource the resource to load
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment