You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/07/22 13:57:21 UTC

(commons-configuration) branch master updated (3f8ab55c -> b3e29546)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-configuration.git


    from 3f8ab55c Use generics internally
     new 3eb96c1b Javadoc
     new 58874af9 Javadoc
     new b480ccbc Javadoc
     new b3e29546 Reduce vertical whitespace

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../commons/configuration2/BaseConfiguration.java  |   8 +-
 .../commons/configuration2/ConfigurationUtils.java | 152 ++++++++++-----------
 .../commons/configuration2/MapConfiguration.java   |  22 +--
 .../configuration2/TestConfigurationUtils.java     |   4 -
 4 files changed, 87 insertions(+), 99 deletions(-)


(commons-configuration) 01/04: Javadoc

Posted by gg...@apache.org.
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 3eb96c1b6e20f6ad24432378bd2ce9819356dc06
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 22 09:51:05 2025 -0400

    Javadoc
    
    Reduce vertical whitespace
---
 .../java/org/apache/commons/configuration2/BaseConfiguration.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/configuration2/BaseConfiguration.java b/src/main/java/org/apache/commons/configuration2/BaseConfiguration.java
index ac6d6cb7..dda6f9c2 100644
--- a/src/main/java/org/apache/commons/configuration2/BaseConfiguration.java
+++ b/src/main/java/org/apache/commons/configuration2/BaseConfiguration.java
@@ -34,7 +34,10 @@ import org.apache.commons.configuration2.ex.ConfigurationRuntimeException;
  * value strings instead of overwriting them.
  */
 public class BaseConfiguration extends AbstractConfiguration implements Cloneable {
-    /** Stores the configuration key-value pairs */
+
+    /**
+     * Stores the configuration key-value pairs.
+     */
     private Map<String, Object> store = new LinkedHashMap<>();
 
     /**
@@ -46,7 +49,6 @@ public class BaseConfiguration extends AbstractConfiguration implements Cloneabl
     @Override
     protected void addPropertyDirect(final String key, final Object value) {
         final Object previousValue = getPropertyInternal(key);
-
         if (previousValue == null) {
             store.put(key, value);
         } else if (previousValue instanceof List) {
@@ -60,7 +62,6 @@ public class BaseConfiguration extends AbstractConfiguration implements Cloneabl
             final List<Object> list = new ArrayList<>();
             list.add(previousValue);
             list.add(value);
-
             store.put(key, list);
         }
     }
@@ -93,7 +94,6 @@ public class BaseConfiguration extends AbstractConfiguration implements Cloneabl
             final BaseConfiguration copy = (BaseConfiguration) super.clone();
             cloneStore(copy);
             copy.cloneInterpolator(this);
-
             return copy;
         } catch (final CloneNotSupportedException cex) {
             // should not happen


(commons-configuration) 02/04: Javadoc

Posted by gg...@apache.org.
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 58874af96e2773fbee7003659ca4dcf2707b40d5
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 22 09:51:32 2025 -0400

    Javadoc
    
    Reduce vertical whitespace
---
 .../commons/configuration2/ConfigurationUtils.java | 152 ++++++++++-----------
 1 file changed, 72 insertions(+), 80 deletions(-)

diff --git a/src/main/java/org/apache/commons/configuration2/ConfigurationUtils.java b/src/main/java/org/apache/commons/configuration2/ConfigurationUtils.java
index 0dc054cc..ce70ee57 100644
--- a/src/main/java/org/apache/commons/configuration2/ConfigurationUtils.java
+++ b/src/main/java/org/apache/commons/configuration2/ConfigurationUtils.java
@@ -42,7 +42,10 @@ import org.apache.commons.logging.LogFactory;
  * @see ConfigurationConverter Utility methods to convert configurations.
  */
 public final class ConfigurationUtils {
-    /** Constant for the name of the clone() method. */
+
+    /**
+     * Constant for the name of the clone() method.
+     */
     private static final String METHOD_CLONE = "clone";
 
     /**
@@ -85,8 +88,8 @@ public final class ConfigurationUtils {
      * method of {@code AbstractConfiguration} should be used. In a future release this method might become deprecated.
      * </p>
      *
-     * @param source the source configuration
-     * @param target the target configuration
+     * @param source the source configuration.
+     * @param target the target configuration.
      * @since 1.1
      */
     public static void append(final Configuration source, final Configuration target) {
@@ -104,8 +107,8 @@ public final class ConfigurationUtils {
      * method of {@code AbstractConfiguration} should be used. In a future release this method might become deprecated.
      * </p>
      *
-     * @param source the source configuration
-     * @param target the target configuration
+     * @param source the source configuration.
+     * @param target the target configuration.
      * @since 2.2
      */
     public static void append(final ImmutableConfiguration source, final Configuration target) {
@@ -118,18 +121,17 @@ public final class ConfigurationUtils {
      * {@code ConfigurationRuntimeException} is thrown; if set to <strong>true</strong>, a dummy {@code EventSource} is returned; on
      * this object all methods can be called, but they do not have any effect.
      *
-     * @param obj the object to be cast as {@code EventSource}
-     * @param mockIfUnsupported a flag whether a mock object should be returned if necessary
-     * @return an {@code EventSource}
+     * @param obj the object to be cast as {@code EventSource}.
+     * @param mockIfUnsupported a flag whether a mock object should be returned if necessary.
+     * @return an {@code EventSource}.
      * @throws ConfigurationRuntimeException if the object cannot be cast to {@code EventSource} and the mock flag is
-     *         <strong>false</strong>
+     *         <strong>false</strong>.
      * @since 2.0
      */
     public static EventSource asEventSource(final Object obj, final boolean mockIfUnsupported) {
         if (obj instanceof EventSource) {
             return (EventSource) obj;
         }
-
         if (!mockIfUnsupported) {
             throw new ConfigurationRuntimeException("Cannot cast to EventSource: " + obj);
         }
@@ -142,12 +144,15 @@ public final class ConfigurationUtils {
      * implements the {@code Cloneable} interface. If this is the case, the {@code clone()} method is invoked by reflection.
      * Errors that occur during the cloning process are re-thrown as runtime exceptions.
      *
-     * @param obj the object to be cloned
-     * @return the cloned object
-     * @throws CloneNotSupportedException if the object cannot be cloned
+     * @param obj the object to be cloned or null.
+     * @return the cloned object or null.
+     * @throws CloneNotSupportedException if the object cannot be cloned.
      */
     @SuppressWarnings("unchecked")
     static <T> T clone(final T obj) throws CloneNotSupportedException {
+        if (obj == null) {
+            return null;
+        }
         if (obj instanceof Cloneable) {
             try {
                 return (T) obj.getClass().getMethod(METHOD_CLONE).invoke(obj);
@@ -164,15 +169,12 @@ public final class ConfigurationUtils {
      * Clones the given configuration object if this is possible. If the passed in configuration object implements the
      * {@code Cloneable} interface, its {@code clone()} method will be invoked. Otherwise an exception will be thrown.
      *
-     * @param config the configuration object to be cloned (can be <strong>null</strong>)
-     * @return the cloned configuration (<strong>null</strong> if the argument was <strong>null</strong>, too)
-     * @throws ConfigurationRuntimeException if cloning is not supported for this object
+     * @param config the configuration object to be cloned (can be <strong>null</strong>).
+     * @return the cloned configuration (<strong>null</strong> if the argument was <strong>null</strong>, too).
+     * @throws ConfigurationRuntimeException if cloning is not supported for this object.
      * @since 1.3
      */
     public static Configuration cloneConfiguration(final Configuration config) throws ConfigurationRuntimeException {
-        if (config == null) {
-            return null;
-        }
         try {
             return clone(config);
         } catch (final CloneNotSupportedException cnex) {
@@ -186,8 +188,8 @@ public final class ConfigurationUtils {
      * method is invoked. Otherwise, the object is directly returned. Errors that might occur during reflection calls are
      * caught and also cause this method to return the original object.
      *
-     * @param obj the object to be cloned
-     * @return the result of the cloning attempt
+     * @param obj the object to be cloned.
+     * @return the result of the cloning attempt.
      * @since 2.0
      */
     public static Object cloneIfPossible(final Object obj) {
@@ -209,10 +211,10 @@ public final class ConfigurationUtils {
      * </ul>
      * If all attempts fail, a {@code ConfigurationRuntimeException} is thrown.
      *
-     * @param sync the {@code Synchronizer} object to be cloned
-     * @return the clone of this {@code Synchronizer}
-     * @throws ConfigurationRuntimeException if no clone can be created
-     * @throws IllegalArgumentException if <strong>null</strong> is passed in
+     * @param sync the {@code Synchronizer} object to be cloned.
+     * @return the clone of this {@code Synchronizer}.
+     * @throws ConfigurationRuntimeException if no clone can be created.
+     * @throws IllegalArgumentException if <strong>null</strong> is passed in.
      */
     public static Synchronizer cloneSynchronizer(final Synchronizer sync) {
         if (sync == null) {
@@ -221,17 +223,14 @@ public final class ConfigurationUtils {
         if (NoOpSynchronizer.INSTANCE == sync) {
             return sync;
         }
-
         try {
             return sync.getClass().getConstructor().newInstance();
-        } catch (final Exception ex) {
-            LOG.info("Cannot create new instance of " + sync.getClass());
-        }
-
-        try {
-            return clone(sync);
-        } catch (final CloneNotSupportedException cnex) {
-            throw new ConfigurationRuntimeException("Cannot clone Synchronizer " + sync);
+        } catch (final Exception ignore) {
+            try {
+                return clone(sync);
+            } catch (final CloneNotSupportedException e) {
+                throw new ConfigurationRuntimeException("Cannot clone Synchronizer " + sync);
+            }
         }
     }
 
@@ -239,9 +238,9 @@ public final class ConfigurationUtils {
      * Converts the passed in configuration to a hierarchical one. If the configuration is already hierarchical, it is
      * directly returned. Otherwise all properties are copied into a new hierarchical configuration.
      *
-     * @param conf the configuration to convert
+     * @param conf the configuration to convert.
      * @return the new hierarchical configuration (the result is <strong>null</strong> if and only if the passed in configuration is
-     *         <strong>null</strong>)
+     *         <strong>null</strong>).
      * @since 1.3
      */
     public static HierarchicalConfiguration<?> convertToHierarchical(final Configuration conf) {
@@ -258,30 +257,27 @@ public final class ConfigurationUtils {
      * passed in configuration is already hierarchical, it is directly returned. (However, the {@code ExpressionEngine} is
      * set if it is not <strong>null</strong>.) Otherwise all properties are copied into a new hierarchical configuration.
      *
-     * @param conf the configuration to convert
-     * @param engine the {@code ExpressionEngine} for the hierarchical configuration or <strong>null</strong> for the default
+     * @param conf the configuration to convert.
+     * @param engine the {@code ExpressionEngine} for the hierarchical configuration or <strong>null</strong> for the default.
      * @return the new hierarchical configuration (the result is <strong>null</strong> if and only if the passed in configuration is
-     *         <strong>null</strong>)
+     *         <strong>null</strong>).
      * @since 1.6
      */
     public static HierarchicalConfiguration<?> convertToHierarchical(final Configuration conf, final ExpressionEngine engine) {
         if (conf == null) {
             return null;
         }
-
         if (conf instanceof HierarchicalConfiguration) {
             final HierarchicalConfiguration<?> hc = (HierarchicalConfiguration<?>) conf;
             if (engine != null) {
                 hc.setExpressionEngine(engine);
             }
-
             return hc;
         }
         final BaseHierarchicalConfiguration hc = new BaseHierarchicalConfiguration();
         if (engine != null) {
             hc.setExpressionEngine(engine);
         }
-
         // Per default, a DisabledListDelimiterHandler is set.
         // So list delimiters in property values are not an issue.
         hc.copy(conf);
@@ -299,8 +295,8 @@ public final class ConfigurationUtils {
      * method of {@code AbstractConfiguration} should be used. In a future release this method might become deprecated.
      * </p>
      *
-     * @param source the source configuration
-     * @param target the target configuration
+     * @param source the source configuration.
+     * @param target the target configuration.
      * @since 1.1
      */
     public static void copy(final Configuration source, final Configuration target) {
@@ -318,8 +314,8 @@ public final class ConfigurationUtils {
      * method of {@code AbstractConfiguration} should be used. In a future release this method might become deprecated.
      * </p>
      *
-     * @param source the source configuration
-     * @param target the target configuration
+     * @param source the source configuration.
+     * @param target the target configuration.
      * @since 2.2
      */
     public static void copy(final ImmutableConfiguration source, final Configuration target) {
@@ -330,10 +326,10 @@ public final class ConfigurationUtils {
      * Helper method for creating a proxy for an unmodifiable configuration. The interfaces the proxy should implement are
      * passed as argument.
      *
-     * @param ifcs an array with the interface classes the proxy must implement
-     * @param c the configuration object to be wrapped
-     * @return a proxy object for an immutable configuration
-     * @throws NullPointerException if the configuration is <strong>null</strong>
+     * @param ifcs an array with the interface classes the proxy must implement.
+     * @param c the configuration object to be wrapped.
+     * @return a proxy object for an immutable configuration.
+     * @throws NullPointerException if the configuration is <strong>null</strong>.
      */
     private static ImmutableConfiguration createUnmodifiableConfiguration(final Class<?>[] ifcs, final Configuration c) {
         return (ImmutableConfiguration) Proxy.newProxyInstance(ConfigurationUtils.class.getClassLoader(), ifcs, new ImmutableConfigurationInvocationHandler(c));
@@ -343,8 +339,8 @@ public final class ConfigurationUtils {
      * Dump the configuration key/value mappings to some ouput stream. This version of the method exists only for backwards
      * compatibility reason.
      *
-     * @param configuration the configuration
-     * @param out the output stream to dump the configuration to
+     * @param configuration the configuration.
+     * @param out the output stream to dump the configuration to.
      */
     public static void dump(final Configuration configuration, final PrintStream out) {
         dump((ImmutableConfiguration) configuration, out);
@@ -354,8 +350,8 @@ public final class ConfigurationUtils {
      * Dump the configuration key/value mappings to some writer. This version of the method exists only for backwards
      * compatibility reason.
      *
-     * @param configuration the configuration
-     * @param out the writer to dump the configuration to
+     * @param configuration the configuration.
+     * @param out the writer to dump the configuration to.
      */
     public static void dump(final Configuration configuration, final PrintWriter out) {
         dump((ImmutableConfiguration) configuration, out);
@@ -364,8 +360,8 @@ public final class ConfigurationUtils {
     /**
      * Dump the configuration key/value mappings to some ouput stream.
      *
-     * @param configuration the configuration
-     * @param out the output stream to dump the configuration to
+     * @param configuration the configuration.
+     * @param out the output stream to dump the configuration to.
      * @since 2.2
      */
     public static void dump(final ImmutableConfiguration configuration, final PrintStream out) {
@@ -375,8 +371,8 @@ public final class ConfigurationUtils {
     /**
      * Dump the configuration key/value mappings to some writer.
      *
-     * @param configuration the configuration
-     * @param out the writer to dump the configuration to
+     * @param configuration the configuration.
+     * @param out the writer to dump the configuration to.
      * @since 2.2
      */
     public static void dump(final ImmutableConfiguration configuration, final PrintWriter out) {
@@ -386,12 +382,10 @@ public final class ConfigurationUtils {
             out.print(key);
             out.print("=");
             out.print(value);
-
             if (keys.hasNext()) {
                 out.println();
             }
         }
-
         out.flush();
     }
 
@@ -403,7 +397,7 @@ public final class ConfigurationUtils {
      * {@code ConfigurationRuntimeException}) on each received error event.
      *
      * @param src the configuration, for which runtime exceptions are to be enabled; this configuration must implement
-     *        {@link EventSource}
+     *        {@link EventSource}.
      */
     public static void enableRuntimeExceptions(final Configuration src) {
         if (!(src instanceof EventSource)) {
@@ -419,16 +413,15 @@ public final class ConfigurationUtils {
      * Loads the class with the given name. This method is used whenever a class has to be loaded dynamically. It first
      * tries the current thread's context class loader. If this fails, the class loader of this class is tried.
      *
-     * @param clsName the name of the class to be loaded
-     * @return the loaded class
-     * @throws ClassNotFoundException if the class cannot be resolved
+     * @param clsName the name of the class to be loaded.
+     * @return the loaded class.
+     * @throws ClassNotFoundException if the class cannot be resolved.
      * @since 2.0
      */
     public static Class<?> loadClass(final String clsName) throws ClassNotFoundException {
         if (LOG.isDebugEnabled()) {
             LOG.debug("Loading class " + clsName);
         }
-
         final ClassLoader cl = Thread.currentThread().getContextClassLoader();
         try {
             if (cl != null) {
@@ -437,7 +430,6 @@ public final class ConfigurationUtils {
         } catch (final ClassNotFoundException cnfex) {
             LOG.info("Could not load class " + clsName + " using CCL. Falling back to default CL.", cnfex);
         }
-
         return ConfigurationUtils.class.getClassLoader().loadClass(clsName);
     }
 
@@ -446,9 +438,9 @@ public final class ConfigurationUtils {
      * This method works like {@link #loadClass(String)}. However, checked exceptions are caught and re-thrown as
      * {@code ConfigurationRuntimeException}.
      *
-     * @param clsName the name of the class to be loaded
-     * @return the loaded class
-     * @throws ConfigurationRuntimeException if the class cannot be resolved
+     * @param clsName the name of the class to be loaded.
+     * @return the loaded class.
+     * @throws ConfigurationRuntimeException if the class cannot be resolved.
      * @since 2.0
      */
     public static Class<?> loadClassNoEx(final String clsName) {
@@ -463,8 +455,8 @@ public final class ConfigurationUtils {
      * Gets a string representation of the key/value mappings of a configuration. This version of the method exists only for
      * backwards compatibility reason.
      *
-     * @param configuration the configuration
-     * @return a string representation of the configuration
+     * @param configuration the configuration.
+     * @return a string representation of the configuration.
      */
     public static String toString(final Configuration configuration) {
         return toString((ImmutableConfiguration) configuration);
@@ -473,8 +465,8 @@ public final class ConfigurationUtils {
     /**
      * Gets a string representation of the key/value mappings of a configuration.
      *
-     * @param configuration the configuration
-     * @return a string representation of the configuration
+     * @param configuration the configuration.
+     * @return a string representation of the configuration.
      * @since 2.2
      */
     public static String toString(final ImmutableConfiguration configuration) {
@@ -489,9 +481,9 @@ public final class ConfigurationUtils {
      * interface. Through this interface the configuration cannot be manipulated. It is also not possible to cast the
      * returned object back to a {@code Configuration} instance to circumvent this protection.
      *
-     * @param c the {@code Configuration} to be wrapped (must not be <strong>null</strong>)
-     * @return an {@code ImmutableConfiguration} view on the specified {@code Configuration} object
-     * @throws NullPointerException if the passed in {@code Configuration} is <strong>null</strong>
+     * @param c the {@code Configuration} to be wrapped (must not be <strong>null</strong>).
+     * @return an {@code ImmutableConfiguration} view on the specified {@code Configuration} object.
+     * @throws NullPointerException if the passed in {@code Configuration} is <strong>null</strong>.
      * @since 2.0
      */
     public static ImmutableConfiguration unmodifiableConfiguration(final Configuration c) {
@@ -502,9 +494,9 @@ public final class ConfigurationUtils {
      * Creates an {@code ImmutableHierarchicalConfiguration} from the given {@code HierarchicalConfiguration} object. This
      * method works exactly like the method with the same name, but it operates on hierarchical configurations.
      *
-     * @param c the {@code HierarchicalConfiguration} to be wrapped (must not be <strong>null</strong>)
-     * @return an {@code ImmutableHierarchicalConfiguration} view on the specified {@code HierarchicalConfiguration} object
-     * @throws NullPointerException if the passed in {@code HierarchicalConfiguration} is <strong>null</strong>
+     * @param c the {@code HierarchicalConfiguration} to be wrapped (must not be <strong>null</strong>).
+     * @return an {@code ImmutableHierarchicalConfiguration} view on the specified {@code HierarchicalConfiguration} object.
+     * @throws NullPointerException if the passed in {@code HierarchicalConfiguration} is <strong>null</strong>.
      * @since 2.0
      */
     public static ImmutableHierarchicalConfiguration unmodifiableConfiguration(final HierarchicalConfiguration<?> c) {
@@ -515,6 +507,6 @@ public final class ConfigurationUtils {
      * Private constructor. Prevents instances from being created.
      */
     private ConfigurationUtils() {
-        // to prevent instantiation...
+        // Prevents instantiation.
     }
 }


(commons-configuration) 03/04: Javadoc

Posted by gg...@apache.org.
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 b480ccbcba221cef91317cbd28cd1f8369a5ec63
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 22 09:52:00 2025 -0400

    Javadoc
---
 .../commons/configuration2/MapConfiguration.java   | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/main/java/org/apache/commons/configuration2/MapConfiguration.java b/src/main/java/org/apache/commons/configuration2/MapConfiguration.java
index 1f8f5c7e..fbd59326 100644
--- a/src/main/java/org/apache/commons/configuration2/MapConfiguration.java
+++ b/src/main/java/org/apache/commons/configuration2/MapConfiguration.java
@@ -80,8 +80,8 @@ public class MapConfiguration extends AbstractConfiguration implements Cloneable
      * comment of the constructor, we expect the {@code Properties} object to contain only String key; therefore, it is safe
      * to do this cast.
      *
-     * @param props the {@code Properties} to be copied
-     * @return a newly created map with all string keys of the properties
+     * @param props the {@code Properties} to be copied.
+     * @return a newly created map with all string keys of the properties.
      */
     @SuppressWarnings("unchecked")
     private static Map<String, Object> toMap(final Properties props) {
@@ -100,7 +100,7 @@ public class MapConfiguration extends AbstractConfiguration implements Cloneable
      * Create a Configuration decorator around the specified Map. The map is used to store the configuration properties, any
      * change will also affect the Map.
      *
-     * @param map the map
+     * @param map the map.
      */
     public MapConfiguration(final Map<String, ?> map) {
         this.map = (Map<String, Object>) Objects.requireNonNull(map, "map");
@@ -112,7 +112,7 @@ public class MapConfiguration extends AbstractConfiguration implements Cloneable
      * {@code Properties} actually implements {@code Map<Object, Object>}, we expect it to contain only string keys. Other
      * key types will lead to {@code ClassCastException} exceptions on certain methods.
      *
-     * @param props the {@code Properties} object defining the content of this configuration
+     * @param props the {@code Properties} object defining the content of this configuration.
      * @since 1.8
      */
     public MapConfiguration(final Properties props) {
@@ -145,10 +145,9 @@ public class MapConfiguration extends AbstractConfiguration implements Cloneable
     }
 
     /**
-     * Returns a copy of this object. The returned configuration will contain the same properties as the original. Event
-     * listeners are not cloned.
+     * Returns a copy of this object. The returned configuration will contain the same properties as the original. Event listeners are not cloned.
      *
-     * @return the copy
+     * @return the copy.
      * @since 1.3
      */
     @Override
@@ -172,6 +171,7 @@ public class MapConfiguration extends AbstractConfiguration implements Cloneable
     /**
      * Tests whether this configuration contains one or more matches to this value. This operation stops at first match
      * but may be more expensive than the containsKey method.
+     *
      * @since 2.11.0
      */
     @Override
@@ -187,7 +187,7 @@ public class MapConfiguration extends AbstractConfiguration implements Cloneable
     /**
      * Gets the Map decorated by this configuration.
      *
-     * @return the map this configuration is based onto
+     * @return the map this configuration is based onto.
      */
     public Map<String, Object> getMap() {
         return map;
@@ -209,9 +209,9 @@ public class MapConfiguration extends AbstractConfiguration implements Cloneable
     }
 
     /**
-     * Returns the flag whether trimming of property values is disabled.
+     * Tests whether the flag whether trimming of property values is disabled.
      *
-     * @return <strong>true</strong> if trimming of property values is disabled; <strong>false</strong> otherwise
+     * @return <strong>true</strong> if trimming of property values is disabled; <strong>false</strong> otherwise.
      * @since 1.7
      */
     public boolean isTrimmingDisabled() {
@@ -222,7 +222,7 @@ public class MapConfiguration extends AbstractConfiguration implements Cloneable
      * Sets a flag whether trimming of property values is disabled. This flag is only evaluated if list splitting is
      * enabled. Refer to the header comment for more information about list splitting and trimming.
      *
-     * @param trimmingDisabled a flag whether trimming of property values should be disabled
+     * @param trimmingDisabled a flag whether trimming of property values should be disabled.
      * @since 1.7
      */
     public void setTrimmingDisabled(final boolean trimmingDisabled) {


(commons-configuration) 04/04: Reduce vertical whitespace

Posted by gg...@apache.org.
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 b3e295466a54b0f0444ca9af3ec1327c3b7dfb9b
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 22 09:52:16 2025 -0400

    Reduce vertical whitespace
---
 .../org/apache/commons/configuration2/TestConfigurationUtils.java     | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/test/java/org/apache/commons/configuration2/TestConfigurationUtils.java b/src/test/java/org/apache/commons/configuration2/TestConfigurationUtils.java
index e421b3ae..50745772 100644
--- a/src/test/java/org/apache/commons/configuration2/TestConfigurationUtils.java
+++ b/src/test/java/org/apache/commons/configuration2/TestConfigurationUtils.java
@@ -337,7 +337,6 @@ public class TestConfigurationUtils {
             conf.addProperty("test" + i, "value" + i);
             conf.addProperty("test.list", "item" + i);
         }
-
         final BaseHierarchicalConfiguration hc = (BaseHierarchicalConfiguration) ConfigurationUtils.convertToHierarchical(conf);
         for (final Iterator<String> it = conf.getKeys(); it.hasNext();) {
             final String key = it.next();
@@ -411,15 +410,12 @@ public class TestConfigurationUtils {
         final Configuration conf1 = new BaseConfiguration();
         conf1.addProperty("key1", "value1");
         conf1.addProperty("key2", "value2");
-
         // create the target configuration
         final Configuration conf2 = new BaseConfiguration();
         conf2.addProperty("key1", "value3");
         conf2.addProperty("key2", "value4");
-
         // copy the source configuration into the target configuration
         ConfigurationUtils.copy(conf1, conf2);
-
         assertEquals("value1", conf2.getProperty("key1"));
         assertEquals("value2", conf2.getProperty("key2"));
     }