commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r753626 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang/math/NumberUtils.java test/org/apache/commons/lang/math/NumberUtilsTest.java
Date Sat, 14 Mar 2009 10:01:54 GMT
Author: bayard
Date: Sat Mar 14 10:01:53 2009
New Revision: 753626

URL: http://svn.apache.org/viewvc?rev=753626&view=rev
Log:
Removing deprecated NumberUtils.toInt methods [LANG-438]

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/NumberUtils.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/math/NumberUtilsTest.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/NumberUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/NumberUtils.java?rev=753626&r1=753625&r2=753626&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/NumberUtils.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/NumberUtils.java Sat Mar
14 10:01:53 2009
@@ -91,28 +91,6 @@
      * <code>zero</code> if the conversion fails.</p>
      *
      * <p>If the string is <code>null</code>, <code>zero</code>
is returned.</p>
-     * 
-     * <pre>
-     *   NumberUtils.stringToInt(null) = 0
-     *   NumberUtils.stringToInt("")   = 0
-     *   NumberUtils.stringToInt("1")  = 1
-     * </pre>
-     *
-     * @param str  the string to convert, may be null
-     * @return the int represented by the string, or <code>zero</code> if
-     *  conversion fails
-     * @deprecated Use {@link #toInt(String)}
-     *  This method will be removed in Commons Lang 3.0
-     */
-    public static int stringToInt(String str) {
-        return toInt(str);
-    }
-
-    /**
-     * <p>Convert a <code>String</code> to an <code>int</code>,
returning
-     * <code>zero</code> if the conversion fails.</p>
-     *
-     * <p>If the string is <code>null</code>, <code>zero</code>
is returned.</p>
      *
      * <pre>
      *   NumberUtils.toInt(null) = 0
@@ -134,28 +112,6 @@
      * default value if the conversion fails.</p>
      *
      * <p>If the string is <code>null</code>, the default value is returned.</p>
-     * 
-     * <pre>
-     *   NumberUtils.stringToInt(null, 1) = 1
-     *   NumberUtils.stringToInt("", 1)   = 1
-     *   NumberUtils.stringToInt("1", 0)  = 1
-     * </pre>
-     *
-     * @param str  the string to convert, may be null
-     * @param defaultValue  the default value
-     * @return the int represented by the string, or the default if conversion fails
-     * @deprecated Use {@link #toInt(String, int)}
-     *  This method will be removed in Commons Lang 3.0
-     */
-    public static int stringToInt(String str, int defaultValue) {
-        return toInt(str, defaultValue);
-    }
-
-    /**
-     * <p>Convert a <code>String</code> to an <code>int</code>,
returning a
-     * default value if the conversion fails.</p>
-     *
-     * <p>If the string is <code>null</code>, the default value is returned.</p>
      *
      * <pre>
      *   NumberUtils.toInt(null, 1) = 1

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/math/NumberUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/math/NumberUtilsTest.java?rev=753626&r1=753625&r2=753626&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/math/NumberUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/math/NumberUtilsTest.java Sat
Mar 14 10:01:53 2009
@@ -69,16 +69,6 @@
     //---------------------------------------------------------------------
 
     /**
-     * Test for {@link NumberUtils#stringToInt(String)}.
-     */
-    public void testDeprecatedStringToIntString() {
-        assertTrue("stringToInt(String) 1 failed", NumberUtils.stringToInt("12345") == 12345);
-        assertTrue("stringToInt(String) 2 failed", NumberUtils.stringToInt("abc") == 0);
-        assertTrue("stringToInt(empty) failed", NumberUtils.stringToInt("") == 0);
-        assertTrue("stringToInt(null) failed", NumberUtils.stringToInt(null) == 0);
-    }
-
-    /**
      * Test for {@link NumberUtils#toInt(String)}.
      */
     public void testToIntString() {
@@ -89,14 +79,6 @@
     }
 
     /**
-     * Test for {@link NumberUtils#stringToInt(String, int)}.
-     */
-    public void testDeprecatedStringToIntStringI() {
-        assertTrue("stringToInt(String,int) 1 failed", NumberUtils.stringToInt("12345", 5)
== 12345);
-        assertTrue("stringToInt(String,int) 2 failed", NumberUtils.stringToInt("1234.5",
5) == 5);
-    }
-
-    /**
      * Test for {@link NumberUtils#toInt(String, int)}.
      */
     public void testToIntStringI() {



Mime
View raw message