Remove deprecated ConfigSourceInterceptor method (#28055)

Signed-off-by: Martin Bartoš <mabartos@redhat.com>
This commit is contained in:
Martin Bartoš 2024-03-21 15:04:11 +01:00 committed by GitHub
parent b24d446911
commit bf1248d062
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();
}
<T> Iterator<T> filterRuntime(Iterator<T> iter, Function<T, String> nameFunc) {
static Iterator<String> filterRuntime(Iterator<String> 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<String> iterateNames(ConfigSourceInterceptorContext context) {
return filterRuntime(context.iterateNames(), Function.identity());
}
@Override
public Iterator<ConfigValue> iterateValues(ConfigSourceInterceptorContext context) {
return filterRuntime(context.iterateValues(), ConfigValue::getName);
return filterRuntime(context.iterateNames());
}
@Override