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

Class expressions with and without ".class"

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      This seems like a bug (but it could just be a clarification in the documentation). And it seems related to GROOVY-3548, GROOVY-3549, GROOVY-8152, GROOVY-8153, and GROOVY-8154.

      System.currentTimeMillis() is your typical static call.
      System.getClass().currentTimeMillis() results in a MissingMethodException, as it should.
      However, System.class.currentTimeMillis() and def sys = System.class; sys.currentTimeMillis() both compile and execute fine. I would expect a MissingMethodException for these as well.

      Is there some trick where methodMissing on class instance can find the static method or something? My Java experience says no currentTimeMillis method on Class.

      Attachments

        Activity

          People

            Unassigned Unassigned
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: