groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daniel_sun <realblue...@hotmail.com>
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]" <ml-node+s329449n5732143h91@n5.nabble.com>,2016年4月2日
上午12:02写道:

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: https://github.com/jespersm/groovy/issues/19).
>
>       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:
http://groovy.329449.n5.nabble.com/About-the-syntheticPublic-property-of-member-method-node-in-class-tp5732142p5732143.html
To unsubscribe from About the syntheticPublic property of member method node in class, click
here<http://groovy.329449.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5732142&code=cmVhbGJsdWVzdW5AaG90bWFpbC5jb218NTczMjE0MnwxMTQ2MjE4MjI1>.
NAML<http://groovy.329449.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://groovy.329449.n5.nabble.com/About-the-syntheticPublic-property-of-member-method-node-in-class-tp5732142p5732151.html
Sent from the Groovy Dev mailing list archive at Nabble.com.
Mime
View raw message