[jira] [Updated] (GROOVY-8350) Class expressions with and without ".class"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (GROOVY-8350) Class expressions with and without ".class"

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/GROOVY-8350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles updated GROOVY-8350:
--------------------------------
    Description:
This seems like a bug (but it could just be a clarification in the documentation).  And is seems related to 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}}.

  was:
This seems like a bug (but it could just be a clarification in the documentation).  And is seems related to 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}}.




> Class expressions with and without ".class"
> -------------------------------------------
>
>                 Key: GROOVY-8350
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8350
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>
> This seems like a bug (but it could just be a clarification in the documentation).  And is seems related to 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}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)