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 2025/06/04 14:46:00 UTC

[jira] [Closed] (GROOVY-11667) GPathResult and attribute syntax within inner class

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

Paul King closed GROOVY-11667.
------------------------------

> GPathResult and attribute syntax within inner class
> ---------------------------------------------------
>
>                 Key: GROOVY-11667
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11667
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 5.0.0-beta-1
>
>
> This came in through the mailing list.
> {code:java}
>     @Test
>     void testAttribute() {
>         def xml = '''
>             <person>
>                 <name>John Doe</name>
>             </person>
>         '''
>         def path = getRoot(xml)
>         def text = path.@id.text() ?: null
>         assert text == null
>         assert new Inner(path).@id == null
>     }
>     static class Inner {
>         protected id
>         Inner(GPathResult gpath) {
>             this.@id = gpath.@id.text() ?: null
>         }
>     }
> {code}
> The problem has to do with the overloads of getAttribute and setAttribute.



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