groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-6831) Access to static fields/properties from within nested classes is inconsistent
Date Tue, 20 Sep 2016 06:55:20 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-6831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15505804#comment-15505804
] 

ASF GitHub Bot commented on GROOVY-6831:
----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/groovy/pull/425


> Access to static fields/properties from within nested classes is inconsistent
> -----------------------------------------------------------------------------
>
>                 Key: GROOVY-6831
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6831
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Paul King
>
> Misbehaves in the same way regardless of @CompileStatic:
> {code}
> import java.util.logging.Logger
> //@groovy.transform.CompileStatic
> class Foo {
>   private static final transient Logger log = Logger.getLogger(Foo.class.getName()) 
>   void method() {
>     log.info('some info')
>   }
>   static class Bar {
>     void method() {
>       log.info('some inner info')
>     }
>     static class Baz {
>        void method() {
>         log.info('some inner inner info')
>       }
>     }
>   }
> }
> new Foo().method() // => INFO: some info
> new Foo.Bar().method() // => INFO: some inner info
> new Foo.Bar.Baz().method() // => groovy.lang.MissingPropertyException: No such property:
log for class: Foo$Bar
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message