diff --git a/implementation/src/main/java/io/smallrye/config/SecretKeysConfigSourceInterceptor.java b/implementation/src/main/java/io/smallrye/config/SecretKeysConfigSourceInterceptor.java index 08ef0cd7a..9766a712c 100644 --- a/implementation/src/main/java/io/smallrye/config/SecretKeysConfigSourceInterceptor.java +++ b/implementation/src/main/java/io/smallrye/config/SecretKeysConfigSourceInterceptor.java @@ -1,7 +1,6 @@ package io.smallrye.config; import java.io.Serial; -import java.util.Set; import jakarta.annotation.Priority; @@ -28,14 +27,6 @@ public SecretKeysConfigSourceInterceptor(final PropertyNamesMatcher secrets) this.secrets = secrets; } - @Deprecated(forRemoval = true) - public SecretKeysConfigSourceInterceptor(final Set secrets) { - this.secrets = new PropertyNamesMatcher<>(); - for (PropertyName secret : secrets) { - this.secrets.add(secret.getName()); - } - } - @Override public ConfigValue getValue(final ConfigSourceInterceptorContext context, final String name) { // separate empty check to avoid PropertyName alloc diff --git a/implementation/src/main/java/io/smallrye/config/SmallRyeConfig.java b/implementation/src/main/java/io/smallrye/config/SmallRyeConfig.java index e90288d71..4b8441777 100644 --- a/implementation/src/main/java/io/smallrye/config/SmallRyeConfig.java +++ b/implementation/src/main/java/io/smallrye/config/SmallRyeConfig.java @@ -200,26 +200,6 @@ public > C getValues( } } - @Deprecated(forRemoval = true) - public > C getIndexedValues(String name, Converter converter, - IntFunction collectionFactory) { - List indexedProperties = getIndexedProperties(name); - if (indexedProperties.isEmpty()) { - throw new NoSuchElementException(ConfigMessages.msg.propertyNotFound(name)); - } - return getIndexedValues(indexedProperties, converter, collectionFactory); - } - - @Deprecated(forRemoval = true) - private > C getIndexedValues(List indexedProperties, Converter converter, - IntFunction collectionFactory) { - C collection = collectionFactory.apply(indexedProperties.size()); - for (String indexedProperty : indexedProperties) { - collection.add(getValue(indexedProperty, converter)); - } - return collection; - } - public List getIndexedProperties(final String property) { Map indexedProperties = configSources.getPropertyNames().indexed().get(property); return indexedProperties == null ? Collections.emptyList() : indexedProperties.values().stream().toList(); @@ -535,23 +515,6 @@ public > Optional getOptionalValues(final String n } } - @Deprecated(forRemoval = true) - public > Optional getIndexedOptionalValues(String name, Converter converter, - IntFunction collectionFactory) { - List indexedProperties = getIndexedProperties(name); - if (indexedProperties.isEmpty()) { - return Optional.empty(); - } - - C collection = collectionFactory.apply(indexedProperties.size()); - for (String indexedProperty : indexedProperties) { - Optional optionalValue = getOptionalValue(indexedProperty, converter); - optionalValue.ifPresent(collection::add); - } - - return collection.isEmpty() ? Optional.empty() : Optional.of(collection); - } - @Override public Optional> getOptionalValues( final String name, diff --git a/implementation/src/main/java/io/smallrye/config/SmallRyeConfigBuilder.java b/implementation/src/main/java/io/smallrye/config/SmallRyeConfigBuilder.java index 66973e14e..b7f0a76ea 100644 --- a/implementation/src/main/java/io/smallrye/config/SmallRyeConfigBuilder.java +++ b/implementation/src/main/java/io/smallrye/config/SmallRyeConfigBuilder.java @@ -630,11 +630,6 @@ public Defaults getDefaults() { return defaults; } - @Deprecated(forRemoval = true) - public Map getDefaultValues() { - return defaults.getProperties(); - } - public PropertyNamesMatcher getSecretKeys() { return secretKeys; } diff --git a/implementation/src/test/java/io/smallrye/config/SmallRyeConfigTest.java b/implementation/src/test/java/io/smallrye/config/SmallRyeConfigTest.java index 286b575f2..0fd7bd24a 100644 --- a/implementation/src/test/java/io/smallrye/config/SmallRyeConfigTest.java +++ b/implementation/src/test/java/io/smallrye/config/SmallRyeConfigTest.java @@ -21,6 +21,7 @@ import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -181,8 +182,10 @@ void getIndexedValues() { "server.environments[2]", "prod")) .build(); - List environments = config.getIndexedValues("server.environments", config.requireConverter(String.class), - ArrayList::new); + List environments = config.getValues( + "server.environments", + config.requireConverter(String.class), + (IntFunction>) value -> new ArrayList<>()); assertEquals(3, environments.size()); assertEquals("dev", environments.get(0)); assertEquals("dev", config.getValue("server.environments[0]", String.class)); @@ -192,7 +195,10 @@ void getIndexedValues() { assertEquals("prod", config.getValue("server.environments[2]", String.class)); assertThrows(NoSuchElementException.class, - () -> config.getIndexedValues("not.found", config.requireConverter(String.class), ArrayList::new)); + () -> config.getValues( + "not.found", + config.requireConverter(String.class), + (IntFunction>) value -> new ArrayList<>())); } @Test @@ -298,9 +304,11 @@ void getOptionalValuesEmpty() { .withSources(config("server.environments", "")) .build(); - assertFalse( - config.getIndexedOptionalValues("server.environments", config.requireConverter(String.class), ArrayList::new) - .isPresent()); + assertFalse(config.getOptionalValues( + "server.environments", + config.requireConverter(String.class), + (IntFunction>) value -> new ArrayList<>()) + .isPresent()); assertFalse(config.getOptionalValues("server.environments", String.class).isPresent()); SmallRyeConfig configIndexed = new SmallRyeConfigBuilder() @@ -308,7 +316,10 @@ void getOptionalValuesEmpty() { .build(); assertFalse(configIndexed - .getIndexedOptionalValues("server.environments", config.requireConverter(String.class), ArrayList::new) + .getOptionalValues( + "server.environments", + config.requireConverter(String.class), + (IntFunction>) value -> new ArrayList<>()) .isPresent()); assertFalse(configIndexed.getOptionalValues("server.environments", String.class).isPresent()); }