You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Leonard Brünings (Jira)" <ji...@apache.org> on 2022/05/02 12:29:00 UTC
[jira] [Commented] (GROOVY-10604) Changed behavior of DELEGATE_FIRST and static constants with Groovy 4
[ https://issues.apache.org/jira/browse/GROOVY-10604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17530712#comment-17530712 ]
Leonard Brünings commented on GROOVY-10604:
-------------------------------------------
This seems be be a conflict, of a non-groovy specific method with changed GDK behavior.
I don't think that [Jooq|https://www.jooq.org/] is likely to add Groovy as dependency to throw MissingPropertyException here to fix this issue.
What changed in 4 that makes this fall?
> Changed behavior of DELEGATE_FIRST and static constants with Groovy 4
> ---------------------------------------------------------------------
>
> Key: GROOVY-10604
> URL: https://issues.apache.org/jira/browse/GROOVY-10604
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 4.0.1, 4.0.2
> Reporter: Leonard Brünings
> Priority: Major
>
> {code:groovy}
> import spock.lang.*
> class Reproducer extends Specification {
> public static final STATIC_VALUE = "Foo"
>
> def "problematic" () {
> given:
> def sut = new JooqRow(backing: [a: 'some', b:'Foo'])
> expect:
> with(sut) {
> a == 'some'
> b == STATIC_VALUE
> }
> }
> }
> class JooqRow {
> private Map<String, String> backing = [:]
> Object get(String name) {
> if (!backing.containsKey(name)) {
> throw new IllegalArgumentException("$name not contained in this result")
> }
> return backing[name]
> }
> }
> {code}
> ([Groovy Web Console|https://gwc-experiment.appspot.com/?g=groovy_4_0&codez=eJxlUV1vgjAUfedX3JEl4GL8AWQuMYtL3EeWqNuLIUspF-wsLWsv6rL431cQFLf7UAo95_ScgyhKbQhsqflmJJnKRzee53HJrIU5lkanFUcDuCdUqYVFiVxkgjMSWsGPB27KKpGCgyX3kUMmFJOwWE6Ws_uP98nz2xTG4D9o7TfgZkkxA99pJxKLmuRDOGjF6snFFlV0eu0YtiInpXAHj1p_zfUuTBjfCJVHsGIRBFYXGAwhiQJ3WxAPTgK4d67pUnAnaB06xf693TAYj1u5f2dJfdZPd4E4eMf10FXYOu2aMmLLCOGFlbcLMs76EI7PO2izuISrKG7Qr8mnsw05UngEgWIF9g2LDMKrljjiWhETyj7hd9gA_0ajtXFO6v5mUmLO5MTkVYGKpnuOZf1DQ_-6ZoLSBK0cpiCUowoLBm0lyT_3eoDT1iBVRnUhVrVKfO6i7-IXccavEQ])
> This example works in Groovy 2.5.x and 3.x but fails with 4.x, is this an intended change?
--
This message was sent by Atlassian Jira
(v8.20.7#820007)