From 9486d96fb545a9b74ba403ba89eae83f8d75175a Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Wed, 25 Sep 2024 00:34:02 -0400 Subject: [PATCH 01/11] use a set to track recursive load props --- .../src/main/java/io/avaje/config/InitialLoader.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java index c47e626..5cae768 100644 --- a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java +++ b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java @@ -41,6 +41,7 @@ enum Source { private final ConfigurationLog log; private final InitialLoadContext loadContext; private final Set profileResourceLoaded = new HashSet<>(); + private final Set loadProperties = new HashSet<>(); private final Parsers parsers; InitialLoader(CoreComponents components, ResourceLoader resourceLoader) { @@ -188,12 +189,14 @@ private boolean loadTest() { } /** - * Load configuration defined by a load.properties entry in properties file. + * Recursively Load configuration defined by a load.properties 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(); } } @@ -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)); + } } } From 57a3b41817b23d5b1077c992472d6db58c4bbb89 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:24:47 -0400 Subject: [PATCH 02/11] add chain test --- .../src/test/java/io/avaje/config/InitialLoaderTest.java | 8 ++++++++ .../src/test/resources/test-properties/chain/a.properties | 6 ++++++ .../src/test/resources/test-properties/chain/b.properties | 6 ++++++ .../src/test/resources/test-properties/chain/c.properties | 2 ++ .../src/test/resources/test-properties/chain/d.properties | 1 + .../test/resources/test-properties/chain/main.properties | 1 + 6 files changed, 24 insertions(+) create mode 100644 avaje-config/src/test/resources/test-properties/chain/a.properties create mode 100644 avaje-config/src/test/resources/test-properties/chain/b.properties create mode 100644 avaje-config/src/test/resources/test-properties/chain/c.properties create mode 100644 avaje-config/src/test/resources/test-properties/chain/d.properties create mode 100644 avaje-config/src/test/resources/test-properties/chain/main.properties diff --git a/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java b/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java index 11cc2f1..6d4e53d 100644 --- a/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java +++ b/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java @@ -138,4 +138,12 @@ void load_withSuppressTestResource() { System.clearProperty("suppressTestResource"); } } + + @Test + void load_withLoadPropertyChain() { + InitialLoader loader = newInitialLoader(); + loader.loadWithExtensionCheck("test-properties/chain/main.properties"); + var properties = evalFor(loader.load()); + assertThat(properties.get("override").value()).isEqualTo("d"); + } } diff --git a/avaje-config/src/test/resources/test-properties/chain/a.properties b/avaje-config/src/test/resources/test-properties/chain/a.properties new file mode 100644 index 0000000..789dcad --- /dev/null +++ b/avaje-config/src/test/resources/test-properties/chain/a.properties @@ -0,0 +1,6 @@ +base.url=https://encrypted-tbn2.gstatic.com +got.nothin=false +validation.resourcebundle.names=Messages +validation.locale.addedLocales=es,de +override=a +load.properties=test-properties/chain/b.properties test-properties/chain/c.properties diff --git a/avaje-config/src/test/resources/test-properties/chain/b.properties b/avaje-config/src/test/resources/test-properties/chain/b.properties new file mode 100644 index 0000000..4741cc0 --- /dev/null +++ b/avaje-config/src/test/resources/test-properties/chain/b.properties @@ -0,0 +1,6 @@ +base.url=https://encrypted-tbn2.gstatic.com +got.nothin=false +validation.resourcebundle.names=Messages +validation.locale.addedLocales=es,de +override=b +load.properties=test-properties/chain/a.properties test-properties/chain/c.properties diff --git a/avaje-config/src/test/resources/test-properties/chain/c.properties b/avaje-config/src/test/resources/test-properties/chain/c.properties new file mode 100644 index 0000000..ac1b64a --- /dev/null +++ b/avaje-config/src/test/resources/test-properties/chain/c.properties @@ -0,0 +1,2 @@ +override=c +load.properties=test-properties/chain/d.properties diff --git a/avaje-config/src/test/resources/test-properties/chain/d.properties b/avaje-config/src/test/resources/test-properties/chain/d.properties new file mode 100644 index 0000000..ac6e4a7 --- /dev/null +++ b/avaje-config/src/test/resources/test-properties/chain/d.properties @@ -0,0 +1 @@ +override=d diff --git a/avaje-config/src/test/resources/test-properties/chain/main.properties b/avaje-config/src/test/resources/test-properties/chain/main.properties new file mode 100644 index 0000000..93989a7 --- /dev/null +++ b/avaje-config/src/test/resources/test-properties/chain/main.properties @@ -0,0 +1 @@ +load.properties=test-properties/chain/a.properties \ No newline at end of file From 3b4b1c540bc961228598be3a4498e1b79459b73d Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:44:26 -0400 Subject: [PATCH 03/11] test exactly --- .../src/test/java/io/avaje/config/InitialLoaderTest.java | 2 +- .../src/test/resources/test-properties/chain/c.properties | 2 +- .../src/test/resources/test-properties/chain/d.properties | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 avaje-config/src/test/resources/test-properties/chain/d.properties diff --git a/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java b/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java index 6d4e53d..0ceb718 100644 --- a/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java +++ b/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java @@ -144,6 +144,6 @@ void load_withLoadPropertyChain() { InitialLoader loader = newInitialLoader(); loader.loadWithExtensionCheck("test-properties/chain/main.properties"); var properties = evalFor(loader.load()); - assertThat(properties.get("override").value()).isEqualTo("d"); + assertThat(properties.get("override").value()).isEqualTo("c"); } } diff --git a/avaje-config/src/test/resources/test-properties/chain/c.properties b/avaje-config/src/test/resources/test-properties/chain/c.properties index ac1b64a..94ec557 100644 --- a/avaje-config/src/test/resources/test-properties/chain/c.properties +++ b/avaje-config/src/test/resources/test-properties/chain/c.properties @@ -1,2 +1,2 @@ +value.c=c override=c -load.properties=test-properties/chain/d.properties diff --git a/avaje-config/src/test/resources/test-properties/chain/d.properties b/avaje-config/src/test/resources/test-properties/chain/d.properties deleted file mode 100644 index ac6e4a7..0000000 --- a/avaje-config/src/test/resources/test-properties/chain/d.properties +++ /dev/null @@ -1 +0,0 @@ -override=d From 3fcdb50022445e6fed707d6a5eb89cd2d3bc9813 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:58:21 -0400 Subject: [PATCH 04/11] exactly exactly --- .../src/test/resources/test-properties/chain/a.properties | 2 +- .../src/test/resources/test-properties/chain/b.properties | 2 +- .../src/test/resources/test-properties/chain/main.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/avaje-config/src/test/resources/test-properties/chain/a.properties b/avaje-config/src/test/resources/test-properties/chain/a.properties index 789dcad..2b6e641 100644 --- a/avaje-config/src/test/resources/test-properties/chain/a.properties +++ b/avaje-config/src/test/resources/test-properties/chain/a.properties @@ -3,4 +3,4 @@ got.nothin=false validation.resourcebundle.names=Messages validation.locale.addedLocales=es,de override=a -load.properties=test-properties/chain/b.properties test-properties/chain/c.properties +load.properties=test-properties/chain/c.properties diff --git a/avaje-config/src/test/resources/test-properties/chain/b.properties b/avaje-config/src/test/resources/test-properties/chain/b.properties index 4741cc0..43444c7 100644 --- a/avaje-config/src/test/resources/test-properties/chain/b.properties +++ b/avaje-config/src/test/resources/test-properties/chain/b.properties @@ -3,4 +3,4 @@ got.nothin=false validation.resourcebundle.names=Messages validation.locale.addedLocales=es,de override=b -load.properties=test-properties/chain/a.properties test-properties/chain/c.properties +load.properties=test-properties/chain/c.properties diff --git a/avaje-config/src/test/resources/test-properties/chain/main.properties b/avaje-config/src/test/resources/test-properties/chain/main.properties index 93989a7..39251a0 100644 --- a/avaje-config/src/test/resources/test-properties/chain/main.properties +++ b/avaje-config/src/test/resources/test-properties/chain/main.properties @@ -1 +1 @@ -load.properties=test-properties/chain/a.properties \ No newline at end of file +load.properties=test-properties/chain/a.properties test-properties/chain/b.properties \ No newline at end of file From df65ba6ff183d7b3baa644384d86347545db4670 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:30:09 -0400 Subject: [PATCH 05/11] DFS --- .../java/io/avaje/config/InitialLoader.java | 33 ++++++++++--------- .../io/avaje/config/InitialLoaderTest.java | 2 +- .../test-properties/chain/d.properties | 1 + .../test-properties/chain/main.properties | 2 +- 4 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 avaje-config/src/test/resources/test-properties/chain/d.properties diff --git a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java index 5cae768..423b3e6 100644 --- a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java +++ b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java @@ -41,7 +41,6 @@ enum Source { private final ConfigurationLog log; private final InitialLoadContext loadContext; private final Set profileResourceLoaded = new HashSet<>(); - private final Set loadProperties = new HashSet<>(); private final Parsers parsers; InitialLoader(CoreComponents components, ResourceLoader resourceLoader) { @@ -114,7 +113,7 @@ void loadLocalFiles() { loadViaProfiles(RESOURCE); loadViaProfiles(FILE); loadViaSystemProperty(); - loadViaIndirection(); + loadViaIndirection(new ArrayDeque<>(),""); // test configuration (if found) overrides main configuration // we should only find these resources when running tests if (!loadTest()) { @@ -148,7 +147,9 @@ void loadViaCommandLine(String[] args) { private void loadCommandLineArg(String arg) { if (isValidExtension(arg)) { - loadViaPaths(arg); + for (String path : splitPaths(arg)) { + loadWithExtensionCheck(loadContext.eval(path)); + } } } @@ -191,15 +192,23 @@ private boolean loadTest() { /** * Recursively Load configuration defined by a load.properties entry in properties file. */ - private void loadViaIndirection() { + private void loadViaIndirection(ArrayDeque stack, String previous) { String paths = loadContext.indirectLocation(); - if (paths != null && !loadProperties.contains(paths)) { - loadViaPaths(paths); - loadProperties.add(paths); - loadViaIndirection(); + if (!previous.equals(paths)) { + var split = splitPaths(paths); + for (int i = split.length - 1; i >= 0; i--) { + stack.addFirst(split[i]); + } + String path = stack.poll(); + while (path != null) { + loadWithExtensionCheck(loadContext.eval(path)); + loadViaIndirection(stack, paths); + path = stack.poll(); + } } } + @Nullable private String[] profiles() { final String paths = loadContext.profiles(); @@ -221,14 +230,6 @@ private void loadViaProfiles(Source source) { } } - private void loadViaPaths(String paths) { - for (String path : splitPaths(paths)) { - if (loadProperties.add(path)) { - loadWithExtensionCheck(loadContext.eval(path)); - } - } - } - int size() { return loadContext.size(); } diff --git a/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java b/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java index 0ceb718..6d4e53d 100644 --- a/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java +++ b/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java @@ -144,6 +144,6 @@ void load_withLoadPropertyChain() { InitialLoader loader = newInitialLoader(); loader.loadWithExtensionCheck("test-properties/chain/main.properties"); var properties = evalFor(loader.load()); - assertThat(properties.get("override").value()).isEqualTo("c"); + assertThat(properties.get("override").value()).isEqualTo("d"); } } diff --git a/avaje-config/src/test/resources/test-properties/chain/d.properties b/avaje-config/src/test/resources/test-properties/chain/d.properties new file mode 100644 index 0000000..ac6e4a7 --- /dev/null +++ b/avaje-config/src/test/resources/test-properties/chain/d.properties @@ -0,0 +1 @@ +override=d diff --git a/avaje-config/src/test/resources/test-properties/chain/main.properties b/avaje-config/src/test/resources/test-properties/chain/main.properties index 39251a0..9911ad4 100644 --- a/avaje-config/src/test/resources/test-properties/chain/main.properties +++ b/avaje-config/src/test/resources/test-properties/chain/main.properties @@ -1 +1 @@ -load.properties=test-properties/chain/a.properties test-properties/chain/b.properties \ No newline at end of file +load.properties=test-properties/chain/a.properties test-properties/chain/b.properties, test-properties/chain/d.properties \ No newline at end of file From cf8a57b97d5720ca2c18874d3e038c722e53f22d Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:45:09 -0400 Subject: [PATCH 06/11] Update InitialLoader.java --- avaje-config/src/main/java/io/avaje/config/InitialLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java index 423b3e6..e3e771a 100644 --- a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java +++ b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java @@ -194,7 +194,7 @@ private boolean loadTest() { */ private void loadViaIndirection(ArrayDeque stack, String previous) { String paths = loadContext.indirectLocation(); - if (!previous.equals(paths)) { + if (!previous.equals(paths) && paths != null) { var split = splitPaths(paths); for (int i = split.length - 1; i >= 0; i--) { stack.addFirst(split[i]); From 801482c50df6e815cd8881ff07107b20ac35b02a Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:28:59 -0400 Subject: [PATCH 07/11] remove recursion --- .../java/io/avaje/config/InitialLoader.java | 27 ++++++++++++------- .../io/avaje/config/InitialLoaderTest.java | 10 ++++--- .../test-properties/chain/a.properties | 5 +--- .../test-properties/chain/b.properties | 5 +--- .../test-properties/chain/c.properties | 2 +- .../test-properties/chain/d.properties | 1 + 6 files changed, 28 insertions(+), 22 deletions(-) diff --git a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java index e3e771a..932d765 100644 --- a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java +++ b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java @@ -192,22 +192,29 @@ private boolean loadTest() { /** * Recursively Load configuration defined by a load.properties entry in properties file. */ - private void loadViaIndirection(ArrayDeque stack, String previous) { + private void loadViaIndirection() { String paths = loadContext.indirectLocation(); - if (!previous.equals(paths) && paths != null) { - var split = splitPaths(paths); - for (int i = split.length - 1; i >= 0; i--) { - stack.addFirst(split[i]); - } - String path = stack.poll(); - while (path != null) { + if (paths != null) { + var stack = new ArrayDeque(); + splitAndAddPaths(stack, paths); + String path; + while ((path = stack.poll()) != null) { loadWithExtensionCheck(loadContext.eval(path)); - loadViaIndirection(stack, paths); - path = stack.poll(); + var newPath = loadContext.indirectLocation(); + if (!paths.equals(newPath)) { + paths = newPath; + splitAndAddPaths(stack, paths); + } } } } + private void splitAndAddPaths(ArrayDeque stack, String paths) { + var split = splitPaths(paths); + for (int i = split.length - 1; i >= 0; i--) { + stack.addFirst(split[i]); + } + } @Nullable private String[] profiles() { diff --git a/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java b/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java index 6d4e53d..f2161c2 100644 --- a/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java +++ b/avaje-config/src/test/java/io/avaje/config/InitialLoaderTest.java @@ -142,8 +142,12 @@ void load_withSuppressTestResource() { @Test void load_withLoadPropertyChain() { InitialLoader loader = newInitialLoader(); - loader.loadWithExtensionCheck("test-properties/chain/main.properties"); - var properties = evalFor(loader.load()); - assertThat(properties.get("override").value()).isEqualTo("d"); + loader.loadWithExtensionCheck("test-properties/chain/main.properties"); + var properties = evalFor(loader.load()); + assertThat(properties.get("value.a").value()).isEqualTo("true"); + assertThat(properties.get("value.b").value()).isEqualTo("true"); + assertThat(properties.get("value.c").value()).isEqualTo("true"); + assertThat(properties.get("value.d").value()).isEqualTo("true"); + assertThat(properties.get("override").value()).isEqualTo("d"); } } diff --git a/avaje-config/src/test/resources/test-properties/chain/a.properties b/avaje-config/src/test/resources/test-properties/chain/a.properties index 2b6e641..6202d50 100644 --- a/avaje-config/src/test/resources/test-properties/chain/a.properties +++ b/avaje-config/src/test/resources/test-properties/chain/a.properties @@ -1,6 +1,3 @@ -base.url=https://encrypted-tbn2.gstatic.com -got.nothin=false -validation.resourcebundle.names=Messages -validation.locale.addedLocales=es,de +value.a=true override=a load.properties=test-properties/chain/c.properties diff --git a/avaje-config/src/test/resources/test-properties/chain/b.properties b/avaje-config/src/test/resources/test-properties/chain/b.properties index 43444c7..c41fe6a 100644 --- a/avaje-config/src/test/resources/test-properties/chain/b.properties +++ b/avaje-config/src/test/resources/test-properties/chain/b.properties @@ -1,6 +1,3 @@ -base.url=https://encrypted-tbn2.gstatic.com -got.nothin=false -validation.resourcebundle.names=Messages -validation.locale.addedLocales=es,de +value.b=true override=b load.properties=test-properties/chain/c.properties diff --git a/avaje-config/src/test/resources/test-properties/chain/c.properties b/avaje-config/src/test/resources/test-properties/chain/c.properties index 94ec557..eedbcce 100644 --- a/avaje-config/src/test/resources/test-properties/chain/c.properties +++ b/avaje-config/src/test/resources/test-properties/chain/c.properties @@ -1,2 +1,2 @@ -value.c=c +value.c=true override=c diff --git a/avaje-config/src/test/resources/test-properties/chain/d.properties b/avaje-config/src/test/resources/test-properties/chain/d.properties index ac6e4a7..8eb728c 100644 --- a/avaje-config/src/test/resources/test-properties/chain/d.properties +++ b/avaje-config/src/test/resources/test-properties/chain/d.properties @@ -1 +1,2 @@ +value.d=true override=d From 663265b4b980fd40e2ef8fd0fc4f75de58a9c8eb Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:29:23 -0400 Subject: [PATCH 08/11] Update InitialLoader.java --- avaje-config/src/main/java/io/avaje/config/InitialLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java index 932d765..36fbdeb 100644 --- a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java +++ b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java @@ -113,7 +113,7 @@ void loadLocalFiles() { loadViaProfiles(RESOURCE); loadViaProfiles(FILE); loadViaSystemProperty(); - loadViaIndirection(new ArrayDeque<>(),""); + loadViaIndirection(); // test configuration (if found) overrides main configuration // we should only find these resources when running tests if (!loadTest()) { From b0e6d4e85ec911e17d0b0161e62ea8938d7064ee Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Thu, 26 Sep 2024 17:24:13 -0400 Subject: [PATCH 09/11] nice --- .../src/main/java/io/avaje/config/InitialLoader.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java index 36fbdeb..d843816 100644 --- a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java +++ b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java @@ -198,6 +198,7 @@ private void loadViaIndirection() { var stack = new ArrayDeque(); splitAndAddPaths(stack, paths); String path; + var sentinel = 0; while ((path = stack.poll()) != null) { loadWithExtensionCheck(loadContext.eval(path)); var newPath = loadContext.indirectLocation(); @@ -205,6 +206,12 @@ private void loadViaIndirection() { paths = newPath; splitAndAddPaths(stack, paths); } + + sentinel++; + if (sentinel == 69) { + throw new IllegalStateException( + "Failed to resolve load.properties after 69 iterations. Perhaps Circular load.properties reference?"); + } } } } From 89e5a20da89337016279290e40e2de78a38fd097 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:52:34 -0400 Subject: [PATCH 10/11] Update InitialLoader.java --- avaje-config/src/main/java/io/avaje/config/InitialLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java index d843816..11c8977 100644 --- a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java +++ b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java @@ -190,7 +190,7 @@ private boolean loadTest() { } /** - * Recursively Load configuration defined by a load.properties entry in properties file. + * Load configuration defined by a load.properties entry in properties file. */ private void loadViaIndirection() { String paths = loadContext.indirectLocation(); From 0fdd8151fa6ee23f9ffbbab3fe4ad8992d86d921 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:09:21 -0400 Subject: [PATCH 11/11] Update InitialLoader.java --- avaje-config/src/main/java/io/avaje/config/InitialLoader.java | 1 + 1 file changed, 1 insertion(+) diff --git a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java index 11c8977..99f2203 100644 --- a/avaje-config/src/main/java/io/avaje/config/InitialLoader.java +++ b/avaje-config/src/main/java/io/avaje/config/InitialLoader.java @@ -202,6 +202,7 @@ private void loadViaIndirection() { while ((path = stack.poll()) != null) { loadWithExtensionCheck(loadContext.eval(path)); var newPath = loadContext.indirectLocation(); + if (newPath == null) throw new IllegalStateException("truly impossible"); if (!paths.equals(newPath)) { paths = newPath; splitAndAddPaths(stack, paths);