From f7bceaa17a53cb401c27b74c11be0dcf5da0a9c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Muzik=C3=A1=C5=99?= Date: Mon, 5 Aug 2024 18:39:32 +0200 Subject: [PATCH] Fix KeycloakPropertiesConfigSource MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Václav Muzikář --- .../KeycloakPropertiesConfigSource.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakPropertiesConfigSource.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakPropertiesConfigSource.java index a91feda9a1d7..e09069bf9061 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakPropertiesConfigSource.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakPropertiesConfigSource.java @@ -63,7 +63,21 @@ protected String[] getFileExtensions() { @Override protected ConfigSource loadConfigSource(URL url, int ordinal) throws IOException { - return new PropertiesConfigSource(transform(ConfigSourceUtil.urlToMap(url)), url.toString(), ordinal); + // a workaround for https://github.com/smallrye/smallrye-config/issues/1207 + // replace by the following line when fixed: + // return new PropertiesConfigSource(transform(ConfigSourceUtil.urlToMap(url)), url.toString(), ordinal); + var cs = new PropertiesConfigSource(transform(ConfigSourceUtil.urlToMap(url)), url.toString(), ordinal) { + private String name; + @Override + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + }; + cs.setName(url.toString()); + return cs; } public static class InClassPath extends KeycloakPropertiesConfigSource implements ConfigSourceProvider {