You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/10/05 21:00:00 UTC

[jira] [Commented] (GROOVY-6586) Read vs Write to members of base script supplied by @BaseScript is inconsistent

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

Eric Milles commented on GROOVY-6586:
-------------------------------------

{{groovy.lang.Script.setProperty(String,Object)}} was updated to check for setter before adding to binding.  This check is failing to find the setter in case of BaseClass application due to difference between {{getClass().getDeclaredMethods()}} and {{getClass().getMethods()}}.

See GROOVY-9554

> Read vs Write to members of base script supplied by @BaseScript is inconsistent
> -------------------------------------------------------------------------------
>
>                 Key: GROOVY-6586
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6586
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.2.1
>            Reporter: James P. White
>            Priority: Major
>         Attachments: BaseScriptTransformationTest.groovy
>
>
> The base script class supplied by the @BaseScript annotation is documented as being able to offer access to member fields to the script code.  But this only works for reading.  If an attempt to write one of those fields is made then a script binding is created.
> A workaround is to use getters and setters rather than accessing the field directly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)