This is an automated email from the ASF dual-hosted git repository. ebourg pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-configuration.git
commit 3b2fbfc1ec2a8db6d5fcf8896d82d14cc4ed0cec Author: Emmanuel Bourg <ebo...@apache.org> AuthorDate: Mon Oct 28 13:57:49 2024 +0100 Replaced IteratorUtils.toList() --- .../commons/configuration2/TestPropertiesConfiguration.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/test/java/org/apache/commons/configuration2/TestPropertiesConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestPropertiesConfiguration.java index 42ade0b7..4b058c96 100644 --- a/src/test/java/org/apache/commons/configuration2/TestPropertiesConfiguration.java +++ b/src/test/java/org/apache/commons/configuration2/TestPropertiesConfiguration.java @@ -64,7 +64,6 @@ import java.util.PriorityQueue; import java.util.Properties; import java.util.Set; -import org.apache.commons.collections.IteratorUtils; import org.apache.commons.configuration2.SynchronizerTestImpl.Methods; import org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl; import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder; @@ -894,8 +893,8 @@ public class TestPropertiesConfiguration { jup.load(in); } - @SuppressWarnings("unchecked") - final Set<Object> pcKeys = new HashSet<>(IteratorUtils.toList(conf.getKeys())); + Set<Object> pcKeys = new HashSet<>(); + conf.getKeys().forEachRemaining(pcKeys::add); assertEquals(jup.keySet(), pcKeys); for (final Object key : jup.keySet()) { @@ -936,8 +935,8 @@ public class TestPropertiesConfiguration { } // ... and compare the properties to the originals - @SuppressWarnings("unchecked") - final Set<Object> pcKeys = new HashSet<>(IteratorUtils.toList(conf.getKeys())); + Set<Object> pcKeys = new HashSet<>(); + conf.getKeys().forEachRemaining(pcKeys::add); assertEquals(testProps.keySet(), pcKeys); for (final Object key : testProps.keySet()) { @@ -980,8 +979,8 @@ public class TestPropertiesConfiguration { } // ... and compare the properties to the originals - @SuppressWarnings("unchecked") - final Set<Object> pcKeys = new HashSet<>(IteratorUtils.toList(conf.getKeys())); + Set<Object> pcKeys = new HashSet<>(); + conf.getKeys().forEachRemaining(pcKeys::add); assertEquals(testProps.keySet(), pcKeys); for (final Object key : testProps.keySet()) {