Author: sebb
Date: Thu Sep  8 17:30:04 2011
New Revision: 1166820

URL: http://svn.apache.org/viewvc?rev=1166820&view=rev
Log:
LANG-752 Fix createLong() so it behaves like createInteger()

Modified:
    
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
    commons/proper/lang/trunk/src/site/changes/changes.xml

Modified: 
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
URL: 
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java?rev=1166820&r1=1166819&r2=1166820&view=diff
==============================================================================
--- 
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
 (original)
+++ 
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
 Thu Sep  8 17:30:04 2011
@@ -665,7 +665,8 @@ public class NumberUtils {
     }
 
     /**
-     * <p>Convert a <code>String</code> to a <code>Long</code>.</p>
+     * <p>Convert a <code>String</code> to a <code>Long</code>; 
+     * since 3.0.2 it handles hex and octal notations.</p>
      * 
      * <p>Returns <code>null</code> if the string is <code>null</code>.</p>
      *
@@ -677,7 +678,7 @@ public class NumberUtils {
         if (str == null) {
             return null;
         }
-        return Long.valueOf(str);
+        return Long.decode(str);
     }
 
     /**

Modified: commons/proper/lang/trunk/src/site/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/site/changes/changes.xml?rev=1166820&r1=1166819&r2=1166820&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/site/changes/changes.xml (original)
+++ commons/proper/lang/trunk/src/site/changes/changes.xml Thu Sep  8 17:30:04 
2011
@@ -22,6 +22,7 @@
   <body>
 
   <release version="3.0.2" date="unreleased" description="September release">
+    <action type="update" issue="LANG-752">Fix createLong() so it behaves like 
createInteger()</action>
     <action type="update" issue="LANG-751">Include the actual type in the 
Validate.isInstance and isAssignableFrom exception messages</action>
     <action type="fix" issue="LANG-746">NumberUtils does not handle upper-case 
hex: 0X and -0X</action>
     <action type="update" issue="LANG-736">CharUtils static final array 
CHAR_STRING is not needed to compute CHAR_STRING_ARRAY</action>


Reply via email to