From bf1248d06261f0c0b0139a24d3ce298ede023e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Barto=C5=A1?= Date: Thu, 21 Mar 2024 15:04:11 +0100 Subject: [PATCH] Remove deprecated ConfigSourceInterceptor method (#28055) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Bartoš --- .../PropertyMappingInterceptor.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PropertyMappingInterceptor.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PropertyMappingInterceptor.java index be7d256f28..fe8869b5a7 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PropertyMappingInterceptor.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PropertyMappingInterceptor.java @@ -29,7 +29,6 @@ import org.keycloak.quarkus.runtime.configuration.mappers.PropertyMapper; import org.keycloak.quarkus.runtime.configuration.mappers.PropertyMappers; import java.util.Iterator; -import java.util.function.Function; import static org.keycloak.quarkus.runtime.Environment.isRebuild; @@ -60,14 +59,14 @@ public class PropertyMappingInterceptor implements ConfigSourceInterceptor { public static void enable() { disable.remove(); } - - Iterator filterRuntime(Iterator iter, Function nameFunc) { + + static Iterator filterRuntime(Iterator iter) { if (!isRebuild() && !Environment.isRebuildCheck()) { return iter; } - return new FilterIterator<>(iter, item -> !isRuntime(nameFunc.apply(item))); + return new FilterIterator<>(iter, item -> !isRuntime(item)); } - + static boolean isRuntime(String name) { PropertyMapper mapper = PropertyMappers.getMapper(name); return mapper != null && mapper.isRunTime(); @@ -75,12 +74,7 @@ public class PropertyMappingInterceptor implements ConfigSourceInterceptor { @Override public Iterator iterateNames(ConfigSourceInterceptorContext context) { - return filterRuntime(context.iterateNames(), Function.identity()); - } - - @Override - public Iterator iterateValues(ConfigSourceInterceptorContext context) { - return filterRuntime(context.iterateValues(), ConfigValue::getName); + return filterRuntime(context.iterateNames()); } @Override