[commons-configuration] branch master updated: Use final.
This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-configuration.git The following commit(s) were added to refs/heads/master by this push: new 1797df4 Use final. 1797df4 is described below commit 1797df4c93e0fd0c648ccabebbba120cd0966023 Author: Gary Gregory AuthorDate: Thu May 23 09:01:22 2019 -0400 Use final. --- .../configuration2/PropertiesConfiguration.java| 32 - .../builder/INIBuilderParametersImpl.java | 4 +-- .../builder/INIBuilderProperties.java | 4 +-- .../interpol/StringLookupAdapter.java | 4 +-- .../configuration2/InterpolationTestHelper.java| 6 ++-- .../TestPropertiesConfiguration.java | 41 -- 6 files changed, 47 insertions(+), 44 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java b/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java index 751e99f..bcb4371 100644 --- a/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java +++ b/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java @@ -896,7 +896,7 @@ public class PropertiesConfiguration extends BaseConfiguration * @return the unescaped property name * @since 2.4 */ -protected String unescapePropertyName(String name) +protected String unescapePropertyName(final String name) { return StringEscapeUtils.unescapeJava(name); } @@ -922,7 +922,7 @@ public class PropertiesConfiguration extends BaseConfiguration * @return the unescaped property value * @since 2.4 */ -protected String unescapePropertyValue(String value) +protected String unescapePropertyValue(final String value) { return unescapeJava(value); } @@ -1066,7 +1066,7 @@ public class PropertiesConfiguration extends BaseConfiguration *with multiple values * @param valueTransformer the value transformer used to escape property values */ -public PropertiesWriter(Writer writer, ListDelimiterHandler delHandler, ValueTransformer valueTransformer) +public PropertiesWriter(final Writer writer, final ListDelimiterHandler delHandler, final ValueTransformer valueTransformer) { super(writer); delimiterHandler = delHandler; @@ -1456,19 +1456,19 @@ public class PropertiesConfiguration extends BaseConfiguration * * @param escapeUnicode whether Unicode characters should be escaped */ -public JupIOFactory(boolean escapeUnicode) +public JupIOFactory(final boolean escapeUnicode) { this.escapeUnicode = escapeUnicode; } @Override -public PropertiesReader createPropertiesReader(Reader in) +public PropertiesReader createPropertiesReader(final Reader in) { return new JupPropertiesReader(in); } @Override -public PropertiesWriter createPropertiesWriter(Writer out, ListDelimiterHandler handler) +public PropertiesWriter createPropertiesWriter(final Writer out, final ListDelimiterHandler handler) { return new JupPropertiesWriter(out, handler, escapeUnicode); } @@ -1489,7 +1489,7 @@ public class PropertiesConfiguration extends BaseConfiguration * * @param reader A Reader. */ -public JupPropertiesReader(Reader reader) +public JupPropertiesReader(final Reader reader) { super(reader); } @@ -1499,7 +1499,7 @@ public class PropertiesConfiguration extends BaseConfiguration public String readProperty() throws IOException { getCommentLines().clear(); -StringBuilder buffer = new StringBuilder(); +final StringBuilder buffer = new StringBuilder(); while (true) { @@ -1554,16 +1554,16 @@ public class PropertiesConfiguration extends BaseConfiguration } @Override -protected void parseProperty(String line) +protected void parseProperty(final String line) { -String[] property = doParseProperty(line, false); +final String[] property = doParseProperty(line, false); initPropertyName(property[0]); initPropertyValue(property[1]); initPropertySeparator(property[2]); } @Override -protected String unescapePropertyValue(String value) +protected String unescapePropertyValue(final String value) { return unescapeJava(value, true); } @@ -1585,7 +1585,7 @@ public class PropertiesConfiguration extends BaseConfiguration
[commons-configuration] branch master updated: Use final.
This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-configuration.git The following commit(s) were added to refs/heads/master by this push: new aeaac81 Use final. aeaac81 is described below commit aeaac81808292ca7f7d16ce8dcb64cfee158c150 Author: Gary Gregory AuthorDate: Fri Nov 20 22:08:42 2020 -0500 Use final. --- src/main/java/org/apache/commons/configuration2/io/FileLocator.java | 6 +++--- .../configuration2/builder/TestFileBasedConfigurationBuilder.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/io/FileLocator.java b/src/main/java/org/apache/commons/configuration2/io/FileLocator.java index 2257a97..7ad224e 100644 --- a/src/main/java/org/apache/commons/configuration2/io/FileLocator.java +++ b/src/main/java/org/apache/commons/configuration2/io/FileLocator.java @@ -208,7 +208,7 @@ public final class FileLocator * @param urlConnectionOptions the source URL connection options. * @return a reference to this builder for method chaining */ -public FileLocatorBuilder urlConnectionOptions(URLConnectionOptions urlConnectionOptions) { +public FileLocatorBuilder urlConnectionOptions(final URLConnectionOptions urlConnectionOptions) { this.urlConnectionOptions = urlConnectionOptions; return this; @@ -262,14 +262,14 @@ public final class FileLocator * @return a flag whether these objects are equal */ @Override -public boolean equals(Object obj) { +public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof FileLocator)) { return false; } -FileLocator other = (FileLocator) obj; +final FileLocator other = (FileLocator) obj; return Objects.equals(basePath, other.basePath) && Objects.equals(encoding, other.encoding) && Objects.equals(fileName, other.fileName) && Objects.equals(fileSystem, other.fileSystem) && Objects.equals(locationStrategy, other.locationStrategy) && Objects.equals(sourceURL, other.sourceURL) diff --git a/src/test/java/org/apache/commons/configuration2/builder/TestFileBasedConfigurationBuilder.java b/src/test/java/org/apache/commons/configuration2/builder/TestFileBasedConfigurationBuilder.java index 5257f2d..ed7f141 100644 --- a/src/test/java/org/apache/commons/configuration2/builder/TestFileBasedConfigurationBuilder.java +++ b/src/test/java/org/apache/commons/configuration2/builder/TestFileBasedConfigurationBuilder.java @@ -130,13 +130,13 @@ public class TestFileBasedConfigurationBuilder { */ @Test public void testGetConfigurationLoadFromJarFile() throws ConfigurationException, IOException { -URL jarResourceUrl = getClass().getClassLoader().getResource("org/apache/commons/configuration2/test.jar"); +final URL jarResourceUrl = getClass().getClassLoader().getResource("org/apache/commons/configuration2/test.jar"); assertNotNull(jarResourceUrl); final Path testJar = Paths.get(folder.getRoot().getAbsolutePath(), "test.jar"); try (final InputStream inputStream = jarResourceUrl.openStream()) { Files.copy(inputStream, testJar); } -URL url = new URL("jar:" + testJar.toUri() + "!/configuration.properties"); +final URL url = new URL("jar:" + testJar.toUri() + "!/configuration.properties"); //@formatter:off final FileBasedConfigurationBuilder builder =
[commons-configuration] branch master updated: Use final.
This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-configuration.git The following commit(s) were added to refs/heads/master by this push: new 86bf7e0 Use final. 86bf7e0 is described below commit 86bf7e011269bc38957c20410524b1c11a74ac4a Author: Gary Gregory AuthorDate: Sat Nov 21 12:54:32 2020 -0500 Use final. --- .../java/org/apache/commons/configuration2/PropertiesConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java b/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java index 5d5c882..8df6738 100644 --- a/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java +++ b/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java @@ -1094,7 +1094,7 @@ public class PropertiesConfiguration extends BaseConfiguration */ public void writeProperty(final String key, final List values) throws IOException { -for (Object value : values) { +for (final Object value : values) { writeProperty(key, value); } }
(commons-configuration) branch master updated: Use final
This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-configuration.git The following commit(s) were added to refs/heads/master by this push: new 8214ac80 Use final 8214ac80 is described below commit 8214ac80b7ade6993364c54fab0f54d0118e602e Author: Gary Gregory AuthorDate: Tue Mar 5 10:50:59 2024 -0500 Use final --- .../commons/configuration2/event/EventListenerRegistrationData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/configuration2/event/EventListenerRegistrationData.java b/src/main/java/org/apache/commons/configuration2/event/EventListenerRegistrationData.java index 1f2aab24..ae7e49a0 100644 --- a/src/main/java/org/apache/commons/configuration2/event/EventListenerRegistrationData.java +++ b/src/main/java/org/apache/commons/configuration2/event/EventListenerRegistrationData.java @@ -82,7 +82,7 @@ public final class EventListenerRegistrationData { @Override public int hashCode() { -int result = eventType.hashCode(); +final int result = eventType.hashCode(); return HASH_FACTOR * result + listener.hashCode(); }
(commons-configuration) branch master updated: Use final
This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-configuration.git The following commit(s) were added to refs/heads/master by this push: new fde59a3b Use final fde59a3b is described below commit fde59a3b6289d30b8a66e55020c97bba07dea9ac Author: Gary Gregory AuthorDate: Tue Apr 23 18:40:40 2024 -0400 Use final --- .../commons/configuration2/convert/AbstractListDelimiterHandler.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/configuration2/convert/AbstractListDelimiterHandler.java b/src/main/java/org/apache/commons/configuration2/convert/AbstractListDelimiterHandler.java index 09b1fe28..5d0489cb 100644 --- a/src/main/java/org/apache/commons/configuration2/convert/AbstractListDelimiterHandler.java +++ b/src/main/java/org/apache/commons/configuration2/convert/AbstractListDelimiterHandler.java @@ -74,7 +74,7 @@ public abstract class AbstractListDelimiterHandler implements ListDelimiterHandl * @param dejaVue Previously visited objects. */ static void flattenIterator(final ListDelimiterHandler handler, final Collection target, final Iterator iterator, final int limit, -Set dejaVue) { +final Set dejaVue) { int size = target.size(); while (size < limit && iterator.hasNext()) { final Object next = iterator.next();
[commons-configuration] branch master updated: Use final.
This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-configuration.git The following commit(s) were added to refs/heads/master by this push: new 1845dd8 Use final. 1845dd8 is described below commit 1845dd874d7b7fc89d32149991dbe603c8539630 Author: Gary Gregory AuthorDate: Thu Sep 17 09:50:35 2020 -0400 Use final. --- .../commons/configuration2/ImmutableConfiguration.java | 8 .../commons/configuration2/PropertiesConfiguration.java | 2 +- .../org/apache/commons/configuration2/YAMLConfiguration.java | 4 ++-- .../configuration2/builder/PropertiesBuilderProperties.java | 2 +- .../configuration2/builder/fluent/Configurations.java| 2 +- .../apache/commons/configuration2/TestBaseConfiguration.java | 4 ++-- .../commons/configuration2/TestPropertiesConfiguration.java | 6 +++--- .../configuration2/TestPropertiesConfigurationLayout.java| 2 +- .../apache/commons/configuration2/TestXMLConfiguration.java | 12 ++-- .../apache/commons/configuration2/TestYAMLConfiguration.java | 4 ++-- .../configuration2/builder/fluent/TestConfigurations.java| 6 +++--- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/ImmutableConfiguration.java b/src/main/java/org/apache/commons/configuration2/ImmutableConfiguration.java index a8bd411..98c795d 100644 --- a/src/main/java/org/apache/commons/configuration2/ImmutableConfiguration.java +++ b/src/main/java/org/apache/commons/configuration2/ImmutableConfiguration.java @@ -373,10 +373,10 @@ public interface ImmutableConfiguration * is not a String. * @since 2.8 */ -default > T getEnum(String key, Class enumType) { +default > T getEnum(final String key, final Class enumType) { try { return Enum.valueOf(enumType, getString(key)); -} catch (IllegalArgumentException e) { +} catch (final IllegalArgumentException e) { throw new ConversionException(e); } } @@ -395,14 +395,14 @@ public interface ImmutableConfiguration * not a Enum. * @since 2.8 */ -default > T getEnum(String key, Class enumType, T defaultValue) { +default > T getEnum(final String key, final Class enumType, final T defaultValue) { final String strValue = getString(key, null); if (strValue == null) { return defaultValue; } try { return Enum.valueOf(enumType, strValue); -} catch (IllegalArgumentException e) { +} catch (final IllegalArgumentException e) { throw new ConversionException(e); } } diff --git a/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java b/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java index 1d4599f..e3d6967 100644 --- a/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java +++ b/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java @@ -1897,7 +1897,7 @@ public class PropertiesConfiguration extends BaseConfiguration seenStack.pop(); } } -catch (ConfigurationException e) +catch (final ConfigurationException e) { getIncludeListener().accept(e); } diff --git a/src/main/java/org/apache/commons/configuration2/YAMLConfiguration.java b/src/main/java/org/apache/commons/configuration2/YAMLConfiguration.java index 05df6e6..cd034d8 100644 --- a/src/main/java/org/apache/commons/configuration2/YAMLConfiguration.java +++ b/src/main/java/org/apache/commons/configuration2/YAMLConfiguration.java @@ -152,7 +152,7 @@ public class YAMLConfiguration extends AbstractYAMLBasedConfiguration * @param options options for loading the file * @return the {@code Yaml} instance for loading a file */ -private static Yaml createYamlForReading(LoaderOptions options) +private static Yaml createYamlForReading(final LoaderOptions options) { return new Yaml(createClassLoadingDisablingConstructor(), new Representer(), new DumperOptions(), options); } @@ -169,7 +169,7 @@ public class YAMLConfiguration extends AbstractYAMLBasedConfiguration return new Constructor() { @Override -protected Class getClassForName(String name) +protected Class getClassForName(final String name) { throw new ConfigurationRuntimeException("Class instantiation is disabled."); } diff --git a/src/main/java/org/apache/commons/configuration2/builder/PropertiesBuilderProperties.java b/src/main/java/org/apache/commons/configuration2/builder/PropertiesBuilderProperties.java index 62040ed..5e6ec59 1
[commons-configuration] branch master updated: Use final.
This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-configuration.git The following commit(s) were added to refs/heads/master by this push: new 100636e Use final. 100636e is described below commit 100636ec3b1514bc6778c7257c8e8aae8c809f21 Author: Gary Gregory AuthorDate: Sat Jul 10 09:44:31 2021 -0400 Use final. Simplify expressions. Remove dead in-line comments. Use primitive parsing. --- src/main/java/org/apache/commons/configuration2/XMLConfiguration.java | 4 ++-- src/main/java/org/apache/commons/configuration2/io/FileUtils.java | 3 +-- .../java/org/apache/commons/configuration2/tree/ModelTransaction.java | 2 +- src/test/java/org/apache/commons/configuration2/test/HsqlDB.java | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/XMLConfiguration.java b/src/main/java/org/apache/commons/configuration2/XMLConfiguration.java index 6b15078..95d75ef 100644 --- a/src/main/java/org/apache/commons/configuration2/XMLConfiguration.java +++ b/src/main/java/org/apache/commons/configuration2/XMLConfiguration.java @@ -611,12 +611,12 @@ public class XMLConfiguration extends BaseHierarchicalConfiguration implements final Map attrmap = constructHierarchy(childNode, refChildValue, child, elemRefs, trimFlag, level + 1); -final Boolean childTrim = Boolean.valueOf(attrmap.remove(ATTR_SPACE_INTERNAL)); +final boolean childTrim = Boolean.parseBoolean(attrmap.remove(ATTR_SPACE_INTERNAL)); childNode.addAttributes(attrmap); final ImmutableNode newChild = createChildNodeWithValue(node, childNode, child, refChildValue.getValue(), -childTrim.booleanValue(), attrmap, elemRefs); +childTrim, attrmap, elemRefs); if (elemRefs != null && !elemRefs.containsKey(newChild)) { elemRefs.put(newChild, child); diff --git a/src/main/java/org/apache/commons/configuration2/io/FileUtils.java b/src/main/java/org/apache/commons/configuration2/io/FileUtils.java index 170b4b8..ec63add 100644 --- a/src/main/java/org/apache/commons/configuration2/io/FileUtils.java +++ b/src/main/java/org/apache/commons/configuration2/io/FileUtils.java @@ -35,7 +35,6 @@ class FileUtils { */ private static final Charset UTF8 = Charset.forName("UTF-8"); -//--- /** * Convert from a {@code URL} to a {@code File}. * @@ -77,7 +76,7 @@ class FileUtils { String decoded = url; if (url != null && url.indexOf('%') >= 0) { final int n = url.length(); -final StringBuffer buffer = new StringBuffer(); +final StringBuilder buffer = new StringBuilder(); final ByteBuffer bytes = ByteBuffer.allocate(n); for (int i = 0; i < n;) { if (url.charAt(i) == '%') { diff --git a/src/main/java/org/apache/commons/configuration2/tree/ModelTransaction.java b/src/main/java/org/apache/commons/configuration2/tree/ModelTransaction.java index 8675a24..9548f38 100644 --- a/src/main/java/org/apache/commons/configuration2/tree/ModelTransaction.java +++ b/src/main/java/org/apache/commons/configuration2/tree/ModelTransaction.java @@ -360,7 +360,7 @@ class ModelTransaction final Integer nodeLevel = Integer.valueOf(level == LEVEL_UNKNOWN ? level(target) : level); -Map levelOperations = operations.computeIfAbsent(nodeLevel, k -> new HashMap<>()); +final Map levelOperations = operations.computeIfAbsent(nodeLevel, k -> new HashMap<>()); Operations ops = levelOperations.get(target); if (ops == null) { diff --git a/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java b/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java index f0e1b5b..b2dd914 100644 --- a/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java +++ b/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java @@ -34,7 +34,7 @@ import org.apache.commons.logging.LogFactory; public class HsqlDB { -private Connection connection; +private final Connection connection; private static final Log log = LogFactory.getLog(HsqlDB.class); public HsqlDB(final String uri, final String databaseDriver, final String loadFile) @@ -97,7 +97,7 @@ public class HsqlDB try (final FileReader fr = new FileReader(fileName)) { final char fileBuf[] = new char[1024]; -final StringBuffer sb = new StringBuffer(1000); +final StringBuilder sb =
[commons-configuration] branch master updated: Use final #141
This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-configuration.git The following commit(s) were added to refs/heads/master by this push: new 8d36e71 Use final #141 8d36e71 is described below commit 8d36e71b0e902cd34d4d44baf23ee19bd3dbf27d Author: Gary Gregory AuthorDate: Wed Mar 2 19:59:20 2022 -0500 Use final #141 --- src/changes/changes.xml | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 0ee84cb..7aeead5 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -50,7 +50,10 @@ DefaultListDelimiterHandler.escapeList working only for List>String< #137. - + + + Use final #141. + Implement Iterable in ImmutableNode #74.
[commons-configuration] branch master updated: Use final Better lambdas Remove trailing whitespace Use else Add missing @Override
This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-configuration.git The following commit(s) were added to refs/heads/master by this push: new 0dc7451e Use final Better lambdas Remove trailing whitespace Use else Add missing @Override 0dc7451e is described below commit 0dc7451e71f25de2d3476160d0f1c0eccc1fa02b Author: Gary Gregory AuthorDate: Wed Sep 13 18:39:23 2023 -0400 Use final Better lambdas Remove trailing whitespace Use else Add missing @Override --- .../commons/configuration2/builder/BasicBuilderParameters.java| 2 +- .../apache/commons/configuration2/event/EventListenerList.java| 2 +- .../configuration2/interpol/ConfigurationInterpolator.java| 3 ++- .../apache/commons/configuration2/MockInitialContextFactory.java | 2 +- .../org/apache/commons/configuration2/TestINIConfiguration.java | 8 .../org/apache/commons/configuration2/TestXMLConfiguration.java | 2 +- .../org/apache/commons/configuration2/TestXMLListHandling.java| 2 +- .../configuration2/builder/TestFileBasedConfigurationBuilder.java | 2 +- .../builder/combined/TestMultiFileConfigurationBuilder.java | 2 +- .../configuration2/convert/TestDefaultConversionHandler.java | 2 +- .../commons/configuration2/event/TestEventListenerList.java | 4 ++-- .../configuration2/interpol/TestConfigurationInterpolator.java| 2 +- .../org/apache/commons/configuration2/io/TestFileHandler.java | 2 +- .../configuration2/plist/TestPropertyListConfiguration.java | 2 +- .../org/apache/commons/configuration2/tree/TestNodeSelector.java | 2 +- .../configuration2/tree/xpath/TestXPathExpressionEngine.java | 4 ++-- .../commons/configuration2/web/TestServletConfiguration.java | 2 +- .../configuration2/web/TestServletContextConfiguration.java | 2 +- 18 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/builder/BasicBuilderParameters.java b/src/main/java/org/apache/commons/configuration2/builder/BasicBuilderParameters.java index 46d3e40e..98d59d48 100644 --- a/src/main/java/org/apache/commons/configuration2/builder/BasicBuilderParameters.java +++ b/src/main/java/org/apache/commons/configuration2/builder/BasicBuilderParameters.java @@ -458,7 +458,7 @@ public class BasicBuilderParameters implements Cloneable, BuilderParameters, Bas return null; } -if (col.stream().noneMatch(o -> o instanceof Lookup)) { +if (col.stream().noneMatch(Lookup.class::isInstance)) { throw new IllegalArgumentException("Collection with default lookups contains invalid data: " + col); } return fetchDefaultLookups(params); diff --git a/src/main/java/org/apache/commons/configuration2/event/EventListenerList.java b/src/main/java/org/apache/commons/configuration2/event/EventListenerList.java index 29ba5cc4..9a805e42 100644 --- a/src/main/java/org/apache/commons/configuration2/event/EventListenerList.java +++ b/src/main/java/org/apache/commons/configuration2/event/EventListenerList.java @@ -180,7 +180,7 @@ public class EventListenerList { final List> results = new LinkedList<>(); listeners.forEach(reg -> { -Set> base = superTypes.computeIfAbsent(reg.getEventType(), EventType::fetchSuperEventTypes); +final Set> base = superTypes.computeIfAbsent(reg.getEventType(), EventType::fetchSuperEventTypes); if (base.contains(eventType)) { @SuppressWarnings("unchecked") final diff --git a/src/main/java/org/apache/commons/configuration2/interpol/ConfigurationInterpolator.java b/src/main/java/org/apache/commons/configuration2/interpol/ConfigurationInterpolator.java index 49c6591f..2ba758c4 100644 --- a/src/main/java/org/apache/commons/configuration2/interpol/ConfigurationInterpolator.java +++ b/src/main/java/org/apache/commons/configuration2/interpol/ConfigurationInterpolator.java @@ -720,7 +720,8 @@ public class ConfigurationInterpolator { if (!(obj instanceof String)) { if (obj instanceof Iterable) { return nextOrNull(((Iterable) obj).iterator()); -} else if (obj instanceof Iterator) { +} +if (obj instanceof Iterator) { return nextOrNull((Iterator) obj); } else if (obj.getClass().isArray()) { return Array.getLength(obj) > 0 diff --git a/src/test/java/org/apache/commons/configuration2/MockInitialContextFactory.java b/src/test/java/org/apache/commons/configuration2/MockInitialContextFactory.java index b4748f96..c9ce3462 100644 --- a/src/test/java/org/apache/commons/configuration2/MockInitialContextFactory.java +++ b/src/test/java/org/apache/commons/configuration2/MockInitialContextFactory