You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/04/27 08:34:00 UTC

[jira] [Closed] (GROOVY-10540) Inconsistent application of and checking for GroovyObject in classgen

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

Paul King closed GROOVY-10540.
------------------------------

> Inconsistent application of and checking for GroovyObject in classgen
> ---------------------------------------------------------------------
>
>                 Key: GROOVY-10540
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10540
>             Project: Groovy
>          Issue Type: Bug
>          Components: class generator
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>              Labels: class-generation, platform-consistency
>             Fix For: 5.0.0-alpha-1, 4.0.2
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> {{Verifier}} adds {{GroovyObject}} to most classes near the start of the classgen compile phase.  However, classgen proceeds per class node and there are a number of places that check for {{GroovyObject}} and can be subject to order-of-operations issues.
> Consider the following (excerpt of GROOVY-5517 test case):
> {code:groovy}
> class MyHashMap extends HashMap {
>     public static int version = 123
> }
> def map = new MyHashMap()
> map['foo'] = 456
> print map.foo
> {code}
> The script class can be processed before {{MyHashMap}} and the checks in {{AsmClassGenerator}} can produce different bytecode depending on detection of {{GroovyObject}} on {{MyHashMap}}.  Under static compilation this means the difference between {{StaticTypesCallSiteWriter#makeGetPropertySite}} and {{StaticTypesCallSiteWriter#makeGroovyObjectGetPropertySite}} for "map.foo".
> https://stackoverflow.com/a/61071840/1082681
> https://github.com/groovy/groovy-eclipse/issues/1353



--
This message was sent by Atlassian Jira
(v8.20.7#820007)