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
commit 9c2aea75eaca3fdcf819027a54fa1e8aaf3393a9 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Mon Apr 7 09:28:59 2025 -0400 No need to nest, simplify flow --- .../spring/ConfigurationPropertySource.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/spring/ConfigurationPropertySource.java b/src/main/java/org/apache/commons/configuration2/spring/ConfigurationPropertySource.java index e5ee819a..440935bd 100644 --- a/src/main/java/org/apache/commons/configuration2/spring/ConfigurationPropertySource.java +++ b/src/main/java/org/apache/commons/configuration2/spring/ConfigurationPropertySource.java @@ -50,18 +50,17 @@ public class ConfigurationPropertySource extends EnumerablePropertySource<Config @Override public Object getProperty(final String name) { - if (source.getProperty(name) != null) { - final String[] propValue = source.getStringArray(name); - if (propValue == null || propValue.length == 0) { - return ""; - } else if (propValue.length == 1) { - return propValue[0]; - } else { - return propValue; - } - } else { + if (source.getProperty(name) == null) { return null; } + final String[] propValue = source.getStringArray(name); + if (propValue == null || propValue.length == 0) { + return ""; + } + if (propValue.length == 1) { + return propValue[0]; + } + return propValue; } @Override