Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3238

String.valueOf(BigInteger) doesn't call String.valueOf(Object)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.7, 1.6-rc-1
    • 1.6-rc-2, 1.5.8, 1.7-beta-1
    • None
    • None

    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

        1. Groovy3238Bug.groovy
          0.2 kB
          James P. White

        Issue Links

          Activity

            People

              roshandawrani Roshan Dawrani
              jimwhite James P. White
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: