You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by oh...@apache.org on 2013/08/19 16:32:10 UTC
svn commit: r1515444 - in /commons/proper/configuration/trunk/src:
main/java/org/apache/commons/configuration/convert/PropertyConverter.java
test/java/org/apache/commons/configuration/convert/TestPropertyConverter.java
Author: oheger
Date: Mon Aug 19 14:32:09 2013
New Revision: 1515444
URL: http://svn.apache.org/r1515444
Log:
Removed the interpolate() method from PropertyConverter.
In future PropertyConverter will be package protected and deal only with type
conversions.
Modified:
commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/convert/PropertyConverter.java
commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/convert/TestPropertyConverter.java
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/convert/PropertyConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/convert/PropertyConverter.java?rev=1515444&r1=1515443&r2=1515444&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/convert/PropertyConverter.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/convert/PropertyConverter.java Mon Aug 19 14:32:09 2013
@@ -32,8 +32,6 @@ import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.interpol.ConfigurationInterpolator;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
@@ -800,31 +798,6 @@ public final class PropertyConverter
}
/**
- * Performs interpolation of the specified value using the given
- * {@code Configuration} object. This method checks if the given
- * {@code Configuration} has a {@link ConfigurationInterpolator} object. If
- * so, it is called to perform interpolation. Otherwise, the passed in value
- * is return unchanged.
- *
- * @param value the value to be interpolated
- * @param config the current configuration object (may be <b>null</b>)
- * @return the interpolated value
- */
- public static Object interpolate(Object value, Configuration config)
- {
- Object result = value;
- if (config != null)
- {
- ConfigurationInterpolator interpolator = config.getInterpolator();
- if (interpolator != null)
- {
- result = interpolator.interpolate(value);
- }
- }
- return result;
- }
-
- /**
* Helper method for converting a value to a constant of an enumeration
* class.
*
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/convert/TestPropertyConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/convert/TestPropertyConverter.java?rev=1515444&r1=1515443&r2=1515444&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/convert/TestPropertyConverter.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/convert/TestPropertyConverter.java Mon Aug 19 14:32:09 2013
@@ -37,17 +37,6 @@ public class TestPropertyConverter
private static final Class<ElementType> ENUM_CLASS = ElementType.class;
/**
- * Tests interpolate() if the passed in configuration is null.
- */
- @Test
- public void testInterpolationNoConfiguration()
- {
- String txt = "The ${animal} jumps over the ${target}.";
- assertEquals("Interpolation was performed", txt,
- PropertyConverter.interpolate(txt, null));
- }
-
- /**
* Tests conversion to numbers when the passed in objects are already
* numbers.
*/