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

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

paulk-asert opened a new pull request, #2734:
URL: https://github.com/apache/groovy/pull/2734

   …reordering classgen
   
   Closure and anonymous inner classes materialize while bytecode is being 
generated, so a nest host emitted in normal order could not list them in its 
NestMembers attribute. The previous approach sorted nest hosts to the back of 
the classgen queue, which broke the supers-before-subclasses invariant relied 
on by ClassCompletionVerifier (GROOVY-11753, GROOVY-12188) and still could not 
see a host's own nested closures, requiring name prediction (GROOVY-11780). No 
ordering satisfies both constraints once a nest member extends its own host.
   
   Instead, restore plain hierarchy-order sorting and complete each nest host's 
NestMembers in a post-generation pass: once all of a module's classes are 
generated, the host's inner class list is complete, so its bytes are rewritten 
with the exact member set. GroovyClassLoader defines classes from the 
post-processed bytes. This removes the reordering, the closure-detection walk, 
and the member-name prediction, and is unaffected by whether a closure 
ultimately produces a class (GEP-27 closure packing).




> JEP 181: replace bridge methods with nest-based access control
> --------------------------------------------------------------
>
>                 Key: GROOVY-10687
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10687
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 5.0.0-alpha-11
>
>
> Leverage JEP 181 (https://openjdk.org/jeps/181) in Groovy compiler.  This 
> should be able to replace bridge methods for nestmate private member access.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to