You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (Jira)" <ji...@apache.org> on 2019/11/22 15:37:00 UTC

[jira] [Commented] (GROOVY-9313) Add setAccessibility(true) equivalent to BeanShell

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

Daniel Sun commented on GROOVY-9313:
------------------------------------

Groovy allows accessing private fields by default, but the feature is not recommended to use since Java 9 if you do not want illegal reflective accessing warnings.

> Add setAccessibility(true) equivalent to BeanShell
> --------------------------------------------------
>
>                 Key: GROOVY-9313
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9313
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-runtime
>            Reporter: David Ekholm
>            Priority: Minor
>
> We've moving more and more from BeanShell scripting to Groovy for our jAlbum app. There is one really convenient feature of BeanShell I hope Groovy has, but I can't find it. It's the setAccessibility(true) function call, which allows BeanShell code to refer to private fields and methods. This call is very practical when using BeanShell as a debugging tool. Any equivalent in Groovy? If not, can it be added please?
>  



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