Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.7, 1.6-rc-1
-
Fix Version/s: 1.6-rc-2, 1.5.8, 1.7-beta-1
-
Component/s: None
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
Somehow Groovy is calling some formatting method rather than String.valueOf(Object) for:
String.valueOf(new BigInteger('1000'))
You can see the difference with:
assert (String.valueOf(new BigInteger('1000'))) == (new BigInteger('1000').toString())
which is a good test because String.valueOf(Object) is defined to be the same as String.toString() if the object is not null.
Attachments
Issue Links
| This issue is depended upon by: | ||||
| GROOVY-3237 | println is inconsistent |
|
|
|
I think this is another static method resolution bug.
Groovy is preferring String.valueOf(double) over String.valueOf(Object) and doing a conversion when the parameter is a BigInteger. That doesn't appear to be happening for BigDecimal from what I've tried so far, so this isn't some logic just about Number.