You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/08/29 06:18:00 UTC

[jira] [Commented] (GROOVY-8186) Builder ExternalStrategy constructors have trouble with private fields

    [ https://issues.apache.org/jira/browse/GROOVY-8186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16144805#comment-16144805 ] 

ASF GitHub Bot commented on GROOVY-8186:
----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/groovy/pull/547


> Builder ExternalStrategy constructors have trouble with private fields
> ----------------------------------------------------------------------
>
>                 Key: GROOVY-8186
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8186
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.x, 2.5.x
>            Reporter: Jason Terhune-Wold
>            Priority: Minor
>
> An undocumented feature of @Builder is that the builder's constructor can set default values for the fields. See http://stackoverflow.com/questions/35066664/default-values-in-groovy-builder-ast
> I tried creating an ExternalStrategy @Builder annotation for [BaseClientDetails|http://docs.spring.io/spring-security/oauth/apidocs/org/springframework/security/oauth2/provider/client/BaseClientDetails.html] with a constructor that set a default scope. I received a MissingMethodException exception, which I thought was odd.
> I added some tests to BuilderTransformTest that demonstrate apparent problems using the external builder in two situations:
> 1) A groovy class with private fields and manually defined setters.
> 2) A java class with a private Set field and a setter that takes a Collection
> The tests are here: https://github.com/jterhune/groovy/commit/5b2eb74cc8184235b5235b7fd4c80b241799bbc5
> I noticed this in 2.4.x. My tests fail in the 2.5.x branch also.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)