groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daniel_sun <>
Subject Re: About the syntheticPublic property of member method node in class
Date Sat, 02 Apr 2016 09:00:24 GMT
I've fixed the issue in the new parser. Thanks for your help, Jochen :)

在 "Jochen Theodorou [via Groovy]" <>,2016年4月2日

On 01.04.2016 17:50, daniel_sun wrote:

> Hi List,
>        The following code is copied from GinA2, which we use to test the new
> parser for Groovy.
> class Book {
>      private String title
>      Book (String theTitle) {
>          title = theTitle
>      }
>      String getTitle(){
>          return title
>      }
> }
>        I have a question about the syntheticPublic of "getTitle" method node,
> which has no visibility modifier(e.g. public, protected, private), so I
> think its "public" should be synthetic and expect syntheticPublic  is true,
> but the old parser of Groovy set syntheticPublic  as false.  (related issue
> url:
>       Can you tell me the rationale about syntheticPublic and synthetic of
> MethodNode?

If you set those bean property methods to synthetic, IDEs will not offer
them anymore in auto-completion. I too was of the opinion synthetic
means "added by the compiler", but I see it now more as a "internal
method, not for the user". So all those mop methods we have/had or
rightfully synthetic, but bean methods like the setTitle one above does
not fall in this second category. getTitle is a method added by the user
and user-added methods should never be synthetic. And yes, no visibility
modifier means public.

bye Jochen

If you reply to this email, your message will be added to the discussion below:
To unsubscribe from About the syntheticPublic property of member method node in class, click

View this message in context:
Sent from the Groovy Dev mailing list archive at
View raw message