Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions avaje-config/src/main/java/io/avaje/config/InitialLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ enum Source {
private final ConfigurationLog log;
private final InitialLoadContext loadContext;
private final Set<String> profileResourceLoaded = new HashSet<>();
private final Set<String> loadProperties = new HashSet<>();
private final Parsers parsers;

InitialLoader(CoreComponents components, ResourceLoader resourceLoader) {
Expand Down Expand Up @@ -188,12 +189,14 @@ private boolean loadTest() {
}

/**
* Load configuration defined by a <em>load.properties</em> entry in properties file.
* Recursively Load configuration defined by a <em>load.properties</em> entry in properties file.
*/
private void loadViaIndirection() {
String paths = loadContext.indirectLocation();
if (paths != null) {
if (paths != null && !loadProperties.contains(paths)) {
loadViaPaths(paths);
loadProperties.add(paths);
loadViaIndirection();
}
}

Expand All @@ -220,7 +223,9 @@ private void loadViaProfiles(Source source) {

private void loadViaPaths(String paths) {
for (String path : splitPaths(paths)) {
loadWithExtensionCheck(loadContext.eval(path));
if (loadProperties.add(path)) {
loadWithExtensionCheck(loadContext.eval(path));
}
}
}

Expand Down