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

Exception while evaluating classes with static toString() methods

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.6.1, 1.5.8, 1.7-beta-1
    • None
    • None

    Description

      Try the following script:

      assert 'class java.text.SimpleDateFormat' == java.text.SimpleDateFormat.toString()
      assert 'class java.lang.Integer' == java.lang.Integer.toString()

      the second statement throws exception:
      Exception thrown: Could not find which method toString() to invoke from this list:
      public static java.lang.String java.lang.Integer#toString(int)
      public static java.lang.String java.lang.Integer#toString(int, int)

      It looks like Class.toString() is not taken into account while trying to evaluate this expression.
      Integer.class.toString() produces the same error.

      Attachments

        Activity

          People

            roshandawrani Roshan Dawrani
            enterit Sergey Bondarenko
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: