[LANG-1613] - BigDecimal is created when you pass it the minimum values…
#642.
This commit is contained in:
parent
09c662429b
commit
4cf3dc8c8f
|
@ -55,6 +55,7 @@ The <action> type attribute can be add,update,fix,remove.
|
|||
<action issue="LANG-1579" type="update" dev="aherbert" due-to="XenoAmess">Improve StringUtils.stripAccents conversion of remaining accents.</action>
|
||||
<action issue="LANG-1606" type="update" dev="sebb" due-to="Rustem Galiev">StringUtils.countMatches - clarify Javadoc.</action>
|
||||
<action issue="LANG-1591" type="update" dev="kinow" due-to="bhawna94">Remove redundant argument from substring call.</action>
|
||||
<action issue="LANG-1613" type="update" dev="ggregory" due-to="Arturo Bernal, Gary Gregory">BigDecimal is created when you pass it the min and max values, #642.</action>
|
||||
<!-- ADDS -->
|
||||
<action type="add" dev="ggregory" due-to="Gary Gregory">Add BooleanUtils.booleanValues().</action>
|
||||
<action type="add" dev="ggregory" due-to="Gary Gregory">Add BooleanUtils.primitiveValues().</action>
|
||||
|
|
|
@ -755,7 +755,7 @@ public class NumberUtils {
|
|||
case 'D' :
|
||||
try {
|
||||
final Double d = createDouble(str);
|
||||
if (!(d.isInfinite() || d.floatValue() == 0.0D && !allZeros)) {
|
||||
if (!(d.isInfinite() || d.doubleValue() == 0.0D && !allZeros)) {
|
||||
return d;
|
||||
}
|
||||
} catch (final NumberFormatException nfe) { // NOPMD
|
||||
|
|
|
@ -1323,6 +1323,18 @@ public class NumberUtilsTest {
|
|||
assertTrue(NumberUtils.createNumber("0001.797693134862315759e+308") instanceof BigDecimal);
|
||||
assertTrue(NumberUtils.createNumber("-001.797693134862315759e+308") instanceof BigDecimal);
|
||||
assertTrue(NumberUtils.createNumber("+001.797693134862315759e+308") instanceof BigDecimal);
|
||||
//LANG-1613
|
||||
assertTrue(NumberUtils.createNumber(Double.toString(Double.MIN_NORMAL)) instanceof Double);
|
||||
assertTrue(NumberUtils.createNumber(Double.toString(Double.MIN_NORMAL) + "D") instanceof Double);
|
||||
assertTrue(NumberUtils.createNumber(Double.toString(Double.MIN_NORMAL) + "F") instanceof Double);
|
||||
assertTrue(NumberUtils.createNumber(Double.toString(Double.MIN_VALUE)) instanceof Double);
|
||||
assertTrue(NumberUtils.createNumber(Double.toString(Double.MIN_VALUE) + "D") instanceof Double);
|
||||
assertTrue(NumberUtils.createNumber(Double.toString(Double.MIN_VALUE) + "F") instanceof Double);
|
||||
assertTrue(NumberUtils.createNumber(Double.toString(Double.MAX_VALUE)) instanceof Double);
|
||||
assertTrue(NumberUtils.createNumber(Double.toString(Double.MAX_VALUE) + "D") instanceof Double);
|
||||
assertTrue(NumberUtils.createNumber(Double.toString(Double.MAX_VALUE) + "F") instanceof Double);
|
||||
assertTrue(NumberUtils.createNumber("4.9e-324D") instanceof Double);
|
||||
assertTrue(NumberUtils.createNumber("4.9e-324F") instanceof Double);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue