You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by shils <gi...@git.apache.org> on 2016/01/16 20:37:26 UTC

[GitHub] groovy pull request: GROOVY-7558 Add private field accessors and b...

GitHub user shils opened a pull request:

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

    GROOVY-7558 Add private field accessors and bridge methods to dynamic…

    … classes with statically compiled inner classes

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/shils/groovy GROOVY-7558

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/242.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #242
    
----
commit 5cb6368ed7c5755c62a76431e96b944e3dee796e
Author: Shil S <sh...@gmail.com>
Date:   2015-10-11T19:58:52Z

    GROOVY-7558 Add private field accessors and bridge methods to dynamic classes with statically compiled inner classes

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request #242: GROOVY-7558 Add private field accessors and bridge...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request: GROOVY-7558 Add private field accessors and b...

Posted by shils <gi...@git.apache.org>.
Github user shils commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/242#discussion_r50188030
  
    --- Diff: src/main/org/codehaus/groovy/transform/sc/StaticCompilationVisitor.java ---
    @@ -123,9 +123,20 @@ public void visitClass(final ClassNode node) {
             }
             super.visitClass(node);
             addPrivateFieldAndMethodAccessors(node);
    +        if (isStaticallyCompiled(node)) {
    +            ClassNode outer = node.getOuterClass();
    +            if (outer != null && !isStaticallyCompiled(outer)) {
    +                outer.putNodeMetaData(StaticCompilationMetadataKeys.DYNAMIC_OUTER_NODE, true);
    +            }
    +        }
             classNode = oldCN;
         }
     
    +    public void visitDynamicOuterClass(ClassNode node) {
    --- End diff --
    
    adding a public method here is not ideal, though it seems like the alternative would be to create a separate class responsible for adding bridge methods, which would be used by StaticCompilationVisitor as well as the phase operation added for dynamic outer classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---