Re: Groovy 5.0.7 and getter naming convention

Adrien Guichard <[email protected]> Fri, 17 Jul 2026 18:47:25 +0200
Newsgroups gmane.comp.lang.groovy.user
Message-ID <CAJHGhwCybU0tT23N_v5bmpYcqZ+DG3zvHhFJsxPKrawJDrJgiw@mail.gmail.com>
--0000000000005dc5570656d150dc
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks, for this quick and simple test-case!

Will have to debug to provide a relevant test-case on my side.

Regards

Le ven. 17 juil. 2026, 17:51, Jochen Theodorou <[email protected]> a =C3=A9=
crit :

> Hi Adrien,
>
> I just tested with this code:
>
> class X {
>    def getFirstName_(){"Adrien"}
> }
>
> assert new X().firstName_ =3D=3D "Adrien"
>
> The assert works, no exception. I think this is not because of Groovy
> 5.0.7 then
>
> bye Jochen
>
> On 7/17/26 16:05, Adrien Guichard wrote:
> > Hello,
> >
> >
> > We are porting our framework to Grails 8.0.0(-M3), which defaults to
> > Groovy 5.0.7.
> >
> > This framework generates getters from an AST Transformation at compile
> > time. Symbols generated are then used into some DSLs to compose element=
s
> > of our apps.
> >
> > There is an exception when launching our test app if the name of the
> > getters ends with an '_'; like in "getFirstName*_*()", if I replace the
> > '_' with another char, it fails after (missing symbols, because I use
> > 'someone.firstName_' in the code).
> >
> > Is there any restriction regarding the naming conventions for getters i=
n
> > Groovy 5 ?
> >
> > If not, I will dig further and fill an eventual bug report if needed.
> >
> >
> > Regards
> >
> > --
> > Adrien Guichard
> > + 33 6 10 78 75 88
> > Taack / Citel / Obsta
> > 29 Boulevard Edgar Quinet
> > 75014 Paris
>
>

--0000000000005dc5570656d150dc
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"auto">Thanks, for this quick and simple test-c=
ase!<div dir=3D"auto"><br></div><div>Will have to debug to provide a releva=
nt test-case on my side.</div><div><br></div><div>Regards=C2=A0</div></div>=
</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">=
Le ven. 17 juil. 2026, 17:51, Jochen Theodorou &lt;<a href=3D"mailto:blackd=
[email protected]" target=3D"_blank">[email protected]</a>&gt; a =C3=A9crit=C2=A0=
:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.=
8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Adrien,<br>
<br>
I just tested with this code:<br>
<br>
class X {<br>
=C2=A0 =C2=A0def getFirstName_(){&quot;Adrien&quot;}<br>
}<br>
<br>
assert new X().firstName_ =3D=3D &quot;Adrien&quot;<br>
<br>
The assert works, no exception. I think this is not because of Groovy <br>
5.0.7 then<br>
<br>
bye Jochen<br>
<br>
On 7/17/26 16:05, Adrien Guichard wrote:<br>
&gt; Hello,<br>
&gt; <br>
&gt; <br>
&gt; We are=C2=A0porting our framework to Grails 8.0.0(-M3), which defaults=
 to <br>
&gt; Groovy 5.0.7.<br>
&gt; <br>
&gt; This framework=C2=A0generates getters from an AST Transformation at co=
mpile <br>
&gt; time. Symbols generated are then used into some DSLs to compose elemen=
ts <br>
&gt; of our apps.<br>
&gt; <br>
&gt; There is an exception when launching our test app if the name of the <=
br>
&gt; getters ends with an &#39;_&#39;; like in &quot;getFirstName*_*()&quot=
;, if I replace the <br>
&gt; &#39;_&#39; with another char, it fails after (missing symbols, becaus=
e I use <br>
&gt; &#39;someone.firstName_&#39; in the code).<br>
&gt; <br>
&gt; Is there any restriction regarding the naming conventions for getters =
in <br>
&gt; Groovy 5 ?<br>
&gt; <br>
&gt; If not, I will dig further and fill an eventual bug report if needed.<=
br>
&gt; <br>
&gt; <br>
&gt; Regards<br>
&gt; <br>
&gt; -- <br>
&gt; Adrien Guichard<br>
&gt; + 33 6 10 78 75 88<br>
&gt; Taack / Citel / Obsta<br>
&gt; 29 Boulevard Edgar Quinet<br>
&gt; 75014 Paris<br>
<br>
</blockquote></div>

--0000000000005dc5570656d150dc--