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

Marcus Olk commented on GROOVY-3010:
------------------------------------

I don't know whether it makes any sense to add another vote, but I just ran 
into the following issue:

{code}
public class JavaClass {
    public static final A B = new B();

    public static abstract class A {  }

    private static class B extends A {
        private B() {}
    }
}
{code}

The public field {{JavaClass.B}} is simply not accessible for Groovy code: 
{{JavaClass.B}} gives you the private inner class B extending A.

Sure, this is bad design having a field with the same name as an inner class, 
but it just happend to me, that I had to create a Java class as a proxy for my 
Groovy code because a Java library used this (anti-) pattern.

Sorry, but that simply sucks, doesn't it?


> fix private field visibility
> ----------------------------
>
>                 Key: GROOVY-3010
>                 URL: https://issues.apache.org/jira/browse/GROOVY-3010
>             Project: Groovy
>          Issue Type: Task
>          Components: groovy-runtime
>            Reporter: Jochen Theodorou
>             Fix For: 3.0
>
>         Attachments: privateInJsUseWrapMethodExample.js
>
>
> this task collects all the issues related to a privae field being visible, 
> when it should not be visible



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

Reply via email to