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

Method closures don't work for static methods

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-5
    • 1.0-JSR-1
    • None
    • None
    • WinXP, JDK1.4.2_03

    Description

      Trying to create a method closure from a staic metod fails...

      y = (new Object()).hashCode
      println y()
      //succeeds

      x = System.currentTimeMillis
      println x()
      // fails with
      // "No such property: currentTimeMillis for class: java.lang.System. Reason: java.lang.NoSuchFieldException: currentTimeMillis"

      Also... I don't think 'use' is too wild about static methods either.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            shemnon Daniel Ferrin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 48h
                48h
                Remaining:
                Remaining Estimate - 48h
                48h
                Logged:
                Time Spent - Not Specified
                Not Specified