commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1606586 - in /commons/proper/configuration/trunk/src: main/java/org/apache/commons/configuration/builder/combined/ test/java/org/apache/commons/configuration/builder/combined/
Date Sun, 29 Jun 2014 19:43:48 GMT
Author: oheger
Date: Sun Jun 29 19:43:48 2014
New Revision: 1606586

URL: http://svn.apache.org/r1606586
Log:
Adapted return type of MultiFileConfigurationBuilder.configure().

This makes method chaining easier. The test class was updated correspondingly.

Modified:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/MultiFileConfigurationBuilder.java
    commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestMultiFileConfigurationBuilder.java

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/MultiFileConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/MultiFileConfigurationBuilder.java?rev=1606586&r1=1606585&r2=1606586&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/MultiFileConfigurationBuilder.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/MultiFileConfigurationBuilder.java
Sun Jun 29 19:43:48 2014
@@ -158,6 +158,16 @@ public class MultiFileConfigurationBuild
     }
 
     /**
+     * {@inheritDoc} This method is overridden to adapt the return type.
+     */
+    @Override
+    public MultiFileConfigurationBuilder<T> configure(BuilderParameters... params)
+    {
+        super.configure(params);
+        return this;
+    }
+
+    /**
      * {@inheritDoc} This implementation evaluates the file name pattern using
      * the configured {@code ConfigurationInterpolator}. If this file has
      * already been loaded, the corresponding builder is accessed. Otherwise, a

Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestMultiFileConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestMultiFileConfigurationBuilder.java?rev=1606586&r1=1606585&r2=1606586&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestMultiFileConfigurationBuilder.java
(original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestMultiFileConfigurationBuilder.java
Sun Jun 29 19:43:48 2014
@@ -67,11 +67,9 @@ public class TestMultiFileConfigurationB
     private static MultiFileConfigurationBuilder<XMLConfiguration> createTestBuilder(
             BuilderParameters managedParams)
     {
-        MultiFileConfigurationBuilder<XMLConfiguration> builder =
-                new MultiFileConfigurationBuilder<XMLConfiguration>(
-                        XMLConfiguration.class);
-        builder.configure(createTestBuilderParameters(managedParams));
-        return builder;
+        return new MultiFileConfigurationBuilder<XMLConfiguration>(
+                XMLConfiguration.class)
+                .configure(createTestBuilderParameters(managedParams));
     }
 
     /**
@@ -205,8 +203,7 @@ public class TestMultiFileConfigurationB
             {
                 cause = cause.getCause();
             }
-            assertTrue("SAXParseException was not thrown",
-                    cause instanceof SAXParseException);
+            assertTrue("SAXParseException was not thrown", cause != null);
         }
     }
 



Mime
View raw message