[
https://issues.apache.org/jira/browse/GROOVY-9665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17167150#comment-17167150
]
Björn Kautler commented on GROOVY-9665:
---------------------------------------
Hm, indeed makes sense unfortunately.
I just wouldn't have expected such an intentional breaking change in a minor
release, thus I thought it is a regression.
So if we want to re-enable this case, we need to use {{rehydreate}} instead of
{{setDelegate}} and a resolve strategy of {{DELEGATE_FIRST}} instead of
{{DELEGATE_ONLY}}, right?
Do you have a little additional hint about {{owner}} vs. {{thisObject}}?
Currently both are set to {{null}}.
And as far as I remember at the time those annotations are evaluated, there is
no instance of the test class yet.
So would I set {{owner}} to the actual class instance and leave {{thisObject}}
as {{null}}?
> Regression in 3.0.5 for accessing static constants in closures
> --------------------------------------------------------------
>
> Key: GROOVY-9665
> URL: https://issues.apache.org/jira/browse/GROOVY-9665
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 3.0.5
> Reporter: Björn Kautler
> Assignee: Eric Milles
> Priority: Major
> Attachments: image-2020-07-28-00-00-37-055.png
>
>
> Up to 3.0.4 (including 2.x) it worked perfectly fine.
> Starting with 3.0.5 it does not work anymore.
> !image-2020-07-28-00-00-37-055.png!
> This is one of the classes where this is happening:
> [https://github.com/Vampire/spock/blob/issue-1177/spock-specs/mock-integration/src/test/groovy/MockingIntegrationSpec.groovy]
> It works fine if I use Groovy 3.0.4 and it fails with a
> {{MissingPropertyException}} as soon as I switcht to 3.0.5.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)